Live data from Hacker News

Why I believe Rails is still relevant in 2019

devbrett.com

221–230 of 264 posts

Re: Why I believe Rails is still relevant in 2019

#221
These days I find myself thinking of Rails as primarily a dsl for modeling data in SQL. I still don’t think anything beats it for this purpose.

But all things considered, I think TypeScript/react/lambda with VSCode is now a better choice for developer and devops productivity in both the short run and the long run. It’s still a good idea to follow many of the Rails conventions though regardless of the language you use.

Re: Why I believe Rails is still relevant in 2019

#222
post #159

Earlier quoted context omitted.

Elixir looks great until you look at modulecounts.com where Erlang/Elixir libs total a mere 7900. Compared with Ruby's 150900 gems that's a lot more code you're going to have to write surely?

That's a very valid concern. My personal opinion: Yes, the package system is pretty small. That's why it depends what kind of project you are gonna write and how much time you have. Ruby has a lot of gems, but many of them are buggy and deprecated... Proof: https://github.com/rubysherpas/paranoia I think that Elixir is gonna catch up. If you write a project where you need to use a lot of external libraries probably R…

In addition, Elixir libraries tend to be very high quality in my experience. This is not the case with gems; I'm always very hesitant to add a new dependency in my Ruby applications.

Of course, the quality disparity exists in part because there is a much wider pool of developers with varying levels of experience in Ruby, similar to Node.js. But I believe Elixir encourages and even enforces a certain level of code quality, without introducing fragile mutable state, security issues, and package incompatibilities. Thus I expect the quality of Elixir libraries will remain high even as the pool of Elixir developers grows.

Re: Why I believe Rails is still relevant in 2019

#223

Earlier quoted context omitted.

I recommend to not use an ORM. Really, with a modern language, an ORM is mostly redundant. If on Spring boot, simply use JDBCTemplate and TransactionTemplate to deal with raw SQL queries and transactionality. Get rid of all the annotation magic around this. Then you need a bare minimum of mapping code. Mostly this boils down to a single line of code to call the relevant constructors while you extract columns from you…

I have dynamically generated queries that span over 200 lines. Doing this without a query builder is pure madness. It doesn't matter how modern your language is, manually concatenating SQL shouldn't happen in 2019.

100% this. Whenever folks recommend simpler options like JDBI, I have to shake my head. Rolling your own query builder with string templates feels like an SQL injection attack waiting to happen. If you know 100% going into a project that you won't have to modify the structure of your queries based on user input, then it's an acceptable option. But it's quite common, at the very least, to have user input that results in variable number of terms in where clauses.

Hibernate is quite powerful and the tooling in IntelliJ (or Eclipse) catches many common mistakes at edit time. Where most folks get themselves into trouble is with all the caching setup. Not surprising, but if you want to just use Hibernate as a cache-less mapper there's always the StatelessSession interface.

I also don't get the oft-repeated notion that ORMs result in bad table design. You can map any tables you can dream up. And if you insist on doing inheritance, Hibernate has 4 different strategies for mapping to classes. Certainly one of those has the performance characteristics you're looking for.

Re: Why I believe Rails is still relevant in 2019

#224

Mostly an opinion piece, A few points to Observe : * According to the author NodeJS fails architecturally when small amounts of complexity is added to it. => Same applies to Rails aswell, anything beside a crud app and you start wondering which code goes where. * Rails is Opinionated... => Great if it were 2006, In 2019 rest apis are a norm, and more Nodejs apps get enabled everyday have the same feature. Infact serv…

Are you really choosing web frameworks based on how 'innovative' they are?

Re: Why I believe Rails is still relevant in 2019

#225
This particular blog post did a fine job articulating the benefits of Rails, and these remain good reasons to use rails in 2019. I think there's another side of this discussion. There are reasons why rails itself is worth using, and then there are reasons why MVC frameworks + a sprinkling of javascript are still worth using.

Personally, I feel that the latest trend toward heavy javascript front ends that are more or less detached from the middle tier or back end has led to a wildly overblown, over engineered state of constant technical churn. I quit web development over this. I got involved in a project for a while, but finally decided that if I had to write javascript in these constantly changing frameworks, I didn't want to be a web developer anymore.

Fortunately, I have enough of a math and engineering background and work experience that I was able to move over to writing code for answers more than for applications, though code for answers can be used as a wing of an app. I largely stay out of the framework now.

But I use python, not surprisingly. Ruby is a nice language, and Rails is an excellent framework. I think that rails plus a little bit of javascript is far more productive than the javascript churn, and for a lot of apps, you give up next to nothing in terms of functionality.

But if I got back into web programming, I'd probably do what I described above, but in Python. Ruby, for whatever reason, just isn't a big player in data engineering, data science, scientific programming, machine learning, all that. I haven't programmed in Django before, but much as I enjoyed Rails, I'd probably stick with Python at this point.

Alternatively, if the javascript framework hamster wheel dwellers want to handle that mess and let me write my wing of it in python and integrate it however they please, then, uh, sure. As long as management understands that when they quit, I won't be able to maintain it. A few people tried to get me to use node, but I won't do it. I feel secure enough that the scientific programming community will not be switching over to javascript so that we can keep our programming language consistent with the shit show that is modern web development.

Re: Why I believe Rails is still relevant in 2019

#226
post #106

Earlier quoted context omitted.

> starting from scratch or from a minimal base is massively slower This isn't the better alternative to frameworks. The better alternative is using libraries and optionally a bootstrap code generator, which is not at all "starting from scratch". The major difference is that you tell the libraries how to work together, rather than the framework telling you how to work. Some frameworks become like a terrible DSL that y…

> you tell the libraries how to work together Doesn't this just become a bunch of decisions and team cognitive load you have to deal with?

With frameworks you need a mental model of how the framework works. With libraries, you need a mental model of how your code works. On the balance of things, I would say that libraries often (not always) have less cognitive load here.

If you need the best library for the job, you can spend as much time as you like picking one. It's a matter of restraint to simply not spend that effort, and instead just pick a library because it meets your needs (without spending more than a moment evaluating whether it is better or worse than alternatives).

Re: Why I believe Rails is still relevant in 2019

#227

Earlier quoted context omitted.

Having worked with many different languages and frameworks over the years, I have to disagree: when creating web applications, starting from scratch or from a minimal base is massively slower, more error prone and less safe than starting from a well developed and maintained framework, where so many of the things you're going to need have already been solved and battle tested.

"more error prone and less safe" right there... if I could vote you up a thousand times, I would. I can place a bet that most home grown apps have no security measures against CSRF or XSS in place.

CRSF is not an issue for JSON API endpoints, since cross-origin requests are disabled by default.

XSS in my experience is best solved by a reasonable templating language. The same way you don't use string concatenation to insert user data into HTML documents, you don't use string concatenation to insert user data into SQL queries. Frameworks don't add anything here that you don't already have, and a lot of frameworks let you choose your templating system anyway.

This was a big reason to use frameworks in past days, though.

Re: Why I believe Rails is still relevant in 2019

#228

As an individual developer, I don’t know a platform and framework that lets me do more with my time. I used rails recently for a new project to act both as the backend for an iOS app, an auth management system, a asynchronous worker manager, an upload manaager, and BI tool. Combined with the mature gem ecosystem and clear mechanics for putting everything together, I was up and running immediately, and was able to con…

> a asynchronous worker manager something you don't need anymore with a modern stack > an upload manager, and BI tool standard stuff every other ecosystem has > mature gem ecosystem missing essentials like stable http/2 and full of unmaintained gems

Just to share for anyone interested in the Rails gems I'm using.

An asynchronous worker manager is helpful for handling cron jobs, mail tasks, and various batch processes that can be loaded into memory (mostly Redis) but processed later.

I use the gem Sidekiq which, as is, provides a UI and API that I rely heavily on. I might just not know the best practices, but I definitely find this valuable.

The BI tools are not something found in most ecosystems. Not to mention dead simple setup. I use two gems, Ahoy and Blazer, which together provide a simple API for event tracking and saving database queries.

[1]: https://sidekiq.org/

[2]: https://github.com/ankane/ahoy

[3]: https://github.com/ankane/blazer

Re: Why I believe Rails is still relevant in 2019

#229
post #162

Earlier quoted context omitted.

Let people say what they want to say online - what is this culture of wanting to shut down everything.

Shouting and insulting people is no way to have a discussion. Without moderation or some other mechanism this is what online communities devolve into and it destroys them. /r/programming used to have lots of great discussion. Now it's mostly a deserted wasteland.

>Shouting and insulting people is no way to have a discussion.

Says you! I don't enjoy the flaming, but things have gone too far to the other side where you can't anything online or you get CoC broken over it.

Re: Why I believe Rails is still relevant in 2019

#230
post #29

Earlier quoted context omitted.

> Popularity of a framework or paradigm seems largely driven by marketing and memes. I think a whole lot of developers choose technologies because they are popular at the moment for two reasons: they lack the technical knowledge and experience or maybe just confidence and/or they avoid some responsibility this way (since everyone is doing it). Of course this is most acute in web development because it attracts younge…

Young developers (as one myself), tend to be overly focused on what makes them attractive as a developer. Kinda like an overly insecure teenager. So they pounce on any framework or tech that makes them desirable to an employer. Rails isn't hot, so it won't get them a job so they won't learn it.

I don't like ruby or rails. But I feel not liking it has really hurt my career. The amount of job requests I get for Ruby on rails or ruby is significantly higher than my typcial stack.

Additionally a majority of the remote jobs I've seen have been Ruby as well. So despite it not being hip. It is still very much a requirement.

Post reply on HN