News for hackers. Stuff that matters.
Re:Running GitHub on Rails 6.0 by yagodragon on Monday September 09, 2019 @03:50PM (#20921731)
Is rails really that good? I feel so confused and paralyzed trying to find a modern backend framework. I've almost settled to Python+Django because it enforces good practices,has great tools like Django Rest Framework and Python is a language with huge application field. On the other hand, laravel and rails have so strong communities and feel more modern (for example, integration with front end frameworks). Django just seems left behind. So the question boils down to this: Should I invest my time learning django in 2019?
Re:Running GitHub on Rails 6.0 by clairity on Monday September 09, 2019 @04:13PM (#20921946)
rather than the framework (which largely have parity, as far as i can tell), the big decision factor in my mind is between (1) how joyful it is to code in ruby vs (2) the power of statistical/machine learning libraries in python.

if you don't have complicated statistical/machine learning needs, i'd recommend ruby on rails every time. it's so fast to get started and productive. and the language is performant enough to get you to initial success (at which point you can choose to spend money to attain greater performance).

Re:Running GitHub on Rails 6.0 by batiste on Wednesday September 11, 2019 @04:19AM (#20937702)
If you do not know Ruby, it is neither easy nor fast. You have to learn a brand new language and Ruby is quite a departure from C-like languages that most people are familiar with. Then you have to learn Rails and its conventions.

It is a huge mountain of work you have ahead yourself if you are a newbie in both domains.

Sure you might be able to slap together a simple CRUD app following a tutorial but truly knowing what you are doing will take months, if not years. It is a huge investment.

Re:Running GitHub on Rails 6.0 by weaksauce on Monday September 09, 2019 @04:23PM (#20922049)
rails is a good technology that is more mature and boringish now. it's a solid choice to choose to learn. you can also go down the javascript route that changes faster than a more mature technology. realistically a lot of the concepts from any of them will be fairly transferable.
Re:Running GitHub on Rails 6.0 by onlyrealcuzzo on Monday September 09, 2019 @04:11PM (#20921926)
Rails is really that good. I'm a dinosaur in web development (I think). I've used everything popular for a decent swath of time: Microsoft's MVC, Java Apps Framework at Google, Django, Drupal & Joomla in PHP, Elixir/Phoenix, Express, and Rails.

When I first came across Ruby -- and particular Rails -- I loathed it. Ruby's syntax allows you to get pretty creative, and jumping into Rails + Rspec is like jumping into a Perl repo that's been managed by 3 different people over ten years. There's all kind of things that -- because the syntax is so loose -- it's not clear what's going on. It doesn't help (in my opinion) that Ruby's own style guide almost encourages this: dropping the "()" from functions that take no arguments; Eiminating "{}" around certain hashes passed into functions; The "!" marker having a seemingly different meaning in almost every library, etc...

When you're new to Rails and Rspec, it's easy to have no idea what's going on.

That being said, you can prototype an entire business in a few days Rails. It is that easy. It's incredibly polished. It's opinionated in mostly right ways, and all of its libraries are, too -- which means you don't often find people doing crazy shit (except Devise, everyone is always doing something crazy with Devise).

As much as I hated Rspec with a passion, I do feel like it's the best testing frameworks I've ever come across. It lets you be SUPER expressive about what you're testing.

I go against the Ruby & Rspec style guides on a few things, but I feel like no other combination let's you write code that's so expressive.

And, finally, anything you want to do in Rails has a library built in that does it very well. And unlike in -- say JavaScript for example -- there aren't ten libraries to pick from. There is a clear winner, and I think that's good for the community.

Also, almost every major API you can imagine has a Rails Gem so that it plays nicely with the framework.

Don't get me wrong, I loved Django and I still think it's a great framework. My love for Python, Elixir, and Kotlin are strong.

Ruby & Rails are by no means perfect, but I do feel like it's a very clear winner if you're starting a new web business. The number of companies I've seen flounder because they wanted an App + a website + (obviously) backend business logic... and all of that in one language, in one code base -- it's impressive. I've seen a lot of Rails businesses fail. But despite what people warn about scaling, I've never seen a Rails-based company fail because of Rails. Plenty have flourished -- Shoppify, GitHub, AirBNB, etc...

I could go on and on about the advantages WRT hiring, too. Don't even get me started...

Re:Running GitHub on Rails 6.0 by frizkie on Monday September 09, 2019 @04:47PM (#20922310)
As a full-time Ruby developer I absolutely loathe code which drops the parentheses from method definitions that have arguments.
Re:Running GitHub on Rails 6.0 by sudhirj on Tuesday September 10, 2019 @02:11AM (#20925502)
Have you tried Rubocop? It automatically reformats code according to an opinionated style guide (which I think aligns with your opinion).
Re:Running GitHub on Rails 6.0 by chillfox on Monday September 09, 2019 @10:26PM (#20924578)
interesting, I find that the fewer parentheses and squiggly brackets the easier the code is to read.
Re:Running GitHub on Rails 6.0 by philwelch on Monday September 09, 2019 @09:33PM (#20924362)
It kind of depends on what you need. If you need to deliver working code in a hurry and either agree with or can live with the opinions assumed by Rails, go for it. I find a lot of what is in Rails somewhat overweight and unnecessary, and I’ve never see a Rails app age well. But in that respect I’m comparing Rails more to something like Flask than Django.
Re:Running GitHub on Rails 6.0 by leklund on Tuesday September 10, 2019 @01:35AM (#20925303)
“and I’ve never see a Rails app age well.”

Seems like this describes any app in any language I’ve ever worked on. Certainly Rails apps are more prone to this phenomenon because of the low barrier entry. Having worked with apps that have grown from Rails 2 through 5 (and soon 6) it’s quite possible to build Rails apps that “age well”.

Case in point for a Rails app that can age well is GitHub. When they launched in 2008 they were probably using Rails 2.0.2 (best guess based on release notes).

Re:Running GitHub on Rails 6.0 by philwelch on Tuesday September 10, 2019 @04:40AM (#20926213)
To be fair, I've never seen GitHub's codebase. In fact, I'm not entirely sure if it's even still the same "Rails app", or if they've moved to a microservice architecture or something.
Re:Running GitHub on Rails 6.0 by pwelch on Tuesday September 10, 2019 @10:46AM (#20928804)
Not sure what microservice architecture has to do with it. You can have microservices that are Rails apps. :)
Re:Running GitHub on Rails 6.0 by philwelch on Tuesday September 10, 2019 @04:50PM (#20933563)
Yes but if you change architectures, you will have replaced much of your original codebsae.
Re:Running GitHub on Rails 6.0 by pwelch on Tuesday September 10, 2019 @10:51AM (#20928856)
Agreed, any application regardless of language or framework can age poorly. I've seen some pretty solid "long running" Rails applications that were just maintained well.
Re:Running GitHub on Rails 6.0 by sellingwebsite on Monday September 09, 2019 @04:10PM (#20921922)
ça dépend.

I am only familiar with Django and Rails, can't comment about Laravel.

If you are building a basic CRUD app, definitely stick with Rails. If you are doing some kind of CMS or need machine learning pipeline, go with Python.

A warning about Ruby/Rails: some folks have moved on to shinier languages/frameworks and as a result there are lots of unmaintained gems (gems are 3rd party libraries in the Ruby world) out there. For instance, I needed a curl wrapper written in Ruby. Nothing worked for me so I ended up forking Ethon [0]. I am hesitant to send PRs, since I doubt that they will get merged. Now I am maintaining two codebases at once. I will probably rewrite it from scratch at some time.

A warning about Python/Django: dependency management is kind of a mess [1]. See linked discussions [2][3][4][5].

[0] https://github.com/typhoeus/ethon

[1] https://xkcd.com/1987/ (Add pipenv and poetry to the mix)

[2] https://news.ycombinator.com/item?id=20672436

[3] https://news.ycombinator.com/item?id=18612590

[4] https://news.ycombinator.com/item?id=17607083

[5] https://news.ycombinator.com/item?id=13459740

Re:Running GitHub on Rails 6.0 by Scarbutt on Monday September 09, 2019 @10:39PM (#20924634)
For instance, I needed a curl wrapper written in Ruby. Nothing worked for me

Curious, why didn't something like faraday worked for you?

Re:Running GitHub on Rails 6.0 by sellingwebsite on Tuesday September 10, 2019 @02:16AM (#20925537)
Faraday is a wrapper around several libraries, no? I needed more features that these libraries could offer, namely HTTP/2 support, brotli compression, timings for the requests (namelookup time, tls handshake time, connect time, etc..). Faraday and Net:HTTP is fine if you're doing simple HTTP requests.
Re:Running GitHub on Rails 6.0 by xvilka on Monday September 09, 2019 @04:26PM (#20922075)
I would recommend to consider using Go instead. Statically typed, native-fast, easily deployed. Everything that both Python and Ruby lack.
Re:Running GitHub on Rails 6.0 by StreamBright on Monday September 09, 2019 @04:56PM (#20922394)
Go's static typing is a bit old school. If you want a statically typed (yet flexible and powerful), native-fast, easily deployed environment, I would go for Rust. As of today it brings everything to the table that you need for reliable web services. The performance and memory safety are the biggest selling points for me.
Re:Running GitHub on Rails 6.0 by xvilka on Monday September 09, 2019 @05:06PM (#20922482)
I like Rust and use it often, but the learning curve is steep. Go can be learned in a week.
Re:Running GitHub on Rails 6.0 by StreamBright on Tuesday September 10, 2019 @03:09AM (#20925775)
But it pays off. With do you can spend more time on chasing data corruption bugs with Rust you spend more time (initially) on learning it.