Live data from Hacker News

Rails Has Turned into Java

discursive.com

111–120 of 160 posts

Re: Rails Has Turned into Java

#111

Earlier quoted context omitted.

If you love constant patching for the daily critical security holes, stick with Rails. If you love worrying where they have stuck yet another Yaml parser, and where else they are eval-ing user supplied data, stick with Rails. If you prefer a bit of an easier, less-stressful life, there is hope with many of the Perl, Python and PHP frameworks.

Like the Django patch that was released yesterday? ( https://www.djangoproject.com/weblog/2013/feb/19/security/ ) The fact that the Rails team quickly responds to vulnerabilities should be reassuring not a disincentive to use the framework. All software is subject to vulnerabilities - the recent issues with YAML are a class of exploit common across many frameworks in different ecosystems (Django's TastyPie had a simi…

Yes, Django took a solid step to properly fix the underlying issue, rather than apply many small sticky-plasters over several days instead, leaving the same basic vector open in the meantime. In fact, the Django issue reported was posted on HN yesterday and the comments on that posting underline what I just said here.

Remember - Python for Pros, Ruby to pose.

Re: Rails Has Turned into Java

#112
post #55
post #29

> Sure, Rails itself is straightforward, but the frameworks you slap on top of it can quickly become burdensome abstractions: RefineryCMS, Devise, Omniauth, Carrierwave, Unicorn, Rack Rewrite, Fog, New Relic, Foreman, AMQP, and Honeybadger, not to mention the extra magic that Heroku gems throw into the mix (backups and other fun). You don't need to use any of these. I once tried to use Devise for a project. I fiddled…

But, Devise is one of the better frameworks out there. Along with Omniauth it saved a huge amount of work. I'd reconsider Devise and look at Omniauth, it is a huge time saver. New Relic is awesome, but expensive and they do have an aggressive marketing automation thing going on with the emails and such. But, you can't blame them for that, they have to pay the bills and more power to them for that.

I think it's a matter of personal taste. Devise is a pretty large library that deeply entrenches itself in your application and expects you to do things in a certain way. I personally don't think it's worth the added complexity, instead I prefer using standard Rails features [1] to build exactly what I want. But then, others may feel it's not worthwhile to even use Rails and instead prefer to use Sinatra or Flask. Every developer seems to have their own comfort zone in terms of how much control they have. For instance, Linus Torvalds won't even use C++ over C [2].

Omniauth looks like something I would use, though.

As for New Relic, I certainly can blame them for spamming. I realize that everybody's gotta eat, but there is no excuse for them to send me "I wanted to connect regarding your interest in the New Relic trial. So far I have not been able to successfully reach you." after I already sent them two emails telling them to stop emailing me. Annoying anyone who hands over their email doesn't strike me as a particularly ethical business strategy.

[1] http://www.farbeyondprogramming.com/2011/05/rails-user-authe...

[2] http://harmful.cat-v.org/software/c++/linus

Re: Rails Has Turned into Java

#113

The pushback against Ruby/Rails has been building for a long time. There's always been jokes about Ruby being slow: http://harmful.cat-v.org/software/ruby/ But there was a stretch from around 2005 to maybe 2008 where Rails seemed to defy criticism. It grew and grew, despite the criticism. I tried it for a project in 2006 and I became a fan. The easy use of 3rd party code, via gems, was much easier than anything I had…

I'm looking to get started with playing around with Clojure web apps. Could you link me to any opening tutorials or explanations?

Re: Rails Has Turned into Java

#114
post #41

Earlier quoted context omitted.

I actually had to write some Java recently for the first time in about ten years. I was hoping that the evolution of the language would make it less painful than it used to be. I was unimpressed. Generics are better than nothing, but still dramatically worse than having a reasonable syntax for anonymous closures. The newer iterator syntax is better than nothing, but still maddeningly lacking in the most basic type in…

> even though 95% of the time the difference has no impact worth thinking about. Because the 5% of the time matters when you have a language that needs to run on everything from mobile phones to supercomputers. I personally much prefer being explicit about what I want to happen.

No non-trivial application ever, ever been WORM.

Re: Rails Has Turned into Java

#115
Post title seems like it should be, "Refinery is a messy CMS".

Seems like a good portion of these comments are comparing simple code written in (other-framework/language) with a big messy CMS written as an add-on for Rails. Hardly apples-to-apples comparisons, and only tangentially about Rails to begin with.

Re: Rails Has Turned into Java

#116

Actually what's happening is that Rails is turning into MS Access. Access is a product that famously makes 80% of what you want to do incredibly easy, and the last 20% impossible. The Rails ecosystem is growing so that you can, essentially, deploy your own MS Access, with exactly the same trade-offs.

This has got to be one of the worst analogies I've ever seen. One of Rails' core strengths is that it is written in Ruby which makes anything, even batshit-insane dynamic runtime monkeypatching possible. Not that anyone would advocate doing that as a matter of course, but the point is nothing is out of reach in a Ruby app.

Re: Rails Has Turned into Java

#117
post #98

Sorry, but this article is bullshit. First of all, it's a classic appeal to emotion; it uses hyperbole that is propped up with emotions ("You’ll find yourself staring at incomprehensible mega-frameworks maintained by developers who are unapologetic about how little they care for writing documentation", etc) and not by concrete facts. It cleverly it uses two fictitious quotes to imply it represents real people's compl…

You are joking right, "Try not to stuff your app with everything you can possibly think of." Like providing a admin interface on Refinery as well as authentication with Devise is "everything and the kitchen sink". I think you may be trying to defend something.

Have you used Refinery? I have and wouldn't base an app on it, or even use it again for a CMS - frankly you could build the same admin features better in Rails in a couple of days, and tailor them properly to your application. Refinery is not a good model of a rails app and is probably the main reason for his problems or perception that Rails is heavy - it was a mistake to try to base an app on it and most of his gripes seem centered on that - there's a lesson there and it's not about Rails.

Rails has become lighter with 3.x and will become lighter still with 4.x - they're dropping a lot of unnecessary stuff and trying to pare it down to the minimum - an admirable direction and quite the opposite to Java, which makes this article all the more baffling. Of course it's not the perfect framework and there are plenty of options, but the complaints of the article are histrionics.

The laundry list of possible technologies in the article is absurd - RefineryCMS, Devise, Omniauth, Carrierwave, Unicorn, Rack Rewrite, Fog, New Relic, Foreman, AMQP, and Honeybadger, Heroku.

You can get started with rails on a cheap VPS and serve your first few hundred thousand users with the following very simple stack: Apache, Ruby, Passenger, Rails. Setup is a few lines in your package manager of choice, writing the app is straightforward and requires none of the software above, maintenance is running aptitude update and bundle update now and then.

Out of the stack above, Devise is quite a nice authentication solution and is the only one I'd recommend, but it's easy to roll your own, as to the rest of his list, if you don't need it, don't bother using it, none of it is required.

Re: Rails Has Turned into Java

#118
post #98

Sorry, but this article is bullshit. First of all, it's a classic appeal to emotion; it uses hyperbole that is propped up with emotions ("You’ll find yourself staring at incomprehensible mega-frameworks maintained by developers who are unapologetic about how little they care for writing documentation", etc) and not by concrete facts. It cleverly it uses two fictitious quotes to imply it represents real people's compl…

You are joking right, "Try not to stuff your app with everything you can possibly think of." Like providing a admin interface on Refinery as well as authentication with Devise is "everything and the kitchen sink". I think you may be trying to defend something.

I am not joking. There is absolutely no reason to put an admin interface in an app.

Here is an example applicaion, let's call it Foo. It's a blogging tool:

* FooCore: This is an API exposing the data Foo that works with, and the ways to change that data. It has a Blog model, a Posting model and an Author model. It has endpoints like "GET /api/blogs", "PUT /api/blogs/:id/postings" and "GET /api/authors/:id" to create blogs and postings. It has no UI.

* FooApp: This is the user-facing frontend application. It serves the main site in HTML, JS, CSS and whatever other. It renders blogs from FooCore by calling is API. It has no logic other than presenting the UI and acting as an MVC controller and view (the M being the API). It calls the API both from its server app, as well from the browser via XMLHttpRequest.

* FooAdmin: This is the user-facing admin frontend app. It serves the "back office" admin UI for managing blogs and posts and users.

We now have a very elegant app where the division between the parts is crystal clear. The admin UI's requirements do not affect the public UI's requirements or vice versa. The underlying data model can't build up weird UI cruft because there is no UI to let sloppy devs screw it up with their laziness.

(Need a new UI -- say, you want to accept blog postings via email? Create a new app, FooEmailApp that handles only this interaction using the same API. Want to accept blog postings by fax? Create a new app, FooFaxApp. Neither frontends will have code that bogs down the other UIs. If you decide fax is dead, just delete the entire app.)

(And you can extend your own ecosystem of services organically. Need role-based permissions? Create an app for it, and wrap every HTTP verb with a check against the permission app.)

Anyway, the above app is not complete; you want login via Twitter, so we add Checkpoint into the mix. This happens:

1. When FooCore wants needs a user, it looks in its session cookie and determines which user it is.

2. If there is no user, we create a redirect to Checkpoint's /login/twitter. Checkpoint does the necessary OAuth interaction behind the scenes, stores the credentials in its store, update its own cookie, and redirects back to FooCore. (Remember, Checkpoint has no UI. It just redirects to Twitter, which displays the usual OAuth login/authorization dialog.)

3. FooCore can now use Checkpoint's cookie to determine who the logged-in user is, and it can ask Checkpoint for data such as the user's name and email. It can also create an internal User object that represents FooCore's own data about the user, such as blogs and postings.

The upshot: The app knows nothing about authentication. It outsources everything. It can focus on the important stuff.

This modular separation of concerns into separate apps sharpens your focus as a developer, and forces you to think about the data and the interactions that are necessary. Because of HTTP/REST's relative poverty, everything becomes a verb, and every verb must be designed separately.

Two other benefits: It forces you to think of reuse, since every feature becomes an opportunity to reuse a modular component. Secondly, it forces you to think of "presentation" and the divison between ugly internal state and public state, because every interface becomes much more exposed to the world; when an app becomes an API, you are subject to more scrutiny than if you were tucking the stuff away in some class somewhere in your app.

No, I'm not kidding. Back in 2006 we tried the old model of putting everything and kitchen sink (login/auth, normal UI, admin UI, promo site, email notifications, role-based permissions, statistics, visualizations, image upload etc.) into our apps. The model does not scale. The benefits of a "many small apps" model have been obvious even for relatively small applications.

I'm not defending anything. If anything I'm attacking? :-)

Re: Rails Has Turned into Java

#119
post #113

The pushback against Ruby/Rails has been building for a long time. There's always been jokes about Ruby being slow: http://harmful.cat-v.org/software/ruby/ But there was a stretch from around 2005 to maybe 2008 where Rails seemed to defy criticism. It grew and grew, despite the criticism. I tried it for a project in 2006 and I became a fan. The easy use of 3rd party code, via gems, was much easier than anything I had…

I'm looking to get started with playing around with Clojure web apps. Could you link me to any opening tutorials or explanations?

https://github.com/ring-clojure/ring and http://clojurescriptone.com/ should get you going.

Re: Rails Has Turned into Java

#120

Earlier quoted context omitted.

I know it is not the mode to comment to mention your own up vote. Rails might have deteriorated in ease of use, but I cannot imagine it being worse than Java EE was in 2004. Modern Java EE is a world of pain, even simple apps are difficult to build. The entire front end stack is antisocial, difficult to extend and anachronistic. I don't think anyone working with a modern java web stack could read this post about rail…

Have you tried Java EE 6 ? JAX-RS in particular is a splendidly designed api for RESTful services. And then you can make single page apps instead of JSF. This method is even going have ide support in Netbeans 7.3 with wizard-driven Backbone/Angular app generation.

Lots of real world apps don't compose nicely down to a bunch of REST bullshit.
Post reply on HN