8 ms·
The obvious performance and bloat overhead with RoR aside, I have yet to see a framework and ecosystem that lets you have a programmable web application up and
by fareesh 6y ago
The obvious performance and bloat overhead with RoR aside, I have yet to see a framework and ecosystem that lets you have a programmable web application up and running with typical features in comparable time.
For shipping new products or testing out ideas, I have not come across a more optimal framework in terms of going from idea to market.
Most often I've tried Phoenix, Django and Laravel as alternatives, but all of them seem to fall short. I gave .NET MVC a shot too back in its early days, it was not pleasant.
I run a dev shop and it seems to fit really well with our business model.
- pdimitar 6y agoThis is what brought me to RoR land... and this is what made me leave. I agree rapid prototyping is an excellent point for RoR but when you need to actually evolve the project for years, it gets really tedious and hard. So for a dev shop RoR is quite fine -- you make the project, do very little iteration on it, and ship. That works well and I've experienced it. For longer-lived projects however, Phoenix is miles ahead. Even Rust's Rocket, but only if you are willing to invent a lot of stuff yourself (auth for example).
- wukerplank 6y agoWhat makes you say it is hard to maintain longer lived projects? (I used to be a RoR developer for a few years, so I'm curious about other people's experiences.)
- pdimitar 6y agoIt's mostly the "magical" parts like before/after hooks. When you are tracing a bug and are trying to do step-by-step debugging, it has been hell. Quickly jumping to definitions? Even RubyMine can't do it. Furthermore, as the project grows, you need to introduce something more/bigger than MVC and people put these files everywhere. Sure it's a management problem but it doesn't help that people don't do the right thing by default. In general, there's a breaking poing that you will very soon hit when you try to just pile things on top.
- PikachuEXE 6y agoI agree Rails only does a great job on structuring when project is started But any large enough project needs rules for placing files/classes I don't see how Rails failed in that way I do agree there are some "magical" stuff like hooks that can be easily abused and introduce bad coding habits/patterns Wish I can turn them off per class (not for the whole app since they are still sometimes useful)
- JohnBooty 6y agoYeah. MVC is not always the right tool for the job, but it's generally fine and IMO rarely a terrible fit. I don't see how that's a Rails-specific problem. Before Rails, working in the wild and wooly world of Microsoft web dev (with occasional PHP thrown in) I saw some real horrorshow web apps. People hacking together their own confusing and misthought architectures. And those horrorshows were rule and not the exception. The standardized structure of Rails apps is such a breath of fresh air. It's so nice to step into a Rails codebase and basically know where most things are most of the time. Admittedly it's also nice to step away from Rails for smaller, simpler apps.
- joelbluminator 6y agoWhat do u use outside Rails and how was your experience? It's a bit embarrassing I only did Rails with Ruby.
- JohnBooty 6y agoBefore Rails I did a lot of work where there was no framework comparable to Rails, in ASP "Classic" and then ASP.NET. Generally each web app had its own organizational structure. Everything was still "page-based" so your site's file structure would mirror the actual URLs: the code for your product page would be "/product.asp" and your shopping cart page would be "/cart.asp" or whatever. Those files had intermingled markup and code extremely similar to ERB files in Rails. Conscientious developers of that era would of course extract as much functionality as possible into shared include files. Even in those savage days we tried to separate logic and presentation whenever possible. Early PHP dev worked much the same way. Needless to say this generally lead to spaghetti code. You certainly could make very maintainable ASP/PHP sites, with a lot of effort -- just like you can find some very maintainable and well-structured shell scripts. But, even so, each "well-structured" ASP/PHP site would have its own structure and it was quite a learning curve jumping into a new one, if you ever had to look at somebody else's code. Early ASP.NET apps used an even more bizarre set of Microsoft constructs. Code-behind files, etc. Yuck. Later came ASP.NET MVC which was quite good IMO. It borrowed liberally from Rails which was a good thing. In Ruby land I developed with both Sinatra and Rails. Sinatra is great and a lot of fun, but you are totally on your own w.r.t. structuring your app. Once your Sinatra app grows past a certain complexity, you will generally just find yourself reimplementing large parts of Rails and encountering the same problems w.r.t. structuring your app. Rails and MVC are not perfect -- many say other variations like MVVM/MVP/etc are better. Perhaps so. I've certainly had pain points with Rails (too much "magic", high RAM usage) but as far as structuring my applications.... no.
- kenhwang 6y agoAs a person maintaining multiple Rails codebases approaching a decade in age: RoR just bitrots incredibly fast and its really difficult to catch or update. With each new version of RoR gems just stop being compatible without replacement, and its a fairly significant effort to migrate everything to the new shiny being introduced. In fairly stable projects where there isn't much feature churn/replacement, you pretty much have entire sections of the codebase that never move past the version they were originally written in. You're constantly maintaining controllers/models written in RoR 3.2/4/4.2/5/5.1 styles since its incredibly difficult finding which features were used, but they still kinda sorta mostly work, until they silently don't. The difference compared to other frameworks/languages is that Rails is very heavily powered by "magic". Every other tech explicitly configures and calls features being used, but Rails is mostly held together by "convention", but convention evolves. How do you search for things like "the filename of this must match the class name of this" or "the method name must match this database feature". Nevermind the metaprogrammed methods that aren't documented anywhere. The convention evolving as developer preferences changes is generally a good thing and keeps RoR from becoming too dated but it is an expensive maintenance burden. I quite like Rails and it's still my first choice for personal projects/prototypes. But I'm definitely souring to it for long running professional work.
- Lammy 6y agoI think there are probably a large number of people who "learn Rails" without really learning the deeper/unique concepts of vanilla Ruby. For me at least it was like a decade in between first writing some Ruby and really feeling like I've started to understand the full scope of the language and syntax that's available to me, such that I'm only now able to start thinking about what cool actual-things I can build with these concepts.
- fareesh 6y agoIn your experience, is there good resource for discovering the "de-facto" hex packages for a particular requirement - I end up Googling things like "Phoenix paperclip equivalent" and then evaluating all the various ones. Alternatively are there some good "kitchen sink" open source projects that implement many of the typical web application features like auth, uploads, etc. ? Companies like thoughtbot have been a gold mine of information and battle-tested practices - is there anyone similar in the Phoenix space that's worth following?
- pdimitar 6y agoSadly there aren't many better ways. For the moment the best course of action is to search on ElixirForum. Even if I love the language and still look for ways to work with it (in my new job where it isn't used) I recognize that the ecosystem is not that big. For auth, the core Elixir team has made one prototype but I am not sure if they'll pursue it further. Outside of that, use Pow. For file attachments: Waffle. Authorization: CanCan, although the area has several very solid options, I heard. Discoverability can indeed be a problem. Covid-19 hit everything pretty heavily and Elixir's community is no exception. Just a month ago people started finally hiring for it again (on the forum).
- regularfry 6y agoTime for a respin of https://www.ruby-toolbox.com/ https://www.ruby-toolbox.com/ ?
- athriren 6y agoedited to delete as i was discourteous.
- JeremyNT 6y ago> For longer-lived projects however, Phoenix is miles ahead. Even Rust's Rocket, but only if you are willing to invent a lot of stuff yourself (auth for example). I can't speak to Phoenix, but I've looked into Rocket and don't understand how it can really be compared to Rails. There's so much you need to implement yourself that you'll end up spending a big chunk of time on implementing things that Rails (or high quality / well used gems in the Rails ecosystem) can provide for free. And don't get me wrong, I'd love to sit down and do that work, but my job is to make stuff work and make it work quickly, and my employer doesn't hire enough people that we can afford to dedicate that kind of time when it's already "solved" by a framework. I tend to work on projects where the requirements change constantly, and they're never really "done." Saying rails is good for "prototyping" is not wrong, but in a world where software is always evolving, the features and capabilities that make Rails great for prototyping are also great for just day-to-day existence.
- iamsb 6y agoSpring Boot Kotlin is worth giving a go. It has rapid prototyping abilities, but underlying Java promise of easy refactoring, great tooling. I recently refactored entire frontend and parts of backend code without ever having to restart server.
- fareesh 6y agoHow is the ecosystem? For example - if I want to add auth, social login, profile picture and admin dashboard CRUD, are there mature packages that can be leveraged for these features?
- iamsb 6y agoIt has decent support. It is based on sprint which has had social auth for many years now. Plus good third party support like okta. Note to self - dont post about Java on HN, people downvote even non hateful comments!
- nobleach 6y agoWhile I wouldn't exactly put it in the Rails category, I love Spring Boot far more. I love Micronaut even MORE than Spring Boot... but that's another story. Spring Boot doesn't tick ALL the Rails boxes (Scaffolding a backend CRUD admin interface, all of the complex templating stuff - although Thymeleaf is pretty darn good) I'd put my money on it being more maintainable a year later. Spring as an ecosystem is huge, so there's always a strong possibility someone else has already solved the problem you're trying to solve. The tooling is pretty fantastic as well. Kotlin as a language is just fantastic.
- joelbluminator 6y agoThe weird thing is we have to keep semi-apologising for choosing Rails. Why is that? For each his own. I love Rails, sue me.
- codegladiator 6y agoI am all for your love of Rails, but tools should not be picked based on how much you love them. Choose the correct tool for the job, if it is rails, good for you.
- joelbluminator 6y agoFor me its Rails, also because I love it. None of us is 100% objective or rational about this. I'm very much aware most companies can be built with any of the common stacks, the tech barely matters for 90% of these companies. Why does it mater if advertisement algo company X or insurance tech company Y choose java/.net/ruby/php ? All these stacks are good enough and have been used countless times in varying scales.
- codegladiator 6y agoFor example if you are building something around nlp, probably pick python. Also, since you are all into ruby, maybe take a look around as to why other languages exist.
- joelbluminator 6y agoThat's quite a specific use case and as a mainly backend web developer I don't hit many nlp problems. That's usually a whole specialisation of it's own. > maybe take a look around as to why other languages exist. I've been around. Still like Rails, works well for me. Thanks for the advice :)
- regularfry 6y agoThere's a solid question as to why the tool you'd pick for CRUD databasey stuff should be coupled to what you'd pick for NLP heavy lifting by the interpreter. Different jobs, different tools.
- nickjj 6y ago> The obvious performance and bloat overhead with RoR aside. Does the bloat matter in the end tho? You can build a million dollar business on a single $20 / month DigitalOcean server to run everything with tens of thousands of users. That's what Chris did from https://gorails.com https://gorails.com. We talked about his Rails driven tech stack on the Running in Production podcast[0]. Recently he tweeted out he generated a million dollars from his business[1]. If you can get 100ms or less p95 response times without a complicated infrastructure then the only thing that matters is the ecosystem, community and how much you enjoy using that technology. If performance is a web framework's biggest feature then I think they're fighting an uphill battle. Performance isn't that important for most applications as long as you can produce a nice feeling application that responds quickly. All modern frameworks have a means to do that. Now it comes down to how fast can you build it and how nice is it to maintain. [0]: https://runninginproduction.com/podcast/12-learn-ruby-on-rails-through-screencast-tutorials-on-gorails https://runninginproduction.com/podcast/12-learn-ruby-on-rai... [1]: https://twitter.com/excid3/status/1295730795148193792 https://twitter.com/excid3/status/1295730795148193792
- fareesh 6y agoI guess it depends on what you build. At the scale of GitHub and Twitter or Shopify there are probably significant challenges caused by said bloat.
- untog 6y agoBut once you reach that level of scale you have (or should have!) the resources to redevelop services that are holding you back. Not choosing Rails because you intend some day to get to Twitter scale smells of premature optimisation. (Twitter themselves used Ruby!)
- fareesh 6y agoYep, which is generally why I can't see a good argument for not using it. I was hoping to see some here but it seems to be a consensus view.
- 6y ago
- portpecos 6y ago>The obvious performance and bloat overhead with RoR aside, I have yet to see a framework and ecosystem that lets you have a programmable web application up and running with typical features in comparable time. This answers your question indirectly. I’ve included a link below to Amber Web Framework, built on Crystal. Crystal is a statically typed language with the speed of C and the exact same syntax as Ruby. Check out the video a couple screens below, and you’ll see a demo of how quickly an Amber Blog App is generated. You’ll notice their is almost no difference between Rails syntax and Amber syntax. https://amberframework.org/ https://amberframework.org/
- fareesh 6y agoIs there anyone notable using it in production?
- Can_Not 6y agoDigital Ocean is a sponsor according to the website, so maybe that counts.
- Toutouxc 6y ago> the exact same syntax as Ruby I would be very careful with that statement, because it's simply not true (example: no type-related syntax in Ruby).