Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ruby Hacking Guide (2004) (ruby-hacking-guide.github.io)
128 points by swatson741 on June 21, 2023 | hide | past | favorite | 39 comments


Ruby is awesome AF.

Rails has been going through a midlife crisis.

I know there's other frameworks but Rails is awesome other than how they bowed down to different JS frameworks for asset pipelines in 5 and 6. This is spose to be better in 7, but I still get weird edges cases and and work tough them in code, and my therapist.

Sometimes I long for PHP, I left right as it was getting proper, Composer, Yii (I know most Laravel fans, but w/e), being able to just hot editing 1 line of code without full deploys.

Yeah, Many people will tell you how surprised they are that I advocated Ruby and Rails, and im fine with that.


>Sometimes I long for PHP, I left right as it was getting proper, Composer, Yii (I know most Laravel fans, but w/e), being able to just hot editing 1 line of code without full deploys.

Same here. Sometimes I wish there is something that takes the best of Ruby and PHP.


You can CGI ruby and run it just like PHP cant you?

https://stackoverflow.com/questions/2245634/setting-up-ruby-...


> Same here. Sometimes I wish there is something that takes the best of Ruby and PHP.

What would this language look like, and what features would it have?


Subset of Ruby Syntax and PHP like deployment.


Hold my beer...

Wait... I was going to cobble up something together with CGI, but then recalled that a) I did that already for a small internal project previous company† and b) mod_ruby is still a thing! I may still give it a shot just for kicks.

https://github.com/mikeowens/ModRuby

† CGI was good enough because it did not need that much perf, so I never needed to go FCGI/mod_ruby. Instead of FTP deployment was done via `git push` to a bare repo + server side post-receive git hook to checkout and atomically replace files (I was kinda mimicking Heroku there)


Holy! Ok I am going to check this out when I have time.


I find Ruby very good at gluing togheter multiple parts or for quick prototyping someting.

The metaprogramming is just too good.


I always thought ruby is to web projects what python is to data science.


This guide is interesting but extremely out of date. I recommend Ruby Under a Microscope[1] though it is also out of date as well (but less out of date than the Ruby Hacking Guide)

1. https://nostarch.com/rum


Great recommendation, I read this today and compiled some WIP notes if someone wants a sparknotes version: https://taintedcoders.com/rust/rust-for-rubyists/

I've been learning about Rust game development with some friends after being a long time Ruby developer and am looking for better ways of explaining the low level stuff to high level rubyists.


Hey tenderlove, what other resources you would recommend?

I've tried once, but felt the barrier to contribute to ruby-core to be too big, you'd also need to understand how ruby-core rubymine is organised and so on.

I'd love to write a guide about it, if I only knew. I bet many other engineers faced a similar issue and dropped out at some point.


While RUM is out of date, I still think it's an excellent resource. Some of the information in the book may be out of date, but I think it's an excellent place to start when you want to jump in to Ruby's source. Basically, after reading RUM the best place to go is to start reading the source.

That said, it would be really great if Pat (or someone besides me) published an update version of RUM


Shall we consider Ruby essentially dead if two good references are 10+ yrs old?


“JavaScript: the good parts” is an excellent but dense introduction to javascript circa 2008, and “JavaScript and jQuery: Interactive Front-End Web Development“ released in 2013 was originally how I got into web development, with its unique visual approach to explaining jquery’s features.

So it’s with a heavy heart, I must announce the death of JavaScript.


Only if they were the only two ruby reference books ...which they clearly are not.

Personally I still really like the Pickaxe book, the latest (5th) edition of which covers Ractors, Fibre Scheduling and static typing. All things added to the latest versions of Ruby.

I also really love Jeremy Evans' "Polished Ruby" book which I think has some really great ideas for how to write ruby well.

Despite a lot of FUD Ruby in 2023 is better than ever.

-

https://pragprog.com/titles/ruby5/programming-ruby-3-2-5th-e...

https://www.packtpub.com/product/polished-ruby-programming/9...


Yes, all languages with two good references that are 10+ yrs old are essentially dead.


That's why nobody uses C!


RIP C, Java, JavaScript, Python


It's all about Crab now.


Essentially stable.


Not sure why this is posted today, but for the other kind of Ruby 'hacking' there's Ronin[1]

1: https://ronin-rb.dev/


Ronin is doing some interesting stuff, been following it for a while


I hope this gets updated. I learned Ruby through looking at the Rails code and studying the internals a bit and it was a great way to understand what is, in my opinion, the best web framework by a country mile.

Once you learn what the "magic" is and how to create it yourself and the tradeoffs involved, it becomes much less of a problem than it is for others who don't dig in to how Ruby/Rails work.

I eventually moved to working in a proprietary environment where you can't do that, so I've had to rediscover learning from the manual instead of digging into the code and seeing how things really work.


Also useful: these codecademy cheatsheets are easy reading and cover ruby syntax basics: https://www.codecademy.com/learn/learn-ruby/modules/learn-ru...


I wasn't aware of these cheatsheets. These are great!


You may like ruby-docs.org, it’s well designed and good if you want to lookup something to be sure.


Related:

Ruby hacking guide - https://news.ycombinator.com/item?id=6197222 - Aug 2013 (22 comments)


I like the topic of this book, does anyone know equivalents for other languages?



Any similar but updated so it includes new festures Ractors?


Coding in Ruby is like a hack, where you can just modify any object you want at runtime.


That's like going through an inkblot test and saying "what's all this pornography supposed to prove?"


I haven't heard of a company using Ruby at scale that aren't actively trying to migrate off of it.


Even if true, that isn’t necessarily a reason not to use Ruby. RoR is famous for getting your MVP out there in front of users fast. Which is what matters for a startup.

Needing to migrate off it as you count the fuckyou money? I’ll take that problems thanks!



Maybe you're responding to survivor bias.

The companies you're talking about are the ones that got to market first and survived because they used Ruby. Those that didn't simply aren't around any more. ...like those competitors to Github and Gitlab that bet against Ruby. :P

More seriously you're probably just not aware of the wider market. Rails >7, including Hotwire, is fantastic for small productive start ups. If you want to move fast use full-stack Rails.


Seriously? Even the big ones like GitHub, Shopify, Stripe?

I just got a job last year with a company that used RoR. It was challenging but it's fun to work with now, coming from a Java background.


Do you use Github or GitLab? And Shopify for the rest.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: