Blog

Language Differences

C# is a compiled language, meaning after every change it needs to be compiled before testing and viewing changes. Ruby is an Interpreted language allowing you to add or change functions at runtime, being an interpreted language means there's no need to recompile the application each time you want to test a small update. I love this about Ruby as I don’t have to sit and wait for 10-15 minutes waiting to view my changes on large projects.

C# uses parentheses () to start and end a condition whereas Ruby uses the work end to denote an end to a scope. I find the Ruby way of coding a lot cleaner and easier to read with the use of words. For example:

if(1 == 1){
 //hello world
}

if 1 == 1
// hello world
end

Debugging / Development

In C# you can debug the code via Visual Studio with interactive breakpoints giving you the ability to view variables, step over/into code and more.

Developing sites in Rails was difficult to begin with without the use of interactive via an IDE. However breakpoints, viewing contents of variables and being able to step over each line of code can be done using pry, byebug and better_errors. I am now using Chrome’s Development Tools giving me access into the internals of the web application I am working on. This helps me find where issues lie (if there are any) within the structure, layout and interactivity of pages.

RailsPanel (which is an extension within Chrome for Rails development) provides an insight into rendering, parameters, logging and calls to the database.

The elements panel within Chrome lets me see everything in the document giving me the ability to inspect each element. Having the ‘on-the-fly’ editing capability is the most useful thing I have come across so far. Allowing me to edit the current document stucture/layout and seeing these changes on my screen instantly is the most efficient and agile feature that Chrome has to offer.

Development Environment / IDE

Developing in Visual Studio I had the use of VS plugins and IntelliSense. Allowing me to, access parameter info, use quick info, and the word completion tool. I could keep track of the Parameter’s that I was using and the calls to properties and methods with only pressing a few keys. I am now developing in Atom which is an open source editor built on JavaScript, HTML and CSS the same code that powers a web-site which is one of Atom’s advantages. Atom is open source, which makes it really easy to find great plugins that add useful functionality for Ruby on Rails development. Some of the functionality added via Plugins helps to bridge the functionality gap I was left with after leaving Visual Studio.

LINQ / ActiveRecord

The .NET framework included a large base class library created by Microsoft. The .NET framework made it easy to debug, deploy and maintain applications. A powerful feature I used was called LINQ, it introduces patterns that allowed me to query data easily. Visual Studio includes LINQ assemblies that facilitate the use of LINQ on a .NET framework collections and SQL Server databases. ActiveRecord is similar to LINQ, it transforms queries into a native query language, e.g. SQL. ActiveRecord handles the querying, saving and validation of Models within a Rails application, it's an ORM, similar to .Net’s EntityFramework.

Design / Layout

When creating an interface in XAML I frequently used a Grid or a Canvas when laying out columns and rows. XAML allowed automatic layouts for child elements, such as laying them out horizontally or vertically. Applying styles to grids, buttons etc provided problems with only having basic properties. I also used StackPanels and WrapPanels within grids to combine labels and textboxes. Setting attributes to these was straight forward but again provided limitations.

Laying out an interface using HTML is similar to XAML with the use of XML elements but doesn’t have ‘automatic’ layouts functionality that XAML provides. Laying out the HTML interface can be done through using CSS. CSS provides me with more possibilities and flexibility at the expense of more work. CSS allows me to style, animate, layout, add images, position element etc, effectively taking a document from a set of elements into a visual brand-matching website design.