In order to immediately identify the target audience of this series of notes-articles-teachings a few words about yourself. A former student, a future student, I don’t really understand anything in programming, although there are a couple of sites on ready-made engines. In php scripts, I can remove, change, the extra thread, but writing something from scratch is not for me. Repeatedly tried to learn the skill of creating programs, but usually he slowed down as soon as it came to the PLO (I saw these numerous classes in the code, all sorts of “objects”, “encapsulations”, etc., and etc. hung in the manuals)
Actually exactly the same desire appeared now. Having rummaged around the network in search of "something to learn so interesting," it came across Ruby with its rails. According to specialists of different quality, Ruby is now relevant, programming it quickly, it is a complete OOP (which is promising in further conquering the programming Olympus), the syntax is simple ... At the same time, the language is a brake, it loads the system, twitter flounders in it, trying to keep afloat , constant problems with hosting. But I’m not going to start up as a multi-million dollar audience, but I’ll always be suitable for general education.
So it's worth admitting that Ruby I know quite a drop, but I am sure that my “drops” will be interesting for some individuals like me. I can (and will) often make mistakes in some concepts, methods, but we are ready to help each other? It seems to be like Habr - this is the elite of IT, but I think that local specialists will not mind if we “hang out” here with the beginners :)
')
Actually, in this series of articles we will fill a glass with knowledge of Ruby drop by drop, we will fill it together - for me it will also be an additional incentive not to give up classes. I hope that you will be interested! Let's start?
Ruby, Rails ...
What is Ruby? Ruby is a complete, high-level, interpreted programming language for object-oriented programming. Interpreted - it means that the program code is stored in plain text, which is transmitted to the interpreter performing it. It can be compared with PHP and C ++ - just like in PHP, it is enough to write code, conditionally upload it to server hosting, where the interpreter will execute it. In contrast to C ++, you need to compile, but we get a ready-made application that runs by itself, no need to transfer the code, but look at the source code, look into the program, alas, it will not work - there is an unreadable binary code. Returning to Ruby, we conclude that this language is great for developing web applications and scripts, in the OS its use is limited by the speed of the application (as suggested below, for frontends and small utilities, Ruby is very suitable).
What is Ruby on Rails? Literally: "Ruby on Rails." What rails did they put on this PL? Rails is the most well-known Ruby language framework. We can also write scripts in “pure” Ruby (like most PHP scripts), but the rails allow us to increase the speed and efficiency of writing code, in addition, this framework implements the
MVC architecture
(Model - View - Controller) - about what it is. and how to use it, we'll talk later.
Ruby and Rails concepts
Ruby and Ruby on Rails follow a couple of principles to help write code that is cleaner and more beautiful. First:
DRY (Don't repeat yourself) . This means that we need to write the necessary code only once and only in a strictly defined place. Second:
CoC (Conventions over Configuration) - general agreements are more important than their own configuration. For the majority of methods required in coding, there are already wonderful automatic installations that should be used, and in extreme cases, if the defaults do not suit us, we simply rewrite them for ourselves. Everything, in order that the code was pure and laconic, and at the same time we spent a minimum of effort.
Why Ruby?
- Language is extremely easy to learn in comparison with other PL
- Fully object oriented
- MVC architecture in Rails
- No need to write a lot of code
- Very expandable
- Open source
- Although the Rails framework is young, it is multi-functional and contains very few bugs.
Epilogue
I hope I could interest you :) Perhaps you already know all this. However, if you are interested, we will continue. In the next drop, we will select the development environment and write a couple of baby programs. Waiting for your comments!
The second drop is waiting for you here , the third here !