
We will conquer Ruby together! First drop
In order to immediately determine the target audience of this series of notes, articles, teachings a few words about yourself. A former student, a future student, I do not really understand anything in programming, although there are a couple of sites on the finished engines. In php scripts I can delete something, change something superfluous, but to write something from scratch is not for me. Repeatedly tried to learn the skill of creating programs, but usually slowed down as soon as it came to OOP (I saw these numerous classes in the code, all sorts of “objects”, “encapsulations”, etc. in the manuals and it hung ...)
Actually exactly the same desire has appeared now. After scouring the net in search of “something so interesting to learn,” I stumbled on Ruby with its rails. According to specialists of different qualities, Ruby is now relevant, programming quickly is full of OOP (which is promising in the future 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 stay afloat , persistent problems with hosting. But I’m kind of not going to start up in a multimillion-dollar audience, but it is always suitable for general education.
So it’s worth confessing that I know Ruby quite a bit, but I’m sure that my “drops” will be interesting to some individuals like me. I can (and will) often be mistaken in some concepts, methods, but are we ready to help each other? It seems like Habr is the IT elite, but I think that local specialists will not mind if we "hang out" with beginner guys :)
Actually in this series of articles we will drop by drop fill the glass with knowledge about Ruby, we will fill together - for me it will also be an additional incentive not to quit classes. I hope that you will be interested! Let's start
What is Ruby? Ruby is a complete, high-level, interpreted programming language for object-oriented programming. Interpreted - means that the program code is stored in plain text, which is transmitted to the interpreter executing it. It can be compared with PHP and C ++ - just like in PHP it is enough to write code, conditionally upload it to the server hosting, where the interpreter will execute it. In contrast, C ++ needs to be compiled, but we get a ready-made application that runs by itself, you don’t need to pass the code anywhere, but look at the source, look into the program, alas, it won’t work out - there is an unreadable binary code. Returning to Ruby, we conclude that this language is great for developing web applications and scripts, while in the OS its use is limited by the speed of the application (as suggested below,
What is Ruby on Rails? Literally: "Rub on the Rails." What rails have this YP put on? Rails is the best-known framework for the Ruby language. We can write scripts in pure Ruby (like most PHP scripts), but the rails can improve the speed and performance of writing code, in addition, this framework implements the MVC architecture (Model - View - Controller) - what it is and how to use it, we'll talk later.
Ruby and Ruby on Rails follow a couple of principles to help write code cleaner and more beautiful. First: DRY (Don't repeat yourself) . This means that we must write the necessary code only once and only in a strictly defined place. Second: CoC (Conventions over Configuration) - general conventions are more important than native configuration. For most of the methods needed in coding, there are already wonderful automatic settings that should be used, and in extreme cases, if the defaults do not suit us, we simply rewrite them for ourselves. Everything, so that the code is clean and concise, and at the same time we spend a minimum of effort.
I hope I was able to interest you :) Perhaps all of this you already know. However, if you are interested, we will continue. In the next drop, we will choose a development environment and write a couple of baby programs. Waiting for your comments!
The second drop is already waiting for you here , the third is here !
Actually exactly the same desire has appeared now. After scouring the net in search of “something so interesting to learn,” I stumbled on Ruby with its rails. According to specialists of different qualities, Ruby is now relevant, programming quickly is full of OOP (which is promising in the future 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 stay afloat , persistent problems with hosting. But I’m kind of not going to start up in a multimillion-dollar audience, but it is always suitable for general education.
So it’s worth confessing that I know Ruby quite a bit, but I’m sure that my “drops” will be interesting to some individuals like me. I can (and will) often be mistaken in some concepts, methods, but are we ready to help each other? It seems like Habr is the IT elite, but I think that local specialists will not mind if we "hang out" with beginner guys :)
Actually in this series of articles we will drop by drop fill the glass with knowledge about Ruby, we will fill together - for me it will also be an additional incentive not to quit 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 - means that the program code is stored in plain text, which is transmitted to the interpreter executing it. It can be compared with PHP and C ++ - just like in PHP it is enough to write code, conditionally upload it to the server hosting, where the interpreter will execute it. In contrast, C ++ needs to be compiled, but we get a ready-made application that runs by itself, you don’t need to pass the code anywhere, but look at the source, look into the program, alas, it won’t work out - there is an unreadable binary code. Returning to Ruby, we conclude that this language is great for developing web applications and scripts, while in the OS its use is limited by the speed of the application (as suggested below,
What is Ruby on Rails? Literally: "Rub on the Rails." What rails have this YP put on? Rails is the best-known framework for the Ruby language. We can write scripts in pure Ruby (like most PHP scripts), but the rails can improve the speed and performance of writing code, in addition, this framework implements the MVC architecture (Model - View - Controller) - 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 cleaner and more beautiful. First: DRY (Don't repeat yourself) . This means that we must write the necessary code only once and only in a strictly defined place. Second: CoC (Conventions over Configuration) - general conventions are more important than native configuration. For most of the methods needed in coding, there are already wonderful automatic settings that should be used, and in extreme cases, if the defaults do not suit us, we simply rewrite them for ourselves. Everything, so that the code is clean and concise, and at the same time we spend a minimum of effort.
Why Ruby?
- The language is extremely easy to learn in comparison with other languages
- Fully object oriented
- Rails MVC Architecture
- No need to write a lot of code
- Very expandable
- Open source
- Despite the fact that the Rails framework is young, it is multifunctional and contains very few bugs
Epilogue
I hope I was able to interest you :) Perhaps all of this you already know. However, if you are interested, we will continue. In the next drop, we will choose a development environment and write a couple of baby programs. Waiting for your comments!
The second drop is already waiting for you here , the third is here !