Originally I published this article on Syndicode blog.
In the company I work in, we do pay a lot of attention to materials, tutorials, and news around RoR and Ruby. Recently I found quite an informative, well-written article about Ruby main features explained for the beginners. And I decided to translate this material for the English-speaking community. So today I'm going to present you Ruby for beginners: interesting facts and learning process.
Originally this material was written by Ivan Bondarenko, who is Senior Software Engineer and Ruby Technical Lead in one of Ukrainian software development companies. And I appreciate his efforts in delivering such an informative and detailed overview!
His main goal was to tell the beginners about Ruby and share his 6-year work experience.
Ruby main features and differences
Is Ruby worth learning? This question is based on doubts about finding a proper job or whether there will be some interesting projects. Ruby is a modern, constantly evolving programming language with plenty of areas for implementation.
You’ve probably heard about Chef, Vagrant, Homebrew, but most of us definitely heard about Rails. The post from the creator of Rails about why we should learn Rails can help you understand the point.
Of course, there is no point to argue about why one technology is better than other. You can choose Ruby because it is an incredibly expressive and flexible language that allows solving the same task in many ways.
Ruby is an interpretable, object-oriented programming language with a clear dynamic typing. It combines a Perl-like syntax with an object-oriented approach. Also, some features are borrowed from Python, Lisp, Dylan, and CLU. Cross-platform implementation of Ruby’s interpreter is spread on the conditions of open source software. A code written in Ruby can be understood even by a person who does not understand the programming. Projects such as Redmine, Twitter, Shopify, Basecamp, GitHub, Kickstarter, Airbnb, and others were created with RoR.
With the rise of Node.js, the popularity of Ruby on Rails has somewhat decreased, but technology startups often use RoR because of the simplicity of prototyping. Ruby is the 11th most popular language according to the TIOBE index.
♥ If you have read our article about Rails advantages, you can find Ruby advantages to be quite similar.
Ivan names the next Ruby advantages:
- Numerous friendly community
- A fairly high entry threshold, which means that the Ruby developer is likely to have experience in other programming languages
- You use only those libraries and modules that are required
- There is a large number of useful ready-to-use libraries (Ruby Gems)
- There is a lot of structured and tidy information about Ruby on the Internet
Now let’s talk about all we’ve mentioned in details.
One of the benefits of Ruby and the RoR framework is the speed of development. Compared to other frameworks, with Rails you can solve the same issues 1.5 times faster! Ruby is very simple as a tool, and there are a lot of ready-made solutions for a variety of tasks you can only imagine.
Tools for data caching
When designing a large-scale project, caching is one of the most important issues. Ruby on Rails has standard data caching tools in its main package. That’s it, from the very beginning you will have the tools to cache project data. Also, and you can easily cache individual blocks of code or even entire pages.
Test first, then code
This is the common situation when you don’t have an additional budget for the team of testers. Especially this is hard when you develop some large projects. Rails has the solution for this kind of problem. If you compare RoR with other frameworks in the context of application testing, you will find a bunch of ready-made solutions for any type of test, whether it is an integration or unit. All these libraries are out-of-box. In RoR, you wouldn’t start the code until the tests are written. Rails ideology implies the initial use of BDD (Behavior Driven Development) or TDD (Test Driven Development) techniques.
General standards of Ruby development
When we talk of Ruby benefits, we can’t avoid its community. The community of Ruby is constantly growing, developing and is always ready to help. There is always someone who will tell you how to solve the problem in a better way, share the experience on any issue.
For many years already Ruby community provides some community standards and rules/agreements for the development process, which greatly simplifies the work. Due to these standards, each project is highly structured, and each new developer can quickly become a part of the project and benefit it. And even more: if the project was started by one team, and the other team is about to finish it, this is also not a problem. As the development is under the already mentioned rules and community agreements, the new team will quickly and easily enter into the project and successfully complete it without much loss of time.
Ruby on Rails has a large number of various ready-made open source solutions. Most of the solutions have already been implemented by somebody, and also tested by the community, which reduces the need for development from scratch. These can be systems of authentication, authorization, commenting, payment systems, mailing lists and so on.
Ready-to-use multilingual project solutions
Basically, Rails has the very powerful tools for the project localization. There is an opportunity to provide support for several languages initially, and to implement it later. The project contains special files for the translation of the terms, tools for displaying templates in different languages, and more.
High level of data protection
Ruby on Rails framework developers have taken a very serious approach to data protection. RoR initially encrypts passwords, credit card data, and other user data. SQL injections and XSS attacks are also almost impossible. All input parameters are protected by default.
♥ We already prepared useful material with books, videos, and tutorials to learn and master Ruby.
Additionally, the author provides more links you can check info about SQL and other related topics:
After studying several resources, it’s worth moving to the most important part called ‘practice’. There are enough of examples of tasks to code an online store or a simple blog in Rails. While practicing the example you have chosen you can face some problems and then you will learn one of the most important qualities – the ability to use Google. Obviously, you will. That plays a special part in your everyday work.
After completing the theory and writing several ‘pet projects’ you can try interviews. But it often happens that this knowledge you received is not enough. This is due to the large influx of candidates, and, given the competition, everyone tries to stand out and prepare as much as possible.
Pay attention to courses on programming – you can benefit from them and receive more practical knowledge. That will be a plus at the job interview. But consider courses when you do already have some knowledge. In case you just started and have no background, we suggest you try books and tutorials first.
The author considers courses as a great way of consolidating the self-study gained knowledge.
7 advantages of programming courses
How will you benefit from courses?
- With a high probability, you will learn something you did not know before. The courses have a large amount of material that is delivered in structured form, which allows you to better absorb the material.
- During the course, you will have a mentor who will make a review of your tasks and point out weaknesses and mistakes.
- Feedback. At the lesson, you can ask a question to a teacher or classmates or simply share experiences. Of course, the same can be done at a conference or meetup, but unlike attending conferences, you will have the opportunity to do this more often in courses (usually 2-3 times a week).
- Motivation. This point is primarily for those who need help with self-discipline. At times, it’s quite difficult to force yourself to do something regarding the prospects. When you visit courses, you will have a clear schedule to follow and the tasks you need to perform by some date. Financial motivation also plays the role in case of paid courses.
- Another advantage is the certificate. It is clear that in the end you will be judged by your knowledge, but the certificate is a plus. Especially if you have to compete with someone of similar knowledge level to get this job.
- You’ll get one additional project on GitHub. If you are a novice developer, then probably the project written for the courses you attend will be more interesting in terms of technologies.
- Employment. Speaking of courses, we do not pay attention only to paid ones. It often happens that companies themselves are training programmers to employ most talented of them in the end. This can be also an internship. This can be the best option in terms of not paying anything and getting the experience with real prospects of employment.
Ruby is the language that allows you to work without inconveniences and ceremonies that come with strictly typed languages. Ruby is easy to get started, especially if you already have development experience in other programming languages. You can quickly create prototypes from Ruby on Rails. In Japan, where Ruby was born, it was used to create games. Ruby is concise and readable as English, which makes the code understandable for beginners and non-programmers.
To start with Ruby you should read several books, do a few tasks yourself, and then if you feel the need to get more knowledge and experience or additional motivation – you can go to the courses, already having a certain amount of knowledge received independently.
The perfect option is a course or internship provided by the company you want to apply. The alternative is paid courses that will help you consolidate the gained knowledge. But don’t expect that after completing paid courses, you will easily go through an interview by showing the certificate. Not the certificate but your knowledge will be evaluated.
At the same time, with enough motivation, patience, and experience received with other programming languages, you can master Ruby on your own. Because there is a lot of useful information on the Internet. Also, thanks to the Ruby community, it’s easy to find answers to many questions your predecessors have already been asking.
The original version of the article by Ivan Bondarenko can be found here.
p.s. to understand what Ruby community is I suggest you apply for the upcoming RubyC conference in Kyiv!