9 ms·
Ruby in Twenty Minutes (2006)
- aboutruby 8y agoThere is also https://ruby.github.io/TryRuby/ https://ruby.github.io/TryRuby/ (inspired by the now defunct tryruby.org) Also my favorite: https://learnxinyminutes.com/docs/ruby/ https://learnxinyminutes.com/docs/ruby/
- de9xvnh7 8y agoIsn't it a bit late for Ruby now?
- thinkingkong 8y agoLate in the day, you mean?
- throwaway427 8y agoPersonally I love a little Ruby after dark...
- luislezcair 8y agoIt's never too late for a little bit of vitamin R.
- wgj 8y agoThe obligatory and beloved, http://poignant.guide/ http://poignant.guide/
- bepvte 8y agothis, along with some of julia evans excellent 'zines, are going straight on my bookshelf if i ever have a cool bookshelf
- zach43 8y agoi'm a bit confused about who the target audience for this tutorial is...it is too fast-paced for a newbie, but also seems to be too basic for anyone who is experienced with other programming languages. not entirely sure what the "in twenty minutes" bit is aiming to achieve here
- MuffinFlavored 8y agoWhy would anybody want to learn Ruby over say... node.js/Typescript these days?
- mykowebhn 8y agoI believe your question would be more poignant if you s/node\.js\/Typescript/python/ . There's a lot more overlap between the use cases for Ruby and Python. Just saying.
- zach43 8y agoi've always thought of Ruby as a very clean, elegant, ergonomic language to write tools in (based on a few months of experience working with it a few years ago). I'm familiar enough with JS that i would primarily use JS now for web stuff, but Ruby is quite a nice language to use, and I wouldn't be surprised if its easier for beginners to learn than JS. In any case I think that skills in any one of the popular 'big' higher level dynamically typed languages (Ruby, JS, Python) are fairly transferable to the others too.
- duncan-donuts 8y agoI remember people suggesting I learn javascript when I first started out. I found the syntax of ruby way easier to understand in those early days, and found ways to actually build stuff when I didn’t really know what I was doing. Now I sort of miss ruby (while writing node/typescript all day everyday).
- h1d 8y agoI agree. Mainly done PHP and Nodejs and lately helping on a ruby project but I like how it's more fun when other languages feel more tight. I feel too bad that Python had taken over the position of Ruby more or less.
- stanislavb 8y agoAlso - the fun way to learn Ruby https://news.ycombinator.com/item?id=19125800 https://news.ycombinator.com/item?id=19125800
- webgoat 8y agoWow, I thought Ruby was supposed to be an elegant and simple language for developers but now I realize why it's dying off. It looks like it's trying to cater to newbies and not real developers with all the syntax changes and odd paradigms. I'll stick with Python.
- tracer4201 8y agoWhat's wrong with catering to "newbies"? How do you define "real developers" vs. a newbie? One of my previous teams at one of the big tech companies who's products or services you likely use every day had an entire suite of tests for data pipelines that were quickly implemented in Ruby. That system is still in production today. I guess none of the folks on that team were "real developers", huh?
- freehunter 8y agoThe folks at Basecamp, Github, AirBnb, Hulu, Kickstarter, MyFitnessPal, Twitch, or tons of other Rails-powered sites must not be "real developers" either...
- spricket 8y agoRuby is going the way of Perl, same as the Dodo. I wouldn't recommend anyone learn Ruby over Typescript, JS, Python, C#, or Java. There's too much magic and Ruby is seriously sllllooowww. Slower than PHP, Perl, and Python. The main draw of Ruby was rails, which is functionally obsolete for modern front end frameworks like React and Angular. It's the OSS version of Asp.Net WebForms
- chalupa-mankey 8y agoRuby is a little faster than Python in most situations these days, to nitpick.
- mixmastamyk 8y agoEvery new version of Py has speed improvements as well.
- spricket 8y agoNo definitely not. Reply with a link to any benchmark from the last couple years and I'll believe you
- tny 8y agohttps://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/ruby.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Ruby is fast in some cases and python in some other cases.
- pmontra 8y agoFrom 2018 https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/ruby.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Sometimes Ruby's faster, sometimes Python is. However all those benchmarks are probably useless. They are not testing how the language is used or should be. The trick with all the scripting languages is to make the CPU spend most of its time in the C code inside the standard library or the implementation of the native constructs of the language with as little overhead as possible. Example: you don't want to do numerical computation using plain Python, you want to use Numpy. You also want to learn very well all the ways Ruby's standard library can group operations in a single method call saving time compared to naive multi method chains.
- stevebmark 8y agoHow to grind your programming career to a halt in 20 minutes by buying in to a community that thinks metaprogramming, duck typing, monkeypatching, unsealing and resealing, and _everything_ done at runtime are good ideas, with no self awareness or ability to understand why other ecosystems left these terrible ideas behind.
- Rapzid 8y agoThe community has matured a lot over the past decade. Practical OO Design in Ruby seemed to introduce a paradigm shift as people discovered the old ways could help them write more maintainable code. And that just because you can(meta programming), doesn't mean you should. I haven't had to deal with Ruby in a couple years though.. I don't miss mixin hell, or chasing down a code line from a strack trace that doesn't exist because it was generated at runtime(I hope your ears are burning Chef).
- x15 8y agoRuby helped me grasp the basic OOP concepts when I was a teenager, just by reading tutorials and blog posts during the time RoR was all the rage. It was one of those unexpected moments of extreme enlightenment I haven't experienced in a while now.
- jackewiehose 8y agoEven though I always wanted to learn some ruby, I never made it through any short tutorial. My problem is: I already _know_ that LISP is the best language(-family) ever and probably nothing in future will change that. And meanwhile I accepted python for daily use because it has so many libraries.
- machiaweliczny 8y agoLISP is maybe expressive and composable language but "best" depends on usecase. From my understanding due to runtime code generation possibility it's hard to "read" (analyse control flow). When code is hard to read then it's also hard to cooperate. That's probably a reason why LISP isn't more popular. Ruby shares some of these issues due to too much runtime ability. It's maybe nice to use and beautifull from the outside but too messy inside and you can't really rely on it. Kinda like a cheap girl :P What you know LISP is best for?
- pjmlp 8y agoBeing a Ruby that AOT compiles to native code and has very nice IDE tooling experience.
- lucidstack 8y ago> Kinda like a cheap girl :P Wow, nice use of sexism to annihilate any quality that could be attributed to your comment. Please don’t.
- machiaweliczny 8y agoSorry for that. Couldn't resist sharp metaphor.
- em-bee 8y agoafter learning common lisp and smalltalk i realized that almost none of the languages that were created after added anything new to the language. this doesn't make lisp the best language, but certainly one that's good enough, and the only thing holding it back today is lack of popularity, not lack of ability. i feel that newer languages add a more complex syntax without necessarily simplifying the the process. though here i feel that ruby and python have a rather nice syntax, and it's debatable which is actually easier to read. for my part, i like the minimalistic syntax of either lisp or smalltalk, because they make it easier to reason about the code once you get used to it because there are not so many syntactic elements that i need to keep track of. but both do take some getting used to. maybe ruby and python today feel easier to pick up because we start learning with rather complex syntax.
- djohnston 8y agoI've never learned ruby in an intentional manner, but whenever I needed to write some, I found that things just worked the way I expected it to, and the docs were always super helpful. To be fair, I haven't built anything large scale with it, but my experience with the language has been anecdotally pleasant.
- colechristensen 8y agoI am having the opposite feeling about Python. Seems everyone is using python these days and I am constantly running into things which I like just a bit less as I am trying it for side projects. Things just don't quite work the way I expect them to.
- enraged_camel 8y agoSame. I’ll get downvoted for saying this but I find that it is a very overrated language that is popular mostly because of its dominance in fields that are currently in the vogue, i.e. ML/AI. (I know Django is a thing, but that has always been in the shadow of Rails, and rightly so.)
- nkozyra 8y agoNo downvotes, but I think it's popular because it's an extremely well-designed language. It has a ton of warts - not even to mention the 2.x -> 3.x kerfuffle - but in general it is a thoughtfully designed language.
- wenc 8y agoIn 2005 I had to choose to invest in learning either Ruby or Python as a primary language for writing a fairly complex piece of technical software. I looked into Ruby and it struck me as being a truly aesthetically pleasing language, and since it espoused the "principle of least surprise" -- with caveats, naturally -- most Ruby code tended to be straightforward to read. Python on the other hand, while clean -- I came from Perl -- had a fair bit of ugliness like the "self" argument in class methods, and the "dunders" in dunder methods (__init__). That said, the Python ecosystem, especially in the numerical computation space, was far ahead of Ruby's at the time, so I chose Python. It worked out really well and allowed me to accomplish what I needed to. To this day I have no regrets choosing Python. Compared to many languages (like Haskell etc.) Python's design isn't the most aesthetically pleasing or orthogonal or clean. But being a Dutch design, at least initially, it was very pragmatic. And Python is by no means ugly on an absolute scale, on the contrary. It’s just not as beautiful as some others. Python's main advantage is the energy behind it: to this day there are no converged alternatives to Numpy or Pandas on Ruby. I can't help but wonder that if in an alternate universe/timeline, Travis Oliphant, Pearu Peterson, Wes McKinney and others happened to have encountered Ruby first, we might have a different de facto language for scientific computing and data science.
- rlue 8y agoI'm a self-taught junior developer who started with Ruby in 2016. I've very much enjoyed the experience so far, and am currently rather invested in Rails, though I'm preparing to branch out into other areas of web development (I'm looking at you, React). This thread is really opening my eyes to the sheer vitriol that gets directed at Ruby outside of its own echo chamber. I get that it has performance issues (to be addressed in Ruby 3) and interest in Rails is now less than half what it was at its peak.[0] Everyone has very strong opinions, and when people start soapboxing like they are in this thread, nobody learns anything. At this point, honestly, I just think the rest of the community could use a little bit of Ruby's characteristic niceness.[1] [0]: https://trends.google.com/trends/explore?date=all&q=%2Fm%2F0505cl https://trends.google.com/trends/explore?date=all&q=%2Fm%2F0... [1]: https://en.wiktionary.org/wiki/MINASWAN https://en.wiktionary.org/wiki/MINASWAN
- toasterlovin 8y agoThe people who complain about Ruby performance are really missing the the forest for the trees, IMO. Most people are using Ruby for web development. Web development has hundreds of milliseconds of latency that there is absolutely no way to get rid of (in the form of transit to the server and back to the client). Then you're doing a bunch of I/O. The actual amount of time spent executing Ruby is just not significant in all of that. Ruby could be 2x faster than it is now and it would probably make a sub-10% difference in response time for most of the endpoints in most of the Ruby/Rails apps I've encountered.
- lucidone 8y agoExecution speed of your server code is critically important in today's atmosphere. It's a lot easier to scale an application than the database behind it (e.g, spin up a few more VMS/containers vs. partitioning your db - one is a 2 minute task, the other a bohemian effort). That being said, I enjoy Ruby a lot, and mostly enjoy working on Rails codebases (depends on how the front end is built, as Rails particularly _doesn't_ prescribe any form of convention here). I wish they worked on improving the front end story like Laravel has.
- Teichopsia 8y agoI just started playing around with ruby (on rails) a few days ago and there is something I found frustratingly refreshing (I consider myself a Jr.) in comparison to python. The directory is Ruby's virtual environment. End of story. I was awed and mildly cursing at the same time.
- faitswulff 8y agoVirtualenvs are easily the worst part of python EDIT - I asked 9 months ago and the top comment recommended pipenv and flit: https://news.ycombinator.com/item?id=17062184 https://news.ycombinator.com/item?id=17062184
- Teichopsia 8y agoThere was a lot of negativity around pipenv a couple months ago. https://news.ycombinator.com/item?id=18612590 https://news.ycombinator.com/item?id=18612590 I just use pythons integrated venv and pip, which work fine for me. However, it was in that same thread (the link posted in this comment) which suggested poetry and another I believe, which I do feel like trying out.
- TomBombadildoze 8y agopipenv is still a mess. Definitely give poetry a shot, it's really good. In particular, I enjoy how the maintainer engages with the community and is receptive to feedback. He's pretty good about adding features to satisfy the users, rather than handwaving legitimate concerns in one-line responses.
- mlevental 8y agowhat's wrong with virtualenv? I've never had a problem
- mixmastamyk 8y agoJust unnecessary complication.