Wednesday, September 28, 2022

Is Ruby on Rails suitable for beginners


Ruby is a language like the rest. It is important to study the base. I think that you can learn programming in any language if you have a base.


While Ruby and Rails have their own idiosyncrasies, they use their own approaches. An important role is played by mental programming, the accepted concepts are put at the forefront.


About Ruby on Rails


I compared Ruby on Rails with other frameworks like Laravel or Phoenix. These frameworks have taken a lot from rails, but they are not yet ready to replace rails. Yes, they are somewhat stronger. For example, the advantage of Laravel is that it is easier to find a PHP developer than a Ruby developer.


But in general, I think Ruby on Rails is an ideal framework. It is developing, a lot has already been done inside. And I would not want to change "rails" to some other framework.

Ruby on Rails: to learn or not to learn

 Is Ruby alive


The Ruby language and the Ruby on Rails framework are no longer as fast-paced as they were a few years ago. The hype has subsided, there is no rapid growth. A lot of the right things have already been done, and these things are being adopted by developers of other frameworks in other languages. In general, the language is alive and will live. Other languages ​​are far from Ruby and "rail" in some respects. Somewhere Ruby is better, somewhere worse.


On the expediency of studying


I've never looked for a job that requires knowledge of another language, so it's hard to compare. My ruby ​​friends all work, they write in Ruby. There are many vacancies for rubists both in Russia and abroad. There is work with relocation and remote work.


Many products are created in Ruby, the owners are not going to rewrite them in another language. Therefore, it is easy to find a job. An important point is that Ruby programmers get more specialists in other languages. It is difficult to find a rubist, so businesses poach programmers with knowledge of other languages ​​and retrain them.


So yes, Ruby is worth learning.

Monday, February 7, 2022

Nothing is perfect


Rails has its drawbacks. Ruby is slower than most other languages. This is likely to change with the release of new versions, but at the moment this drawback is critical for those applications that value processing time. In reality, this is not a problem for most websites.


There is also a problem with hosting Rails applications. Due to the size of the Rails framework code, it must be kept in memory at all times and loaded in response to a request. You need 100-200 MB of internal memory to host applications even with low traffic. By comparison, you can place PHP applications anywhere you want because they don't take up memory when they're not available.


Because of these server requirements, finding shared hosting for Rails applications is usually quite problematic. VPS (Virtual Private Server) is the best choice. Server setup is more complicated than for PHP. But now there are many Rails-centric hosting companies that provide turnkey solutions.


Another result of these server requirements is that Rails hosting tends to be more expensive than other platforms and languages.

RoR Views and Controllers



To create web pages, Rails provides a templating system that makes it easy to use, allows you to insert common components without repeating their code, information from a database, and display and process forms. These templates represent the "view" in the model-view-controller system.


If you're a front-end developer, this is the part of Rails you should be focusing on. You can assume that your files will be passed variables that contain all the information needed for display. Just as PHP files combine PHP and HTML code, the typical look of Rails is a mixture of Ruby and HTML. Let's continue the explanation using the example of our online store. For example, here is a code snippet that displays the title and author of a book:

<%= book.title %>

<%= book.author %>


The Ruby code is marked with <%= and %>; the rest is HTML.


Rails has built-in support for Prototype and Scriptaculous JavaScript libraries, as well as an object called Ruby JavaScript (RJS) for creating Ajax interfaces. You can write almost anything in Ruby, including client-side code like JavaScript.


The "controller" is part of the Ruby code. Its main job is to interact with the model to prepare the data the view needs.” Any information is collected by the controller into a set of variables before the view is called. The controller also responds to Ajax requests after the page has loaded. Controllers provide many other functions, from user authentication to error handling.

Is Ruby on Rails suitable for beginners

Ruby is a language like the rest. It is important to study the base. I think that you can learn programming in any language if you have a ba...