Live data from Hacker News

Ruby on Rails in a week

simplethread.com

141–150 of 176 posts

Re: Ruby on Rails in a week

#141
post #99

Earlier quoted context omitted.

I really should try Rails again. I LOVE ruby, but have been anti-rails for a while and I am not sure I am right for that. I got into Ruby programming through Rails... but in 2005. Rails was brand new (I think I was on version like 0.12 or something?), and I slowly moved away from it to things like Sinatra and Sequel. Rails had some huge performance issues, and active record was pretty unusable at any sort of scale un…

I'm sure it depends on the complexity of the app you're building. For simple crud-ish apps (ecommerce, online auctions, etc) I've found that I don't need to write even a single line of custom SQL, and performance is generally good (lots of N+1s, but these are easy to avoid with things like bullet). I also love being able to let Rails render most HTML, and the few things that need to be very dynamic you can just throw…

"lots of N+1s, but these are easy to avoid with things like bullet"

What is bullet?

Re: Ruby on Rails in a week

#142
post #99

Earlier quoted context omitted.

I'm sure it depends on the complexity of the app you're building. For simple crud-ish apps (ecommerce, online auctions, etc) I've found that I don't need to write even a single line of custom SQL, and performance is generally good (lots of N+1s, but these are easy to avoid with things like bullet). I also love being able to let Rails render most HTML, and the few things that need to be very dynamic you can just throw…

"lots of N+1s, but these are easy to avoid with things like bullet" What is bullet?

It is a gem that tells you when you are accidentally making a N+1 query and suggests the best way to fix it in AR (it also tells you when you have over used includes that are not needed and other such tweaks to make to your queries).

Re: Ruby on Rails in a week

#143
post #99

Earlier quoted context omitted.

I'm sure it depends on the complexity of the app you're building. For simple crud-ish apps (ecommerce, online auctions, etc) I've found that I don't need to write even a single line of custom SQL, and performance is generally good (lots of N+1s, but these are easy to avoid with things like bullet). I also love being able to let Rails render most HTML, and the few things that need to be very dynamic you can just throw…

"lots of N+1s, but these are easy to avoid with things like bullet" What is bullet?

It is a plugin/gem that helps you track N+1 queries.

https://github.com/flyerhzm/bullet

Re: Ruby on Rails in a week

#144
post #14

Rails is in a really good place. When I learned it back in 2015 there were so many resources for learning, it felt like every time I had a specific problem related to a feature I was implementing there was either a railscasts or gorails video on it, along with 10 blog posts and stack overflow results. I can only imagine how much better it is now. It has been one of the only semi-modern learning experiences where I wa…

Exactly the same - the community around Rails is what makes it shine. The resources, the tooling (so many well maintained gems out there in the Ruby-sphere, even if a lot of them being Rails-oriented makes other frameworks second class citizens).

Railscasts and GoRails are some of the best resources out there - and without wanting to stan Chris too much, if you're looking for an easy to way to deploy Rails apps, I'm a very happy customer of Hatchbox [0] and Jumpstart Pro [1]. Should really get around to a GoRails subscription at this point...

[0] https://www.hatchbox.io/ (I feel like I sell this in every HN post about Rails, but it's a great tool and he deserves as many customers as possible)

[1] https://jumpstartrails.com/

Re: Ruby on Rails in a week

#145

Earlier quoted context omitted.

I read all of those and would like to add two more: 1) Learn to Program , by Chris Pine. It's the best book I've read on learning to program in any language. 2) Practical Ruby Projects: Ideas for the Eclectic Programmer, by Topher Cyll. In a sense it wasn't "practical" at all. But it was a joyous eye-opener to all kinds of applications that turned me into a whirlwind of enthusiasm for months!

> Learn to Program, by Chris Pine My first programming book, 10 years ago in a few months I think. Great read.

7 years for me next month

Re: Ruby on Rails in a week

#146

I hesitate to state that Ruby is making a comeback, because I don't think it ever really faded (isrubydead.com ;-) )…but it definitely feels like the momentum is picking up. 2021 is going to be amazing . Ruby 3. Rails 6.1+ along with new HEY-derived innovations. ViewComponent + StimulusReflex is quickly becoming a powerhouse combo. A ton of useful gems coming out all the time. I myself am furiously working on making…

The market (job vacancies) seem to imply otherwise, I rarely see it mentioned in comparison to Python, Go, PHP.

I think I'd rather just be a plumber that be forced to program in PHP

Re: Ruby on Rails in a week

#147
post #25

Anyone doing/thinking about Rails in 2020 should give matestack a try :) reactive user interfaces in pure Ruby (and Vue.js under the hood!) https://github.com/matestack/matestack-ui-core

You can roll this yourself with Cells ( https://github.com/trailblazer/cells ) and Stimulus Reflex ( https://docs.stimulusreflex.com/ ). I've been watching view_component too but the simplicity of cells keeps me happy. I've been working full time using both and love the flexibility. My process is mostly using state machines on cells which take in a struct and output the html for that state with Stimulus Reflex.

Trailblazer Cells and Stimulus Reflex are great tools, but one big advantage of matestack (https://matestack.io) is to write UI components in pure Ruby, giving you the possibility to use Ruby's language features creating a really dry and clean UI implementation while having a lot of fun doing so! Adding the reactive core components on top saving you a lot of time and effort creating reactive UIs in pure Ruby. Compared to Stimulus Reflex, you have to write less code and manage less added complexity. That's at least my experience. But as said: Cells and Stimulus Reflex are great projects, don't get me wrong. I just love the pure Ruby thing ;)

Re: Ruby on Rails in a week

#148
post #6
post #2

Having picked up Rails 9 years ago and having been using it literally daily ever since, it's joyful to read from someone that is just starting. I also started with https://www.railstutorial.org/book , highly recommend it. I also loved Metaprogramming Ruby (Paolo Perrotta) - it's more advanced and starts to open your mind to how Rails magic DSL's were built. I just bought today "Rebuilding Rails" ( https://rebuilding-…

Those are great resources. One I'd add to it, for general ruby programming, is the Well Grounded Rubyist ( https://www.manning.com/books/the-well-grounded-rubyist-thir... ) . It's been kept up to date (3rd edition was released in 2019) and I found it very readable and informative.

Agreed, this is a great book. In the past I used to read and write a lot of Ruby. An earlier edition of the book was the single resource that taught me the most.

The only programming language book I've enjoyed and benefited from as much since then is Fluent Python.

Re: Ruby on Rails in a week

#149

>“Rails generates a lot of functions and methods for you that aren’t defined in the code—I bet that will be hard to debug.” This was definitely the biggest obstacle for me learning Rails (and also Ruby at the same time). And also figuring out what part of the language was Ruby, and what part was Rails. Thankfully Rails' docs have come a long way from just OK to being some of the best in the business.

this is where rubymine really shines, you can right click and select "goto definition" which takes you right to the class that defines the method.

In other editors either Solargraph (via LSP) or even just exuberant ctags will give you the same facility.

Re: Ruby on Rails in a week

#150

Earlier quoted context omitted.

At least in the U.S there are more Ruby jobs than PHP, so what you're saying isn't accurate. In Europe (outside UK) Ruby is weaker I agree; php/.net seem to be way more popular.

Yeh, i'm going off London job market.

Hmm what do you base that on? I'm genuinely curious. Looking at Linkedin I see a lot of Ruby jobs in London, some in really top notch companies. To me London seems like a great place to be a Rubyist. Just for comparison's sake this is from Linkedin (London Metrpoloitan): Ruby: 1238 Node: 1940 PHP: 1332 Rust: 157 Python: 9208 Golang: 588 (might be called Go in many jobs though)

Conclusion: Ruby on par with php, less popular than Node but not by orders of magnitute, and used way less than Python. But comparing it to web development languages like PHP/Node, it's right there with them.

If anything Ruby is in bad form in mainland Europe (France, Germany, Netherlands) where for whatever reason PHP is king for startups.

Now for frameworks: Rails: 480 Laravel: 41 Django: 535 Symfony: 164

Conclusion: Rails is really up there with any other major framework. Could be that some job posts don't mention the framework, but I'm going with the data we have.

Some famous Ruby shops I know are from London: Deliveroo, GoCardless, Funding Circle, Babylon Health. I honestly don't see how this is bad.

Post reply on HN