Debugging Ruby on Rails…as a C++ Developer – Part II

Photo of train tunnel by Florian van Duyn on Unsplash

Ruby logo

The intent of this article is to approach development and debugging of Ruby on Rails applications from the perspetive of a C++ developer. In Part I I discussed some of the fundamental differences between Ruby on Rails and C++ development.

I started a simple "blog with comments" example to step through and showed how to use the ruby console to debug the model and what some of the exception messages returned to the view are telling us.

Where are the exceptions?

While we know the model is right (we debugged it already) sometimes there is no exception information being displayed. Where do we turn then? In this part of the article I am going to expand on our example and go deeper into what to look for there are no meaningful exception messages.

(more…)

Debugging Ruby on Rails…as a C++ Developer – Part I

Photo of train tunnel by Florian van Duyn on Unsplash

Ruby logo

Quick background

If you already know why C++ and Ruby on Rails are fundamentally different and just want to see the example, you can skip to The Example.

I’ve been developing software for many years but, for the most part, have stayed in the C++ world. I made the transition to web applications development with C# ASP.NET MVC applications, which I felt is a fairly easy transition. Adjusting to the MVC design pattern took a little change in thinking but it’s not a terribly difficult pattern to understand. It’s been a few years now and I am quite comfortable in that world.

C++, and its garbage-collected baby brother C#, are straight-forward. There is very little magic involved. If you know the language, the ASP.NET MVC platform all just kind of makes sense. It does exactly what you tell it to do. If you understand C# (and to some extent HTML and JavaScript), you’re 90% of the way to understanding ASP.NET MVC.

Ruby on Rails is different. Very different

(more…)