News for hackers. Stuff that matters.
Re:Is Rails still relevant in 2018? by sho on Tuesday August 28, 2018 @01:19AM (#17856693)
Of course it is. The question is kind of silly. For basically any startup, my advice would be: unless and until you can credibly explain a genuine reason why you can't use Rails - use Rails.

I'm not some crazy fanboy but until someone can actually name a seriously competitive, batteries-included, all-in-one framework* which delivers everything, or even most of, what Rails does - it is very relevant and you ignore it to your serious disadvantage.

* your list of 30 random npm packages does not satisfy the requirement

Re:Is Rails still relevant in 2018? by schizoidboy on Tuesday August 28, 2018 @01:32AM (#17856738)
> your list of 30 random npm packages does not satisfy the requirement

I like Rails, but to be fair, doesn't Rails also require a list of 30 random gems? Unless things have changed, authorization and authentication aren't even built-in, so people have to navigate random third party gems, and remember, you don't want CanCan, but you want the fork, CanCanCan. Again, I like Rails, and maybe it's still the nearest to an all-in-one framework, but I think somebody who took the next step and created a truly all-in-one framework would win big.

My current project:

  $ grep -c ^gem Gemfile
  75
Re:Is Rails still relevant in 2018? by Ajedi32 on Tuesday August 28, 2018 @10:01AM (#17858831)
It's not a matter of how many packages are required; that isn't the issue. The reason "30 random npm packages" doesn't satisfy the requirement while Rails does is that Rails provides a high-level framework for integrating those disparate packages into a single cohesive application, while with npm packages you have to write that framework yourself.

Perhaps the best example I can give for this difference is Devise, an authentication plugin for Rails. Have a look at the instructions for setting up Devise on Rails: https://github.com/plataformatec/devise#getting-started You just add the dependency and boom, you instantly get a database migration for storing authentication data in your database, automatic integration with Rails's email notification system, a single command you can run to generate all boilerplate files, and a single line of code you can add to your controllers to automatically enforce authentication for any particular action. With a similar authentication package in a Node application you'd most certainly have to set all that up manually.

Re:Is Rails still relevant in 2018? by trelliscoded on Tuesday August 28, 2018 @02:11AM (#17856868)
> doesn't Rails also require a list of 30 random gems?

    my-MacBook-Pro:production-web-site me$ grep ^gem Gemfile | wc -l
      74
I have mixed feelings about this. On the one hand, the framework isn't strongly coupled, tested as a whole, and opinionated like in Java and .NET land.

On the other hand, overriding the "default" Rails behavior for e.g. logging or SAML is pretty easy as long as you can find a gem compatible with the versions of all your other gems. This can easily spiral into out of control technical debt where you're stuck using gems from 6 years ago out of fear you'll tug on one of them and bring the entire house of cards tumbling down, but I've consistently been surprised at how little effort has been required to do gem upgrades as long as they're planned carefully.

Re:Is Rails still relevant in 2018? by ryanbrunner on Tuesday August 28, 2018 @07:11AM (#17857884)
Authentication is built into Rails, albeit in a less "batteries included" way than something like Devise. You'll have to code your own user model, but `has_secure_password` will give you perfectly fine security around storing passwords.

And while gems like CanCanCan are great, not every application needs them, and it's relatively straightforward to set up authorization logic directly for most simple cases (i.e. something like "users control their own things, admins control everything".

You're right in the sense that I've very rarely seen sizeable apps that are mostly "stock" Rails outside of things literally developed by Basecamp.

Re:Is Rails still relevant in 2018? by amarsahinovic on Tuesday August 28, 2018 @02:14AM (#17856877)
Django fits that description.
Re:Is Rails still relevant in 2018? by i_am_nomad on Tuesday August 28, 2018 @02:21AM (#17856907)
Came here to say the same thing, and add that with Django, you have access to the amazingly vast landscape of Python libraries. Just being able to spawn Celery jobs is a huge plus.
Re:Is Rails still relevant in 2018? by joelbluminator on Tuesday August 28, 2018 @04:16AM (#17857305)
Couldn't see any advantage over Sidekiq, Resque and friends. Not saying it's bad but just that the Ruby community has got your back for any web development need you might have...when working with Django I didn't get the feeling I am working with superior libraries.
Re:Is Rails still relevant in 2018? by bpicolo on Tuesday August 28, 2018 @09:30AM (#17858621)
An advantage of Celery is that it doesn't require payment for an enterprise version to add things like scheduled tasks.
Re:Is Rails still relevant in 2018? by joelbluminator on Tuesday August 28, 2018 @10:16AM (#17858913)
If you're talking about Sidekiq there's free open source solutions for that in Rails world. https://github.com/moove-it/sidekiq-scheduler https://github.com/ondrejbartas/sidekiq-cron Besides Sidekiq is just one out of many.
Re:Is Rails still relevant in 2018? by bpicolo on Tuesday August 28, 2018 @10:42AM (#17859116)
Good to know, cheers
Re:Is Rails still relevant in 2018? by bdcravens on Tuesday August 28, 2018 @09:37AM (#17858655)
One thing I'll say about Node is that the module names seem to be semantic for the most part, unlike the cute names gems seem to get. Walk into a Ruby developer's office and if you see a white board scribbled with random words, you don't know if they have reached the point of stress where their mind has started to break with reality, or if it's just a list of gems for their new project :-)
Re:Is Rails still relevant in 2018? by erokar on Tuesday August 28, 2018 @03:10AM (#17857053)
I think Django comes close to Rails with regards to productivity. Granted, Django has slightly more overhead to get started, but Django also includes an admin interface and a built-in auth system, which Rails does not.
Re:Is Rails still relevant in 2018? by 0xADEADBEE on Tuesday August 28, 2018 @04:05AM (#17857262)
I work in a lot of Django shops and my Ruby is nowhere near as good as my Python but I'll pick Rails every time if I'm working on a side project. Why? Because the development velocity when using it is unparalleled. I can have an MVP up orders of magnitude quicker than I can with Django/Flask/Twisted. You're absolutely right on the Admin interface and auth, but auth is a gem install away [1] and Django's admin won't fit my requirements more often than it helps; I can seldom justify exposing it to end users and it's a hideous undertaking to extend it meaningfully (I gather this is one of the reasons it is a bit of a laggard compared with the rest of the framework. We only got mobile support out the box in 2.0 for example [2]).

Other reasons I enjoy Rails:

- Scaffolds allow me to have CRUD support for any model I want with one command (combined with auth, I have Django's admin, more or less)

- JSON views without a third party library (surely this is pretty standard for a web framework in 2018 in most cases?)

Other reasons I don't enjoy Django so much:

- I can't think of an eloquent way to phrase this but Rails values my time. With Django I'm doing menial minutiae like creating a directory for my app's templates before it'll serve a page. Why? I know 'magic' is anathema to the Python community but context switches like this shouldn't be there when I'm trying to get an app up and running at speed

- I feel like it's stewardship is bordering on begrudging: Why are websockets (and JSON for that matter, but I've touched on that) not present in a 'kitchen-sink' web framework? I'm not sure why we're worrying about master/slave DB terminology [3] when there are axiomatically more pressing technical and adoption-related issues at hand.

Django is a fine web framework, and perhaps the best-in-breed for Python, but it feels miles behind where it should be at this point and I'm not really sure why.

[1] - https://github.com/plataformatec/devise

[2] - https://docs.djangoproject.com/en/2.1/releases/2.0/#mobile-f...

[3] - https://github.com/django/django/pull/2692

Re:Is Rails still relevant in 2018? by pythonaut_16 on Tuesday August 28, 2018 @08:52AM (#17858396)
You might know Python but it sounds like you don't know Django very well.

Django does have built in JSON support[1]. There's also Django Rest Framework[2], which while not built into the core, is well supported and hardly a burden to add.

And finally, Django's "scaffolding" functionality is built around its models. You define your model as a plain Python class inheriting from Django's model class, and then the various generic[3]/"scaffolding" views work by being told what model they're for, with the ability to override and extend whatever you want to.

[1]-https://docs.djangoproject.com/en/2.1/ref/request-response/#...

[2]-http://www.django-rest-framework.org/

[3]-https://docs.djangoproject.com/en/2.1/topics/class-based-vie...

Re:Is Rails still relevant in 2018? by 0xADEADBEE on Tuesday August 28, 2018 @06:35PM (#17863549)
I fear you've contrived to miss both underlying points.

In order to access a JSON endpoint in Django, I need to install DRF, integrate it with Django, configure it, edit my urls.py and perhaps set up a serialiser. I won't detail the procedure in your first link because I think you very well know that is simply a response object with a crude serialiser and a content header set. The inclusion of both misses the point, which is that in Rails, I would simply navigate to /model-name.json (so in fact, yes, it is absolutely a burden to go through that when you compare the two). That's it. No parsing. No route configuration. No concerning myself with edge-cases unless I'm doing something odd. Requirement satisfied, and I can sleep soundly knowing I'm not bequeathing some custom car-crash on whoever inherits my codebase. Debate aside, I wholeheartedly encourage you to try out this framework sometime - I've found going from Django to Rails to be an absolute joy to develop with.

Generic Views. Ah. Well that has its own set of problems. Why am I wading through the docs (or more accurately ccbv.co.uk because the actual docs are a verbose, time-sinking miasma; recall that in my previous comment, I am championing the development-velocity of Rails in contrast to Django) to discover which method from which class I need to override to implement the functionality I need? I can intuit a lot more now, after doing this for years, but why do I need this knowledge at all? It is the job of the framework to abstract and ameliorate bullshit. Corollary: why is it that every Django codebase I inherit has at some point converged on its natural state of 'car-crash' because of the combination of a bunch of rigid inheritance chains and my predecessors not putting in an escape hatch? At risk of being a bit of a zealot, MI is almost always an anti-pattern and I would prefer the flexibility afforded to me by composing things in the traditional fashion.

In Rails, I would build a model like this in my shell: `rails g scaffold Blog title:string content:text`. That's again, literally it. From that, I now have a Blog model with title and content, created and updated fields, controllers (or 'Views' in Django parlance for some reason) and both HTML and JSON views ('Templates', in Django-land), unit tests, assets for my asset pipeline (we don't have to run collect static btw - it seamlessly transitions into production because it was designed on the basis that people might actually be deploying their projects), my equivalent of urls.py has been updated to accommodate my new model and I have full CRUD functionality at this point. Genuinely, I implore you to try this framework. Django has come a long way since I first used it but it's nowhere near the level that modern frameworks like Phoenix [1] (you should give this a go too - the third party libs aren't quite there yet but it's a really well thought-out framework) are at, and I'm genuinely curious as to why.

[1] - https://phoenixframework.org/

Re:Is Rails still relevant in 2018? by pythonaut_16 on Wednesday August 29, 2018 @09:10AM (#17867920)
We'll have to agree to disagree about Django. I think Django and Rails both offer good developer productivity/velocity, they just make different tradeoffs. Django tends to be more explicit, which might lead to a slightly higher learning curve, but after that I've found it's easier to trace through Django applications to understand what's happening.

I've seen my fair share of terrible Django and terrible Rails applications. Bad code can be written in any language and framework.

Don't get me wrong, Django definitely has its pain points, but I think it offers a very competitive alternative to Rails.

I definitely agree with you on Phoenix though! Elixir/Phoenix is my current stack of choice. I actually think they do a really great job of capturing the high points of both Rails and Django while also improving on the weak points of both as well. (For example, Phoenix offers a lot of the "magic" of Rails but it's all backed by explicit code that Phoenix generates while creating your project.)

Re:Is Rails still relevant in 2018? by vinceguidry on Tuesday August 28, 2018 @04:30AM (#17857357)
The source of Rails ease-of-use appears to flow from Ruby's object model, which I have yet to see a more elegant one outside of the Smalltalk ecosystem. Ruby's semantics just seem to be a natural fit for the web, where visual presentation of information seems to almost demand a truly-flexible set of tools.

You want a smooth progression of tooling that you can approach and slowly clarify ever-finer approaches to over time. The object model is the base of the pyramid, it's the thing you rely on when nothing else solves the problem, you know you can always invent a new kind of object hierarchy by refactoring to BasicObject, obliterating stdlib semantics with a veritable flamethrower. I've never put such a thing into production, because I know there's always less drastic ways to define, mold, shape, and extrude abstractions.

With less semantically-fluid languages, you wind up relying on the same few tricks over and over and over again, because they solve problems, albeit poorly and opaquely. This flows, again, from the underlying approach to typing. Python is dynamically typed, which keeps it from being totally unworkable any time you need to do something special or cross-cutting, which is absolutely a need in the web world, but it's structured enough to where you need to devote library-level amounts of thought into coming up with clean, semantic abstractions that are easily traversed, something Ruby just comes with out of the box.

Re:Is Rails still relevant in 2018? by 0xADEADBEE on Tuesday August 28, 2018 @04:59AM (#17857461)
I would wholeheartedly agree that the object model confers a large advantage to Ruby; I hadn't considered your Python point but you're absolutely right - there are demonstrably fewer ways to solve certain problems. I sometimes wonder what Python would look like if it were easier to differentiate between an attribute lookup and a method call.
Re:Is Rails still relevant in 2018? by briatx on Tuesday August 28, 2018 @10:36AM (#17859070)
>Why are websockets ... not present in a 'kitchen-sink' web framework?

They are.

Django Channels: https://www.djangoproject.com/weblog/2016/sep/09/channels-ad...

Re:Is Rails still relevant in 2018? by 0xADEADBEE on Tuesday August 28, 2018 @06:37PM (#17863562)
Right. Last I checked it was being brought into the fold but it hasn't been - I still have to install a third-party library to get what is rapidly becoming a normal thing to have in a web-framework. My point was more "why isn't this in my kitchen-sink framework" more than "I don't know how I would go about integrating websockets in Django"
Re:Is Rails still relevant in 2018? by philwelch on Tuesday August 28, 2018 @02:22PM (#17861387)
I did full-time Ruby on Rails development for between three and five years. These days, a huge chunk of what's "included" in Rails is stuff I don't need, and a huge chunk of what's not included in Rails is absolutely essential:

Stuff included in Rails I don't need:

* ORM

* Heavyweight controllers

* Server-side HTML templating

Stuff not included in Rails that I do need:

* Basic DB-level sanity checks, such as uniqueness constraints that actually work

* Any kind of real frontend framework

Stuff that I desperately want that Rails makes fundamentally impossible:

* Sane concurrency

* Not having to pull my hair out over random values in my codebase magically turning into "nil"

The best pattern for developing basic web applications that I've seen lately is basically:

* Use React for the UI. (If you prefer another front-end framework, I don't really want to fight about it, but React is pretty damn good.) Host your statics, well, statically.

* For your backend, use the simplest possible mechanism that receives HTTP requests and emits JSON. If you're married to Ruby, Sinatra does this. Flask does this. Node and Go and Java all have relatively simple mechanisms for this. The mechanism doesn't matter. Route HTTP requests to function; return JSON (or some HTTP response object that encapsulates your JSON) from function.

* For interacting with a relational database, use sprocs. SQL isn't hard; ActiveRecord is probably the best example of the Rails antipattern of, "make easy things easier, and hard things harder".

Re:Is Rails still relevant in 2018? by Jedi72 on Tuesday August 28, 2018 @02:11AM (#17856871)
Elixir/Phoenix is the spiritual successor to Rails. Same philosophy of batteries included, developer productivity focussed etc. But with lots of great new shiny things, for example websockets is built directly into the framework, its not an add-on. Its not a direct upgrade, but if you value Rails definitely check it out
Re:Is Rails still relevant in 2018? by joelbluminator on Tuesday August 28, 2018 @04:27AM (#17857349)
The Elixir community would LIKE it to be a spiritual successor for Rails, but it really isn't. If only because of the learning curve of understanding Elixir. Sorry to disappoint anyone but Phenoix is not going to be the new Rails/Django.
Re:Is Rails still relevant in 2018? by nickjj on Tuesday August 28, 2018 @07:28AM (#17857949)
> If only because of the learning curve of understanding Elixir. Sorry to disappoint anyone but Phenoix is not going to be the new Rails/Django.

The learning curve isn't too bad.

I've been a Rails developer for quite some time and am picking up Elixir / Phoenix in my spare time while building a single side project. This is my first real attempt at picking up a functional language too.

The project I'm building is an ambitious project (users, accepting stripe / paypal payments, lots of data modeling, real time aspects, decent amount of logic I haven't implemented in other more familiar frameworks, etc.) but thanks to the community and open source projects to look at I'm making reasonable progress.

Of course I'm not as productive as I am in Rails but that's because I'm only putting in a few hours a week into this project (while learning Elixir / Phoenix as I go).

Re:Is Rails still relevant in 2018? by conradfr on Tuesday August 28, 2018 @09:13AM (#17858536)
I like Elixir and Phoenix but I agree with you.

First I think a very large number of developers don't care for functional programming.

Then Phoenix is mainly run by only two persons, Chris McCord and José Valim (who also manages Elixir and Ecto). If I compare the pace of development and what you get out of the box with PHP/Symfony (I don't know RoR) it's quite clear that Phoenix is not there yet (without even speaking of the difference in ecosystem size).

Having said that I'm excited for Phoenix 1.4 https://github.com/phoenixframework/phoenix/milestone/17

Re:Is Rails still relevant in 2018? by fishtoaster on Tuesday August 28, 2018 @03:26AM (#17857093)
Elixir/Phoenix is great, and it's first-party support for websockets is an excellent selling point! That said, I feel compelled to mention that rails does have websockets built into the framework now too, as of Rails 5.
Re:Is Rails still relevant in 2018? by karmajunkie on Tuesday August 28, 2018 @10:41PM (#17865043)
There is no comparison between those two socket implementations. There's several orders of magnitude difference between what elixir and Ruby will support on a single server there.
Re:Is Rails still relevant in 2018? by cutler on Tuesday August 28, 2018 @12:26PM (#17860137)
Please, let's lose this Elixir = Ruby.new nonsense. Once you get beyond the superficial syntax similarities between Elixir and Ruby the 2 languages couldn't be further apart. Ruby is mutable/OOP whilst Elixir is immutable/FP. Diametrically opposite so anyone who is heavily invested in Ruby's OOP mindset is going to have a shock if they dive into Elixir.
Re:Is Rails still relevant in 2018? by karmajunkie on Tuesday August 28, 2018 @10:39PM (#17865030)
This is the most salient point in the elixir thread so far. If you are heavily invested in OOP, no functional or immutable language is really going to do it for you. Period.
Re:Is Rails still relevant in 2018? by sydd on Tuesday August 28, 2018 @09:03AM (#17858474)
Except for 2 things: Finding developers. while it's possible it's much harder that say Java. You'll be in trouble if you are not in a metropolis and need 5+ rails developers. Long term sustainability. While it will work for your MVP, at some point you will need to rewrite it in a language that sclaes to 10.000s of lines of code and that will be painful.
Re:Is Rails still relevant in 2018? by cutler on Tuesday August 28, 2018 @12:33PM (#17860224)
Yes, this is a commonly overlooked consequence of adopting Rails. Here in London recruiters are falling over themselves trying to hire Rails developers as so many companies built their stack on Rails. However, once you leave the capital demand for Rails more ore less evaporates. Rails only thrives in tech hubs, probably due to its association with startup culture. Once you leave the capital PHP, Java and ASP.Net dominate.
Re:Is Rails still relevant in 2018? by tonyedgecombe on Wednesday August 29, 2018 @03:57AM (#17866526)
Once you leave the capital everything evaporates.
Re:Is Rails still relevant in 2018? by zaarn on Tuesday August 28, 2018 @03:39AM (#17857152)
RoR has always been rather impenetrable to me, more-so than some late-stage/terminal Node-based projects. I recently wanted to remove IP logging in a RoR application but I was unable to find the relevant code anywhere, the only hits that grep spat out where the migrations and I couldn't figure out how to rip all that out. In the end a project developer pointed me to the correct file and I had to change a single line (according to their guidance, I had no idea this line even related to IP logging) which fixed it.

I don't think that this is something I want in my project, I think I'll keep with .NET and Go even if I don't get the "competitive batteries-included all-in-one framework" packaged in.

(Well and there is always the issue that most larger RoR projects like to pull a lot of resources. And seriously the biggest three VMs on my host are an RoR application and the SQL Server which runs both MySQL and PG and the only node.js app I run)

Re:Is Rails still relevant in 2018? by ryanbrunner on Tuesday August 28, 2018 @07:18AM (#17857907)
Rails is definitely a framework where it requires some knowledge of the framework to really be effective. The adherence to convention over configuration means that a whole lot of things are pretty opaque, and if you don't know the conventions it can seem impossible to know how something is happening (logging is a great example). Javascript is the opposite extreme - nothing is assumed and everything is explicit, so there's a clear and obvious spot (at least in well architected programs) where something is configured.

When you know the framework well, however, I find one of Rails' strengths is that it massively decreases the time it takes to get familiar with a codebase. There's never a question of how a developer has organized their code, or configured logging (to take your example), because it's not a choice that Rails gives you - every project is going to work the same.

Re:Is Rails still relevant in 2018? by petepete on Tuesday August 28, 2018 @04:24AM (#17857342)
> I recently wanted to remove IP logging in a RoR application but I was unable to find the relevant code anywhere, the only hits that grep spat out where the migrations and I couldn't figure out how to rip all that out.

Usually you'd just create a custom logger[0] and tell Rails to use it[1]

[0] https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger....

[1] https://guides.rubyonrails.org/configuring.html#rails-genera...

Re:Is Rails still relevant in 2018? by zaarn on Tuesday August 28, 2018 @05:02AM (#17857470)
It wasn't putting the IP in the log but in the database and along the username and session data, there is an open ticket about that behavior too. Since I'm in Europe/Germany, this kind of data storage would have been a no-go even before the GDPR.
Re:Is Rails still relevant in 2018? by bshimmin on Tuesday August 28, 2018 @07:28AM (#17857947)
It sounds like you had to remove the Trackable module from Devise - which would indeed be one line of code to change in a Rails app, but quite hard to figure out if you didn't know. However, Devise is a third party gem which is often used with Rails but isn't actually a part of Rails, so can you really blame Rails for this? (And, unless it's for a very specific string, is grepping a codebase that you have no understanding of ever really a successful strategy?)
Re:Is Rails still relevant in 2018? by zaarn on Tuesday August 28, 2018 @07:32AM (#17857973)
I blame the coding practises of the rails devs, not the gem itself.

Grepping can be a successful strategy, esp. when you know what you are looking for and you can search the database column in the code

Re:Is Rails still relevant in 2018? by bshimmin on Tuesday August 28, 2018 @07:47AM (#17858052)
I can't in all honesty understand why you wouldn't just Google "rails login current_sign_in_ip", the top three hits for which would probably all put you on the right track. I would say grepping through the code of third-party libraries would be something I'd do only in desperation when working in an unfamiliar codebase. But hey, each to their own!
Re:Is Rails still relevant in 2018? by zaarn on Tuesday August 28, 2018 @08:10AM (#17858160)
Oh, don't worry, I did Google that. Just didn't work because none of the results helped or put me on the right track or were just plain too confused to be understandable.
Re:Is Rails still relevant in 2018? by mosen on Tuesday August 28, 2018 @01:36AM (#17856759)
How do you think .NET Core 2.0 MVC compares to Rails nowadays? I've been insanely productive with it. Willing to give Ruby/Rails a try, though.
Re:Is Rails still relevant in 2018? by pjmlp on Tuesday August 28, 2018 @03:45AM (#17857180)
Faster in every sense.

Go with Ruby/Rails if you don't need the JIT/AOT compilers and high performace GC algorithms.

Re:Is Rails still relevant in 2018? by mrmondo on Wednesday August 29, 2018 @10:36AM (#17868494)
Just FYI - Ruby 2.6 has JIT, not far off being released: https://www.ruby-lang.org/en/news/2018/05/31/ruby-2-6-0-prev...
Re:Is Rails still relevant in 2018? by UK-Al05 on Tuesday August 28, 2018 @05:02AM (#17857471)
I prefer .net core.

But it's missing scaffolding and stuff like that.

Re:Is Rails still relevant in 2018? by kowdermeister on Tuesday August 28, 2018 @03:54AM (#17857224)
One reason is that the founders don't know rails and it's far from obvious to pick up.

Another would be that sometimes a train is not the most practical transportation to travel a few blocks.

Re:Is Rails still relevant in 2018? by omnimus on Tuesday August 28, 2018 @03:34AM (#17857123)
Not saying that it is better but Laravel is mostly rails copy. And has huge active comunity.
Re:Is Rails still relevant in 2018? by ttty on Tuesday August 28, 2018 @06:49AM (#17857792)
Share code between client and server side to get client side prediction and server side validation.
Re:Is Rails still relevant in 2018? by esistgut on Tuesday August 28, 2018 @07:21AM (#17857919)
I'm exploring Nest [0] for my next project. It is a "glue framework" on top of Typescript and many Node libraries, with an Angular like style. Every Node library used has a framework module which provides the integration with the framework [1] so it appears to be both flexible and easy to use. I am just starting to explore Nest and I'm liking it, my previous experience on the backend was on Django for many years and Nest seems like a breath of fresh decoupled air, coming from this heavy monolithic experience.

[0] https://nestjs.com/

[1] https://github.com/nestjs

Re:Is Rails still relevant in 2018? by amzans on Tuesday August 28, 2018 @10:25AM (#17858986)
I've been interested in trying out Nest too. While I've just been toying around with it, it seems to strike a nice balance between fast to write and easy to scale (in terms of growing the codebase). Hopefully then the path from MVP -> full product becomes smoother.

It also makes good use of what Typescript has to offer, which IMO is very much welcomed.

Re:Is Rails still relevant in 2018? by senoroink on Tuesday August 28, 2018 @10:26AM (#17858994)
I've been using nest as well on a project. It's nice, but it's miles behind Rails.
Re:Is Rails still relevant in 2018? by lmm on Tuesday August 28, 2018 @03:43AM (#17857171)
Why do you think an all-in-one framework is an advantage? As soon as you want to switch something out you end up fighting the framework and the tutorials. Better to start with dedicated libraries that each do one thing - it's inevitably where you're going to end up.

(Not that I'd consider an untyped ecosystem in the first place, especially one as fond of "magic" (e.g. monkeypatching) as rails. I have sympathy for just getting something working as quickly as possible, but there comes a point where you're storing up too much trouble even for the short term)

Re:Is Rails still relevant in 2018? by wastedhours on Tuesday August 28, 2018 @05:01AM (#17857466)
> it's inevitably where you're going to end up

If the project's successful. The chance that most of what we're building with Rails hits the required escape velocity to require something other than Rails is a "Nice Problem".

For the vast majority of things people are building for the web, "CRUD+Auth+Billing" is all that's needed, maybe with a few API hooks into something more novel running on different infra.

If you then need it, then you can just build out a few more services with a few more API hooks, and then transition to a non-Rails stack as required.

It's great if you have unlimited resources to spend the time setting up the perfect tech base for a project for if it does eventually require scaling above what, Basecamp for example, can handle - but that seems like wasted resources for a great deal of orgs that don't have that level of backing.

Of course, if you truly need something novel, then it's a moot point, if you can't achieve what you need to with a stack, then just don't use it.

Re:Is Rails still relevant in 2018? by lmm on Tuesday August 28, 2018 @01:22PM (#17860724)
> If the project's successful. The chance that most of what we're building with Rails hits the required escape velocity to require something other than Rails is a "Nice Problem".

> For the vast majority of things people are building for the web, "CRUD+Auth+Billing" is all that's needed, maybe with a few API hooks into something more novel running on different infra.

> If you then need it, then you can just build out a few more services with a few more API hooks, and then transition to a non-Rails stack as required.

True as far as it goes. But if we're just talking about a prototype for validating product/market fit, with the intent to transition to a more maintainable stack as and when that becomes necessary, what's the problem with "list of 30 random npm packages" as a starting point?

Re:Is Rails still relevant in 2018? by wastedhours on Wednesday August 29, 2018 @04:21AM (#17866624)
Rails can take you much further than MVP though, as evidenced by all of the companies that reach breaking point with it. Basecamp, Github, Shopify - all reached proper business status on Rails (arguably Twitter too, although business is a bit of a stretch...).

We can argue it from both ends, but I see Rails as the middle ground, and allows you to go from MVP to $XXm ARR on the same stack. A hacky MVP with 30 npm packages doesn't have a clear path up the tree to grow without serious changes, and a custom architecture is useless if you don't get any users.

Re:Is Rails still relevant in 2018? by lmm on Wednesday August 29, 2018 @04:46PM (#17871857)
> A hacky MVP with 30 npm packages doesn't have a clear path up the tree to grow without serious changes

I see it as the opposite: it's clear which functions are the responsibility of which library, and it's easy to replace the ones that are becoming blockers and leave the ones that aren't. Whereas with Rails if you keep it monolithic then upgrades always become a huge pain point, but if you try to cut out pieces of it you're going against the grain.

(I used to love TurboGears nearly a decade ago, because you could use it like a monolithic framework to start with but it was explicitly a collection of standalone libraries underneath, and so once you started needing to do different things to individual pieces it was easy to. The modern web ecosystem could do with something like that, IMO (though personally I'm sticking to ScalaJS for the type safety))

Re:Is Rails still relevant in 2018? by smw on Tuesday August 28, 2018 @01:42PM (#17860936)
> what's the problem with "list of 30 random npm packages" as a starting point?

The dude starting with rails will probably be done with the MVP before you decide _which_ 30 random npm packages to use.

Re:Is Rails still relevant in 2018? by lmm on Tuesday August 28, 2018 @02:01PM (#17861160)
I'd probably just copy/paste from my current project TBH, which takes all of 5 seconds.
Re:Is Rails still relevant in 2018? by joelbluminator on Tuesday August 28, 2018 @04:19AM (#17857321)
I think the types argument is bullshit but it's just my opinion. Do python or ruby devs really feel they are less productive than java devs because they have no types? What I see happening is languages like java becoming more dynamic (var etc) and languages like ruby/python getting better IDEs (auto completion will continue to improve).
Re:Is Rails still relevant in 2018? by strken on Tuesday August 28, 2018 @06:23AM (#17857719)
I'm absolutely terrified of refactoring in big python, ruby, or javascript codebases, because there's less chance that I'll be able to find all the side effects of changing something. Tests help, but maintaining high-enough test coverage over possible code paths can be harder and less useful than working with a type system and writing fewer tests.
Re:Is Rails still relevant in 2018? by lmm on Wednesday August 29, 2018 @02:46AM (#17866196)
> What I see happening is languages like java becoming more dynamic (var etc) and languages like ruby/python getting better IDEs (auto completion will continue to improve).

I agree that that's what's going to happen in the short term, but var doesn't mean becoming dynamic; type inference doesn't compromise soundness at all. I think it's going to be much easier for sound type systems to get good-enough inference (indeed Hindley–Milner already offers "perfect" inference: you don't need to write any explicit types if you don't want to) than for dynamic languages to retrofit soundness. And while one can live with a few unsound constructs as long as it's locally clear when unsoundness is happening, as soon as you have pervasive soundness issues with action-at-a-distance your type system becomes almost useless.

Re:Is Rails still relevant in 2018? by meijer on Tuesday August 28, 2018 @05:40AM (#17857586)
> Do python or ruby devs really feel they are less productive than java devs because they have no types?

Yes, I do.

Re:Is Rails still relevant in 2018? by joelbluminator on Tuesday August 28, 2018 @07:04AM (#17857862)
OK, it's a fair opinion to have. But that's all it is, an opinion. Also - what makes you stick to python/ruby then?
Re:Is Rails still relevant in 2018? by IMTDb on Tuesday August 28, 2018 @04:40AM (#17857390)
I don't know about ruby and python but in JS there a significant number of projects that aim at adding a type system on top of the launguage
Re:Is Rails still relevant in 2018? by joelbluminator on Tuesday August 28, 2018 @05:17AM (#17857518)
I don't think it's such a huge trend, if it was Python wouldn't be one of the top 3 most popular languages in the world. Yes, there is typescript for Angular. Outside of that how often is it used? Pure JS is still used tons.
Re:Is Rails still relevant in 2018? by scns on Wednesday August 29, 2018 @04:25AM (#17866645)
It may not be a "huge trend", but those investing into static typing reap the rewads. Facebook rewrote messenger in ReasoML, bugs reported by users went from hundreds a year to less then ten. Fearless refactoring is another plus, the compiler will find everything you need to change to make the program run correctly.
Re:Is Rails still relevant in 2018? by philwelch on Tuesday August 28, 2018 @11:01AM (#17859288)
Python 3 has type annotations and there are static type analyzers for it.
Re:Is Rails still relevant in 2018? by UK-Al05 on Tuesday August 28, 2018 @05:01AM (#17857465)
Var is hardly more dynamic. Type inference is comes from statically type functional languages.
Re:Is Rails still relevant in 2018? by cutler on Tuesday August 28, 2018 @12:49PM (#17860406)
Java's var is only for type inference so nothing to do with dynamic typing.
Re:Is Rails still relevant in 2018? by bpicolo on Tuesday August 28, 2018 @09:37AM (#17858657)
> Why do you think an all-in-one framework is an advantage?

Because it has allowed the community to develop a whole lot of well-integrated, batteries-included libraries that span the from the model layer to the frontend.

Re:Is Rails still relevant in 2018? by philwelch on Tuesday August 28, 2018 @11:01AM (#17859300)
I hate to break it to you, but Rails doesn’t span the frontend. Hell, the frontend isn’t even written in the same language.
Re:Is Rails still relevant in 2018? by bpicolo on Tuesday August 28, 2018 @11:23AM (#17859486)
Of course it does. Not in SPA-javascript, but there's a ton of support for erb views:

https://guides.rubyonrails.org/action_view_overview.html

Re:Is Rails still relevant in 2018? by philwelch on Tuesday August 28, 2018 @12:55PM (#17860464)
I’m aware of this; I did Rails development for like five years. Server-side HTML templating isn’t a complete “batteries included” frontend solution anymore. In fact, it’s usually the first part that gets thrown away.
Re:Is Rails still relevant in 2018? by M_Bakhtiari on Tuesday August 28, 2018 @03:50AM (#17857205)
What makes you think Ruby is untyped?
Re:Is Rails still relevant in 2018? by ealhad on Tuesday August 28, 2018 @04:06AM (#17857268)
I think they meant “dynamically typed”.
Re:Is Rails still relevant in 2018? by agconti on Tuesday August 28, 2018 @07:37AM (#17858007)
Django fits this bill.
Re:Is Rails still relevant in 2018? by wolco on Tuesday August 28, 2018 @09:06AM (#17858492)
Curious why someone would pick rails over php in 2018. Existing pool of developers perhaps.. Any other reason?
Re:Is Rails still relevant in 2018? by psychometry on Tuesday August 28, 2018 @09:16AM (#17858547)
Because even in 2018 PHP is still PHP?
Re:Is Rails still relevant in 2018? by wolco on Tuesday August 28, 2018 @12:05PM (#17859887)
What does PHP mean to you? What are your personal views?

From a language perspective it's stable, fast, easy to deploy. Why wouldn't you choose to use it? For most it's not a difficult language to learn and start using.

Re:Is Rails still relevant in 2018? by cutler on Tuesday August 28, 2018 @12:47PM (#17860381)
Here's why I wouldn't choose it. When I look at a screen of idiomatic, PSRx-compliant PHP code I'm lucky if it contains 10 lines of code. Most of the space is occupied by KR-style space-wating layout plus blank lines between every line of code. Then there are the half-screen doc comments. Ruby, by contrast, is concise and code-focused instead of boilerplate-focused.
Re:Is Rails still relevant in 2018? by scns on Wednesday August 29, 2018 @05:39AM (#17866962)
PHP makes it really easy to write insecure software, because the first googleresult is often outdated and hacked in a short time by automated scripts.

The defaults of functions/methods in the standard library are often insecure.

if you want to write good PHP i can recommend following resources: https://paragonie.com/software Would use their stuff if i wrote PHP https://www.phptherightway.com https://phpdelusions.net even though the name sounds abrasive it is a good resource on dbaccess if you want to know specifics. It is from a guy with several SO gold badges.

Re:Is Rails still relevant in 2018? by PunchTornado on Tuesday August 28, 2018 @09:06AM (#17858494)
laravel can do all that