5 ms·
I mostly work in Rails, but when I have to hop into a node project, it feels like I'm stepping back into PHP in terms of sheer madness. Barely any convention,
by katzgrau 5y ago
I mostly work in Rails, but when I have to hop into a node project, it feels like I'm stepping back into PHP in terms of sheer madness.
Barely any convention, lots of repetition and configuration - all things Rails specifically set out to solve.
- dentemple 5y agoAs the commenters pointed out, Express.js doesn't try to solve the same problems as Rails. Trying to use one for the other's use case doesn't make any sense.
- regularfry 5y agoYes, but the problem is that there's still nothing in the node ecosystem that's as complete as Rails. Fine, express.js isn't going to do the job. Neither is anything else.
- endisneigh 5y agoThis isn’t really true though, NestJS for example is very opinionated and similar. The issue is more that Node and JavaScript in general is too popular and there are way more options whereas ruby is rarely used for non rails work.
- weatherlite 5y agoPython is plenty popular and so is C#, and when you're looking at a batteries included full stack framework you have ONE popular choices - Django or .NET. For PHP it's Laravel (sure, you have other options like Symfony but they are niche), for Elixir its Phoenix. How is it a good thing for Node to have 5-10 competing frameworks that have similar adoption?
- endisneigh 5y ago> How is it a good thing for Node to have 5-10 competing frameworks that have similar adoption? How is it a bad thing? Again, JavaScript is far more popular than all of those for web related development. The issue is that like you're stating, there isn't a single main option perse. I'd use NestJS.
- weatherlite 5y agoI think its generally bad, or at least I wouldn't want no part of it. There's decision fatigue for one - how the hell do you decide what to use. Another problem is why would I want to relearn a new framework every time I switched companies? And how do I know these frameworks are going to survive long term in such a chaotic community? I have little doubts Django or Rails will be here in 10 years, can you be confident all these JS frameworks will still be here? Some will and some will probably become irrelevant.
- deleted 5y ago[deleted]
- stereocodes 5y agoAs the other commentator pointed out there are a few options that do have a complete setup. NextJS, SailsJS, and Gatsby to name a few.
- weatherlite 5y agoYes Next, Nest, Sails, Gatsby, Blitz, Redwood - none of them became a leading framework like Django or Rails or Laravel has, which means being a Node developer and moving between companies or projects you'll probably relearn everything in a different framework. For me this is just to chaotic and unstable.
- stereocodes 5y agoI see no difference. PHP has a billion FWs and a billion more CMSs. Python is the same way. Rails is the only example you give that has merit. I mean PHP is a terrible example. I've been coding PHP since around 2007, PHP has Zend FW, Laravel, Cake, Ignitor, Symphony, Silex... it keeps going and going. All I can see from your comment is some biases against JS. You do you on what you want to learn or use. But its not really an argument that holds up imo.
- weatherlite 5y agoLaravel is the leading PHP framework by far, I don't think it's up for debate. Ruby also has many frameworks (Padrino, Hanami) but it's obvious Rails is the common choice.
- stereocodes 5y agoLaravel is as much of a leading framework as React/NextJS are the leading frameworks for JS(next 2.5 million weekly downloads on npm, react 15 million). Its almost a 1:1 comparison. In the same way that I already pointed out JS like php, has a million fw but insiders know what the leading ones are. Everyone knows React is the clear on top winner. NextJS is also a clear on top FW. I dont think its up for debate at this point.
- sam0x17 5y agoYes, and in the Ruby world we also have Sinatra, but notably, people have tried and failed to get Rails-like frameworks up and running in JavaScript (Sails.js, others). The question is whether the problem is the language or the community -- I think it's a bit of both.
- pearjuice 5y agoPHP hasn't been madness for a long time. One could argue Laravel (a RoR inspired framework) has become better than RoR.
- Cthulhu_ 5y agoI mean, there have been plenty of valid arguments against PHP the language and its standard library, but the big issue most people end up having have to do with its ecosystem, developers, and frameworks. My earliest rants about PHP was the sheer volume of bad tutorials; googling for "php sql" or whatever would invariably give you examples susceptible to SQL injection. And the other issue was that everyone was building frameworks, CMSes and forum software left right and center; there were a lot of islands, each with their own ideas, structures, etc. PHP should have made a much bigger push early on; mark the weird and unsafe functions as deprecated and point to e.g. prepared statement alternatives. They should have built a package / dependency manager much earlier on. And they should have made a lot more efforts to get a developer community up and running.
- stanmancan 5y agoIf you're actually interested in the subject, a good way to familiarize yourself with the current state of PHP is to run through something like https://laracasts.com/series/laravel-8-from-scratch https://laracasts.com/series/laravel-8-from-scratch. It should give you a good idea of the current state of PHP, what educational resources look like, along with a taste of the most popular PHP framework out there. These conversations always tend to go the same way; someone complains about PHP and then later admits it's based on their experience 5-10+ years ago. PHP has come a long way and is worth checking out if you're into web development.
- chrisan 5y agoas a former Rails user now Laravel user, I would agree with this. PHP has mage huge strides in typing too, I havent kept up with Ruby to know if they do the same
- sinsterizme 5y ago
- tiborsaas 5y agoI had similar feelings with Rails. Just memorize this billion convention and you are good to go. Also didn't help that running Rails on Windows was (maybe still is) considered a bad idea.
- faitswulff 5y agoIs that still true with WSL?
- tiborsaas 5y agoNo idea, but ideally that should solve it.
- sdoering 5y agoI don't know for rails, but whatever dev I do on my Windows machine I just do it via VSCode in WSL2. Or I ssh into my dev machine (shared hosting via uberspace). I haven't even tried to setup dev environments for python, php or js on Windows. It is just so easy to use WSL2.
- aniforprez 5y agoSame here. Inherited a huge rails code base and it's as bad as any node project. The autoloading has been enabled in the entire project so I have no clue whether a class is defined within the project or is fetched from a gem. I've never grepped this much in my life
- bdcravens 5y agoI find you have to create your own structure (in almost every instance, I drift back towards MVC, though it's generally hand-rolled) Express isn't terrible; it's just more like Sinatra.
- fideloper 5y agoYour idea of what PHP is is old, that comparison doesn’t really hold. Laravel in particular is extremely advanced similar to Rails.
- katzgrau 5y agoI've used Laravel and agree that PHP isn't all bad and can be used intelligently. And this is coming from a former CodeIgniter core dev (if you recall). But being real, you've got to admit that most PHP projects aren't in Laravel, they're batshit spaghetti code continually reinventing (or outright ignoring) the standard patterns that come in a boilerplate rails projects. That probably has more to do with PHP being such an easy language to get started with, inviting a lot of rookies/cowboys to the party.