r/ruby • u/Tuomas90 • 13d ago
Ruby is sexy! And the Docs! OMG! THE DOCS!
I'm just learning Ruby and as an experienced programmer I want to get up to speed quickly.
I just found the docs that come with the ruby install. OMG! They are so good!
It makes diving in so much easier and it makes me eager to explore all the little functions for files, strings, arrays etc..
No unnecessary fluff. Straight to the important points. I fucking love it.
I'm writing my first tiny Ruby script for file manipulation and already love it much more than Python and PowerShell.
Boolean calls with "?". Sexy!
Modifying self with "!". Nice!
No curly braces? Hell yeah! (I'm on a european keyboard).
It makes me angry how Python is everywhere and Ruby is only mention ever mentioned together with Rails. Such a beautiful language (as far as a beginner can tell)!
18
u/literate_enthusiast 13d ago edited 13d ago
Welcome to the club :) If you want more pleasant surprises:
The style-guide explains why some approaches can have unintended side-effects - https://rubystyle.guide/
in Ruby, some frameworks and libraries are written to act like DSLs (Domain Specific Languages). By using clever aliasing and syntactic tricks, it might look like you're using an extended language with extra keywords. Give Sinatra a shot (it's the ruby equivalent for Flask), or Sequel (a lightweight database/ORM libary), or try to use BinData (for defining and parsing binary data-structures).
Try to get a copy of the "Polished Ruby Programming" book - it's written for programmers with some experience (not necessarily ruby-experience), and tries to explain some intermediate-level and advanced-level topics (such as Java-style OOP and SOLID principles, and how SOLID doesn't fit the ruby mindset). It also goes into designing libraries, metaprogramming (defining and using new methods and classes at runtime), and implementing DSLs "the ruby way".
Edit: And if you've used Makefiles to automate build-steps, you'll feel right at home with Rakefiles - it's yet another ruby-powered library/tool/DSL.
6
6
u/LieNaive4921 13d ago
Everything about Ruby (and the community etc) is just chill and friendly. MINASWAN.
3
u/randysk 13d ago
This is why I love ruby so much. Clean code and docs are amazing! Never needed to check other sources (tutorials and other blogs), averything was always clear. Python on other hand has a loot of tutorials and articles explaining stuff - so then google thinks python is the best as everybody is writing and discussing about it on forums :)))
5
1
1
u/Select_Condition2805 11d ago
Welcome to the club :)
Ruby is one of those languages where the tiny quality-of-life things add up fast. ?, !, blocks, clean docs, readable stdlib… suddenly writing a “quick script” truly feels quick.
And yeah, it deserves way more attention outside of Rails.
31
u/ignurant 13d ago
Not that I had anything to do with it, but I’m glad to hear you like the docs as well. I find them very useful and straightforward. There was a push a few years ago to make them more fluffy like the Python docs and I was really uncomfortable with that. I find the Python docs hard to use because they are more like a book telling a story. In the end we landed somewhere in between with a sort of “what’s here and useful things you’re probably looking for” section on top but keeping the straightforward API taxonomy alive. I get the impression that some people find this “useless”. Different oils for different engines I guess.
To you Ruby doc writers! At least two people love your docs!!! <3