Live data from Hacker News

DHH answers: What makes Rails a framework worth learning in 2017?

quora.com

111–120 of 135 posts

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#111
post #53

Earlier quoted context omitted.

This. Often, you can't find where this variable or function comes from. You read the sources only to discover that there is no trace of this variable and it is probably defined dynamically in some callback. You can only find this kind of stuff with the help of debugger. The dynamism, which allows one to create beautiful interfaces, and is often advertised as a programmer's friend, is actually the enemy of the program…

that sounds like shitty code - i wouldn't blame ruby or rails for that. Lots of things are possible - but not everything is a good idea - or is, but could be done in a clearer way.

This.

I used to work at places where we cared deeply about our code. You should see some of the code reviews from one of the places, sometimes they got kinda ridiculous and people got into arguments about coding style and the discussion never ended... But the code was great. I kept it for some time after leaving the job and I looked at it to see how good a Rails project can be. Ah, we had over 90% code coverage from the beginning too.

Without Rails, I don't think that codebase would have been as maintainable as it was.

Then at my next job after that, I was hired as a Rails developer. Rails was a dependency and they used controllers and views and wrote the most insane code I have ever seen. Not that many tests, and the tests we had required a significant amount of setup and no one really knew how to run them (and make them pass).

I'm used to Rails being nice and friendly to work with, so joining a project where they fucked up everything really sucked, because I know what it's like to work in a good rails app.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#112
post #76

Earlier quoted context omitted.

Agreed. Would love to see DHH build an opinionated framework for node rather than waxing poetic about Ruby.

This is the first time I've seen someone complain that Ruby is a worse language than JS(ES5). Care to elaborate for those curious?

JS is simply the language that runs in the browser... even with newer options for compiled code coming close to being a reality, it'll be a while before tooling catches up.

JS is actually a decent language, and imho with more recent advancements better still. Combined with npm there is simply anything you might need available (for the most part). Not that there aren't a lot of gems out there.

In the end, having one language to think about, rather than how to shoehorn communications and logic between two languages is simply more difficult. I went, similarly from C# to node, not because I didn't like C#, but because the friction in writing JS on the server and the client was so reduced from two differing languages throughout the day.

Similarly a lot of devs went to simpler data stores so they don't have to deal with layers of ORMs that only half work, and can simply store and query basic data forms. Mongo fits this development model well, early hiccups in the technology aside.

In the end, it allows you to build web apps in one language, and not have to write translations to get from one to the other on the client.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#113

Earlier quoted context omitted.

Rails is omakase. Node is a grocery and a kitchen supply store. Approaching either as if it's the other is a sure recipe for regret.

Node is like walking into a Home Depot when you want a house. Technically you can build one out of the bits they can provide, but it's a ton of work. The thing is Node could offer the Rails out-of-the-box experience through a package that provided sane defaults. There's nothing preventing people from doing this but cultural resistance.

There are a lot of configurators that give you a house... yoeman, create-react-app etc. The difference comes down to what kind of house you want.

Your best bet is to search for Foo boilerplate, where foo is what you want to work with, and start from one of many thousands of starting points.

I think the resistance is generators take time and persistent upkeep, while a boilerplate can exist as it is and upgraded intermittently.

In the end, I'd rather work with a lego bulk pack, than the prescriptive kits.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#114

Earlier quoted context omitted.

> There are a great number of projects offering a Rails-style OOTB experience in Node. Which would these be? Even the best tend to fall far short of the full Rails experience. > And if you do not find the Node style to provide you comfort, there is absolutely no requirement anywhere that you partake of it. Translation: "If you don't like it, fuck off." That's not how the Node community has treated me as long as I've…

> Translation: "If you don't like it, fuck off." If you like, but that's not what I'm saying. What I'm saying is instead that you're not going to find value in Node the same way you do in Rails, and complaining that Node is not Rails will not change that in the slightest. Neither will approaching Node as though the first thing to do is make sure your project tree contains every piece of functionality your app might e…

I've known several of the main devs behind gulp for some time... and tbh, I switched away from gulp to direct scripts some time ago. If I can run it straight in npm, I'll do that... if I need more, I'll favor running a script in a directory for that purpose. glob, shelljs and mz give you a lot of what you might need. And it's often less code than gulp scripts might be.

An example[1] work in progress boilerplate I've been heading towards as time permits, will probably have it flushed out by the end of next month, including migrating to the latest webpack.

Of course a lot of the reason for options, is there are so many... server rendering, react v angular, angular 1 or 2+, bootstrap or foundation or ??? In the end, it's great in some was and not so much in others. I, like you prefer to have the choice/control.

Frameworks like rails are great at getting you 85-90% of the way to done... but that other 10-15% is so painful, you're often better off with DIY in the long run.

https://github.com/tracker1/react-redux-materialui-boilerpla...

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#115
post #89

Earlier quoted context omitted.

Nothing exotic but even a routine web application can have 150-250 lines of Gulp directives. Zero of this is provided for you. Each chunk is fairly small, but they add up. You want linting, auto-restart on changes, tests, your various asset chains to compile things correctly, etc.

Ok, I see your point. I, too, hate writing boilerplate code. But I did three things to resolve this: I built a `config.js` file, which contains the paths to resource files in a more compact format, and is sourced into the gulpfile. I then replaced long path strings with easier to read code. I also threw my standard gulpfile into a git repo, so if I need it, it's there. Lastly, I built a yeoman generator. Now, not onl…

Tools like Yeoman can help here, but they're also relatively obscure and there's a lot of yak shaving involved in getting them working correctly.

In a sense complaining about this the Node world is like asking fish how they can stand being wet all the time. It's just part of the terrain.

I'm not saying what Node is doing is fundamentally wrong, but that this almost absurd aversion to making decisions for users is sometimes a bad thing.

For example, I'd love to be able to declare dependencies for an NPM module that are open-eneded, like "any one of A, B, or C will do", but like it is with Ruby, Python, etc. you must declare all or none.

I'm not trying to restrict choice, just cover the base condition of when you don't care of providing a sane default.

To a degree Rails has this: The first thing I do in a new project is jettison all the garbage I don't want (see you later turbolinks) and drop in all the things I do want. It's actually just a few lines to manipulate, so I can hardly complain.

In the Node world there's a lot of hand-holding required to get even the most basic application up and running. I can see this getting cut down dramatically if you had things like "npm install express +extras" where there was some way of saying "plus whatever other stuff you think is a good idea", or even an "express-fully-loaded" version of the package that comes with a bunch of stuff out of the box.

I really like Gulp and when configured it gives you an amazing amount of control over your build process. Although the Rails Asset Pipeline system works as a pretty good default out-of-the-box they really should steal some ideas from Gulp on configurability for those occasions where you want to change the default behaviour.

Vinyl.fs (https://github.com/gulpjs/vinyl-fs) is an amazing thing that the Ruby world desperately needs.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#116

Earlier quoted context omitted.

> There are a great number of projects offering a Rails-style OOTB experience in Node. Which would these be? Even the best tend to fall far short of the full Rails experience. > And if you do not find the Node style to provide you comfort, there is absolutely no requirement anywhere that you partake of it. Translation: "If you don't like it, fuck off." That's not how the Node community has treated me as long as I've…

> Translation: "If you don't like it, fuck off." If you like, but that's not what I'm saying. What I'm saying is instead that you're not going to find value in Node the same way you do in Rails, and complaining that Node is not Rails will not change that in the slightest. Neither will approaching Node as though the first thing to do is make sure your project tree contains every piece of functionality your app might e…

I'm not complaining that Node isn't Ruby, or that Express isn't Rails. What I'm saying is that there's an opportunity in the Node space to create something as fast, friendly, and forgiving as Rails is.

The "translation" there is how comments like that are perceived. "Put up or shut up" is not a good way to build community. Yes, obviously we have options, but the amount of commitment it takes to go with some of them is a lot higher, and in many cases needlessly so.

> I'm not sure what led you to think you need Gulp to get to "Hello, World".

If you have a non-trivial plan for what your application is going to do and you're intending to iteratively deploy it then you really do need an asset handling plan. Gulp does a great job of this if you spend the time to configure it correctly. With ~200 lines of configuration I get minification, compression, asset hashing, linting, auto-starting, and more. In some important areas that's ahead of Rails, especially in terms of control.

I'm talking about cultural concerns here, about the experience of someone new trying to build a Node application and needing to cobble this all together themselves. It took me about six months of iterative work to come up with a reasonable environment to build Node + Express apps. It took me two weeks to get settled into Rails back in 2005, and I've walked people through the same process with every version since Rails 1 and it's rarely more than a few days of coaching. This friction is something that's a serious problem and no amount of hand-waving dismissal of "that's just how Node is" will change that.

If you want to bring new people into your platform, into your culture, into your community you should make a better effort to lay out how things can or could be done. It shouldn't involve foraging through blog posts, Stack Overflow answers, and pestering co-workers for snippets of code, assembling a veritable quilt out of them that you pass on to others like some sacred heirloom.

For example, I'm consistently impressed with the quality of the documentation Node projects have, even humble ones with obviously limited appeal. The Ruby world is filled with crusty, opaque code with half-assed documentation that's often wildly out of sync with the shipping version, even for foundational components like Rake, Rack, or Rubygems.

If Node had a softer start for those that wanted it, respecting the culture of being able to pick and choose on a very granular level, I'm sure people would be more productive, use it on more projects, and contribute more back into the community. This is a lost opportunity.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#117
post #11

Earlier quoted context omitted.

I took his comment about "very little activity in integrated solutions" to mean "[in the JavaScript world]" but maybe that's not what he meant. I do think that's pretty true of the JS ecosystem though. There are things like Sails, but most of the "new" stuff that comes out is build systems, tools, small libraries, and view libraries. As to why... it's anyone's guess. My guess is that making a full-stack opinionated f…

> As to why... it's anyone's guess. I think its because recreating rails in javascript just doesn't make sense in the current ecosystem. Either you are rewriting stuff like express from scratch (and why are you doing that?), or you're building on top of those modules and adding configuration conventions and scripts, in which case, congratulations, you've just written Sails. When Rails first got started, ruby didn't h…

I think you're right that Rails basically built up the Ruby ecosystem around itself, whereas most of the JS libraries are just riding the wave started by... Node and NPM, I guess? It's much more fragmented.

> ...or you're building on top of those modules and adding configuration conventions and scripts, in which case, congratulations, you've just written Sails.

This doesn't jive with a lot of what's been done in the JS community, at least frontend anyway. There are a TON of libraries that already had perfectly good implementations, where people just decided to reinvent the wheel because they "couldn't find any X library that did what they needed." (see: anything to do with forms)

Backend too, though. There's Express, Koa, Hapi, and more. They all basically do the same thing.

Maybe it's just a difference in mindsets -- maybe JS devs prefer light libraries they can cobble together vs. kitchen-sink frameworks? But then there's the counter-example of the popular frontend frameworks (Angular 1/2, Ember), so I'm not so sure that applies universally either.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#118
post #76

Earlier quoted context omitted.

This is the first time I've seen someone complain that Ruby is a worse language than JS(ES5). Care to elaborate for those curious?

JS is simply the language that runs in the browser... even with newer options for compiled code coming close to being a reality, it'll be a while before tooling catches up. JS is actually a decent language, and imho with more recent advancements better still. Combined with npm there is simply anything you might need available (for the most part). Not that there aren't a lot of gems out there. In the end, having one l…

Absolutely agree.

I've helped maintain REST APIs in both Java and NodeJS at different points in time.

Doing so in Java was always a painful iterative process; ask the ORM for data, painstakingly map the data to Java DTOs created mostly for defining JSON structure, pass it off to RESTEasy or some similar framework, see how the JSON turned out. Adjust and repeat until satisfied. Yuck.

In NodeJS, by contrast, fire off the SQL to get the data, map into the JS object that you need and return it.

Kind of funny how, years back, a selling point of GWT was that you could use the same language across the stack. It wasn't a bad idea, just a poor choice of language.

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#119
What stack do you recommend if not rails for a person that dislikes JavaScript (well rather ecosystem than the language / syntax itself) ? I love Rails and Ruby do not take me wrong but I am not sure if the sole existence of Rails can make Ruby relevant in 2017.

In terms of jobs prospects and similarity to Rails/Ruby what do you guys recommend ? Java ?

Re: DHH answers: What makes Rails a framework worth learning in 2017?

#120

Earlier quoted context omitted.

Sorry, but I've really got no idea what you're saying here. What's the connection between users having many devices and the monolithic architecture bit?

There was a moment in web development where a single "full-stack framework" was possible, that moment has passed, and that moment was more rare and unique than it seemed at the time. The future seems to be more about lambda functions[1], api gateways, and many native clients. Quoting DHH, the Rails pitch was use Ruby for everything: > The core premise of Rails remains in many ways as controversial today as it was whe…

Ok but then we are talking about Java, .NET and JavaScript. They all more or less work on many more devices than Ruby but at some points are so huge and complex and do not perform the same on all of these devices that you still kinda want to pick a specific technology.

Hell Ruby has RubyMotion that allows you to write native apps.

Post reply on HN