8 ms·
Rails is crazy. If you know it well maybe it's useful but it's very unapproachable. A new project, empty, involves tens of directories and files and at least
by gkya 9y ago
Rails is crazy. If you know it well maybe it's useful but it's very unapproachable. A new project, empty, involves tens of directories and files and at least two languages (coffeescript). That's been off-putting for me. But Ruby the language is quite pleasant IMO. I guess people confound their experiences of Rails and some other Ruby tooling with the language itself.
- pawelkomarnicki 9y agoThat's not true (regarding coffeescript), you could always used JavaScript for the front-end, they just installed coffeescript compiler as a default at some point. And there are not SO MANY directories, you actually care about like 3, maybe 4 ;-) (app, db, config, lib)
- gkya 9y agoWell I'm sorry if I was wrong about that, but it being there kind of implies that I should use it, at when I don't know better as a newbie.
- bhaak 9y agoRails was one if not the first opinionated framework. If you follow its design philosophy, it is much easier to work with. If you fight it, you are in a world of pain and that's even much worse if you don't the design choices they have made in Rails. Having said that, if you jump into Rails the whole project structure will start to make sense after a while. I completely agree on your impression of Ruby vs Rails.
- ritchiea 9y agoEvery web application requires at least 2 languages (a sever side language and HTML). Virtually all of them also end up also including Javascript and CSS. And Javascript as a server side language is relatively new. That's not a great argument against Rails.
- setzer22 9y agoWith clojure you get the frontend logic in clojurescript, backend logic in clojure (or even clojurescript itself) and due to the isomorphism between html and S-expressions, the actual page layout is also described as clojure data in a natural, unambiguous way.
- egeozcan 9y agoIs there a good example (read: not todo) of an app designed like that? You mean using node through clojurescript when you mean a cljs backend?
- acjohnson55 9y agoThere's a similar story with Scala and Scala.js
- gkya 9y agoI'm not really trying to make an argument against it anyways. IMO if you haven't jumped in early in the Rails's lifetime, it's really hard to catch up; this is what I'm saying.
- rubyfan 9y agoI was an early Rails adopter, somewhere around 0.x and used it every day through 2.3. Somewhere just before 3.0 I stopped using it daily. I recently came back to 5.0 for a few applications and was pleasantly surprised that I was proficient in a day or so. I wasn’t familiar with ActionCable, Asset Pipeline or CoffeeScript but felt they were all easy enough. All the basics were still there, the MVC application structure, DB migrations, etc. I share the sentiment that JavaScript and many other languages used for web development are great but seriously lack some of the essentials Rails provides.
- rco8786 9y agoSo you jumped on early in the Rails timeline and we’re able to keep up. Seems you’re just proving that point.
- troels 9y agoCoffeescript isn't part of Rails anymore.
- steveklabnik 9y agoI thought this was true, but I just generated a new app with Rails 5.1 and it still included coffee-rails by default. Maybe that's coming in 5.2? Still quite easy to pull out.
- bpicolo 9y agoIt's `rails new myapp --webpack` in 5.1+ that should kill coffeescript I believe. True that the default install is still coffee
- steveklabnik 9y agoEven with --webpack I still have coffee-rails; it just also adds the 'webpacker' gem. Psyched to see Rails adding native webpack support though.
- bpicolo 9y agoAh, gotcha.
- danmaz74 9y agoDid you try a good tutorial? Rails is structured in a way that fits from very small to very big web projects, but it's not structured to be learned just from reading the automatically generated code - that for sure would make it look crazy at first. Eg for "Hello World", you're not going to touch 99.9% of the auto-generated code. But you need to know where to look.
- mercer 9y agoMy problem is that much of the time I don't know where to look. I'm not a great programmer, so maybe that's why, but the few times I tried to grok the innards of, say, ActiveRecord I gave up fairly quickly.
- danmaz74 9y agoI think that a very few share of Rails programmers need to know the innards of ActiveRecord - I use and abuse it heavily, and never felt that need. When things get difficult to optimize, I fall back to hand-written SQL. I spent a thousand times more time studying the innards of PostgreSQL than AR :)
- mercer 9y agoFair enough :). I'm a bit of a control freak, so this lack of insight into the innards makes me (quite possibly unreasonable) uncomfortable. That said, could you perhaps elaborate on how studying the innards of PostgreSQL is relevant in relation to ActiveRecord?
- ryanbrunner 9y agoI think the point is, Active Record (like any orm) is a leaky abstraction that covers a small, but common percentage of what you can do with SQL. Any time I've run into problems fighting the "magic" of Active Record, my time was almost always better spent just taking back to hand written SQL (which isn't terrifically difficult with Rails). Rails absolutely is a framework where you need to abandon some control and trust the framework though. If you need to know exactly how your abstractions work under the hood, it's a poor choice IMO. I doubt there a single person who has comprehensive knowledge of how every single part of Rails works.
- hashmal 9y agoA while ago it was easier to get in (and the framework wasn't simpler), there was a lot of beginner-friendly materials (like the "do a blog in 15 minutes" video). If you started from there it was actually hard not to understand the file structure. (hint: rails/rake commands are your friends to quickly scaffold your models/pages). I agree that a lot of people don't make the distinction between rails and ruby. I had interns who where quite surprised you could use ruby without rails, and that "it's actually a complete language!". Ruby on its own is charming indeed. Rails gets the job done: few other tools enable you to finish a functional MVP in a day or two. But if you start to add gems for everything it just becomes a pain in the ass. edit: I was f*cking mad when they added coffeescript. fortunately it's simple to disable (just removing the gem and changing a setting for the file generators)
- swat535 9y agoIm not sure it's fair to call out rails for having "tens of directories and files". Have you not looked a simple Node app? Any framework seems "Crazy" and "Magical" at first. But once you get to know it, it becomes clear. Rails is an opinionated, full featured framework with plenty of bells and whistles. The core of rails is convention over configuration which means you will have a hard time going against the it.
- swat535 9y ago[EDIT] Can't really edit this anymore but I noticed I made a few typos as I was writing this quickly on the go on my phone. Apologies for that!
- gkya 9y agoNode.js was sth. I jumped on early. As soon as I saw the video of Ryan's talk, I tried it. I guess the first version I tried was <= v0.5. Then the community went... nuts. But it's quite different than what I view Rails to be. Rails is like a culture. There are a lot of pre-baked things when you run "rails new blurb", but most of it is useful, and you'd create them anyways. But to a newcomer like me, that's a bit overwhelming. That's my lament about it. Wrt Node.js, that's just a product of lots of ignorance. All you actually need is a JS file, or a makefile with ".js.ps:\n\tpuppyscript -c $< > $@". But the wheel is reinvented with such pace and redundancy that it's a hell of a platform nowadays. Even its creator, which is a very smart guy, has said farewell.