Rails 5.0.0.rc1
github.com
github.com
Highlights for me will be:
- Actioncable (real-time communication over websockets)
- Rails-API is merged into core.
- Min ruby version is 2.2 (performance improvements via Garbage Collector)
- Little bit of code cleanup (less code to run)
- Turbolinks 3 (single-page applications)
- Evented file system monitor (faster development environment)
I think they have done a great job with the release. Especially removing Celluloid, Redis, and EventMachine as a dependency for ActionCable part.
I only have one small concern about the Turbolinks part. It hasn't been my choice until now for the projects because of the compatibility issues with other libraries. It always felt like the Quicktime player on Mac OS. Sure you can use it but you better off with something else.
But I really want it to be something i can use out of box this time. Partial rendering is not there yet but lets wait and see how it turns ut.
- Rails-API is exciting. It means better defaults, including less bloat, for developers taking these options
- Turbolinks is even less exciting than it wasn't a few years ago.
- Several other changes boil down to "better performance". Let's hope that pans out.
Furthermore, the optimizations that TL v5 provides means that you can use your webviews for mobile and get an incredibly responsive experience. That is what they are doing with Basecamp and they're able to provide a first class mobile experience on iOS, Android, a desktop app, all with a team of 12 developers (https://m.signalvnoise.com/the-majestic-monolith-29166d02222...). That's fucking impressive. On top of that, they've release the generic iOS and Android wrappers so that you can roll your own mobile applications with Rails and Turbolinks.
https://github.com/turbolinks/turbolinks-ios
https://github.com/turbolinks/turbolinks-android
There's no other framework out there that remotely comes close to providing that value to the end developer.
The market demands that your app be present on multiple platforms, which is usually a fucking nightmare if you're a small dev team. These Turbolink additions now give you a fighting chance.
Among other things, since its inception it has messed with the CSS heirarchy, resulting in the fact that by default it loads all the CSS and JavaScript for all pages, in an order you probably don't want. (Note: there is a reason the "C" in CSS stands for "Cascading". It wasn't designed to all be loaded at once.)
If you DO want "one page apps", then fine. If you don't, and you have a significant site with more than a couple of dissimilar pages, it will probably be more performant if you disable Turbolinks and load only the JavaScript and CSS necessary for a given page, i.e., the conventional approach.
"sucks for other use cases"? Which use cases have you use TurboLinks where it wasn't a good fit?
Basecamp isn't a trivial one page app; it has over 200+ screens.
For page changes, CSS is generally scoped by controller action classes. Quick look up by the browser, penalty negligible.
All of the JS is loaded, but again, you can invoke the needed js for the page by looking at the body/action selector. Again, a few if checks on the "page:change" callback.
Weighed against the traditional: a full request to the server which includes a download of relevant CSS for the page, a download of relevant javascript for the page, parsing of that css, parsing of js, and then execution of that js.
2) "Basecamp isn't a trivial one page app; it has over 200+ screens." I didn't say it was. Read again. However, Basecamp IS written in such a way as to heavily rely on Turbolinks.
3) "For page changes, CSS is generally scoped by controller action classes. Quick look up by the browser, penalty negligible." Not in our tests with Rails 4.2.
4) "All of the JS is loaded." Yep. The rest of your sentence is not relevant to my point.
You seem to think my objection was that there is some kind of difficulty accessing specific CSS/JavaScript under Turbolinks. Nothing of the sort. Rather the opposite, really: it was that there is too much loaded, specifically in ways that disrupt standard CSS hierarchy.
Obviously that can be compensated for by scoping. That wasn't my point. The point was that IT WORKS DIFFERENTLY THAN THE STANDARD CSS HIERARCHY. Understand?
"Weighed against the traditional: a full request to the server which includes a download of relevant CSS for the page, a download of relevant javascript for the page, parsing of that css, parsing of js, and then execution of that js."
There are times when that is desirable over having that CSS and JS always loaded. I get that you don't seem to be able to think of any, but we've encountered many.
I'm not going to get into an argument with you here about which is "better". Which you seem to want. I simply said there are use cases that are appropriate to each.
I tried partial rendering in TL3 and liked what it did. I then moved to TL5 and couldn't figure out how to migrate my code that made use of the partial rendering feature. It'd be nice if they provided a better upgrade guide on how to accomplish similar tasks between TL3 and 5 to make the transition easier.
Turbolinks messes A LOT with conventional design. Unless you really want the "one page" approach, or have a small, simple app or site -- or even if you just want to design a site using normal CSS conventions -- then Turbolinks gets disabled right away.
Fortunately, we can still do that. I can legitimately question the decisions made regarding default settings, but at least those settings can be changed.
I would like to know if this makes Rails worth learning for someone who knows Ruby but doesn't know rails. I have found my ruby knowledge to be less than marketable, and I want to step my game up. What do yall think?
Besides, whether you chose to use Rails, or Sinatra, or move to some other language, as long as you are doing web development you'll be able to apply the concepts learned. So I say go for it!
The problem is that the maturity of the Rails market means that most Rails positions require X number of years experience - I can certainly pick up Rails but those years of experience have to come from somewhere.
EDIT: not entirely true, as there are a lot of PHP jobs. However these include bottom-feeder Wordpress gigs and generally pay much lower salaries than other languages, right or wrong.
I'm personally a fan of Clojure which is an excellent language with excellent tooling and a smart and friendly community
From a high-level-language standpoint, static typing is a crutch. It isn't necessary, but it forces you to do things "the right way"... according to some definitions of the right way. It is possible to make mistakes without static typing that you would not make with it... but if you're careful you can also do some good things without it that you can't do with it. It all depends on whether you feel more comfortable with taking control or you feel the need for some restrictions to keep you "in line".
From a purely performance standpoint, there is no question: static typing compiles/interprets to faster code.
I see types as a high-level design tool. They allow me to reason about a domain, and figure out how to structure things at a high level before delving into the implementation. Yes, performance is a great side-benefit, but it is not always the driving factor.
It'd be great to get something like the TIOBE index, but split by country, although I guess I'd try to bias it a bit heavier towards commercially developed LOCs.
It not only teaches you Rails, it teaches Github and Heroku and gets your first first web app deployed at the end of the first chapter. And, it's free!
There is also enormous hiring market for Rails developers.
Nothing matches PHP adoption. It started 10 years before than Ruby and Python web frameworks and its runtime model is ideal for free hosting. That gave it mindshare and market share. It's still one of the ugliest languages even if it's slowly getting a face lift.
At the time its competitors where Java and Perl. Perl could have the same runtime model and was the first language for the web thanks to CGI.pm. PHP won because its simplicity and the commands embedded in the HTML page. Java is another world and only suited to corporate developers especially because there could be hardly a free Java hosting. Any of them now, not counting the AWS Lambda free tier?
[1] http://www.payscale.com/research/UK/Job=PHP_Developer/Salary
[2] http://www.payscale.com/research/UK/Job=Ruby_Software_Develo...
Besides, PHP codebases are notorious for being incredibly messy. PHP as a language used to suck big time, so you'd be taking over lots and lots of legacy code that would make you cry. That's nowhere as big of a problem with Rails: it's newer and Ruby is a joy to work with.
It is definitely a convenient tool, designed with programmer happiness in mind -- so there're a lot of things which will make your life easier. Although, sometimes this UX-centric model backfires and we get such things as RSpec.
Finally, it depends on what you are trying to achieve. If you are into money-side of the question, then maybe JavaScript ecosystem might be more worthwhile. Although, I believe that it is possible to bootstrap demand around tools that you are passionate about if you convince others to think the same way. My point being, that maybe you should look at the technologies that you love instead of following the market hype, but this is more harder and also means more time investment, but it pays off in the future.
It's a generalized Ruby TDD tool which has very little to do with Rails per se.
The suggestion that RSpec was created to cover some failure of Rails strikes me as exceedingly strange.
Now people learn Docker and Micro Services before even learning proper programming.
Are there any books that you'd recommend or anything?
It takes you through building a simple site with a shopping cart from scratch, and lets you encounter enough real-world style situations to give you a really good grounding.
this one obviously.
Or course you should also learn some front end stuff too and be more full stack worthy, especially with ajax powered APIs.
I always had the impression (possibly false) that the Rails community was very focused on rapid development, but that it had a tendency to leave dead projects on the road-side to fend for themselves -- and that maintaining a project that was a few years old sort of implied massive forward-porting if you wanted to have a semblance of security updates?
Is my impression way off? Is there a "safe path" if one sticks with the Rails core?
Just definitely keep up with the minor releases; but the major releases will stay in good standing for a while too! Lock down all your gem versions and only update as needed; so if they ever break on a move to the next major version - you can act accordingly.
However 10 year is a bit much. What did anything look like 10 years ago? I could see 3 or 4 year cycle though.
[ed: Other things off the top of my head, AFAIK both from the 90s: slashdot.org, webhostingtalk.com, twitter is from 2006 (obviously twitter and slashdot have been pretty much rewritten, not sure about wht.]
ETA: It doesn't get as much press, but ActiveJob is one of my favorite parts of Rails 5. It's an agnostic implementation of background jobs -- ActiveRecord : (Postgres, Mysql, etc) :: ActiveJob : (Sidekiq, Resque, etc). Very nice, flexible syntax and it helps make your application platform-agnostic.
Second ETA: As rapind pointed out, ActiveJob has actually been available since Rails 4.2.
When I was looking for a new job recently I was mostly looking at places like Stack Overflow jobs, along with the London Ruby User Group mailing list which tends to get three or four job postings a week - I haven't looked at a mainstream job site since about 2008.
If you want a better sense of how much work there is add a few years of Rails experience to a Linked In profile and watch the recruiters start circling.
Overall I expect this release to be more lightweight memory wise. This also should first release of Rails that includes ActionCable - https://github.com/rails/actioncable/tree/archive
The big feature of Phoenix 1.2 is channel presence: https://dockyard.com/blog/2016/03/25/what-makes-phoenix-pres...
Whats coming in elixir 1.3: http://tuvistavie.com/2016/elixir-1-3/
Ecto 2.0: http://blog.plataformatec.com.br/2016/02/ecto-2-0-0-beta-0-i...
Other than that the community is growing at a healthy pace. Hex packages have gone from 1000 to over 2000 in the last 6 months.
Here is a full list of companies using elixir: https://github.com/doomspork/elixir-companies
It's most useful for our services (our consumer facing app is Rails atm) but it's great.
Churn in the images are lines added, changed and deleted that does not involve blank/comment lines.
I'm looking forward to wrapping my mind around Phoenix and already planning to do a small subscription app with it where it happens to be a perfect fit.
Elixir is great but it's still not ruby. Much like Go, it's not something you can fully appreciate until you've seen the limitations of other approaches first hand. There are so many things that Phoenix and Elixir do that solve major long term problems and ruby's biggest selling point is usually the short term.
2015 is a watershed year for the Elixir ecosystem. It was like this back in the Rails 1.2 days. Back then, people said the same thing about Ruby. "Ruby is great, but it's still not X."
The idea that Rails is very fast for doing quick development is, at this point, a myth. It takes thoughtfulness to write good code, regardless of the language. There's this idea that you can put together a prototype quickly, but in the wild, it ends up being a repository of sloppy code resulting from fuzzy, superficial thinking.
Another situation I have seen is this the "perpetual MVP". That is, sacrificing code quality because you don't know if the product is even something that people want. However, when your MVP has users and it starts getting traction, it's not an MVP anymore. The fragility that comes from sloppy coding comes back to bite you. I think developers confuse Ruby's agility with their own sloppiness.
I think Elixir is interesting not just because it solves those long term problems, but it is also as agile in the short term -- provided that you are not a sloppy coder.
That and the ability to monkey patch something from a 3rd party library without breaking your upgrade path, having to fork it or needing to adjust the entire inheritance chain. It's not good practice to do too much but knowing you can make using all those gems a lot easier.
This is oranges and apples. First, you're comparing a language to a framework. Second, use cases for these two barely overlap. I'm a huge fan of Go and I started using Phoenix for web development and I can't really think of a scenario where I'd have to think which one to choose for a particular job.
In the circle I'm running in, Elixir and Phoenix are way bigger news than Rails 5.
Is Rails 5 any faster then previous version?
I still haven't used ActiveCable though.
I didn't use ActionCable because my application doesn't need it. I experimented with it since the first version, which I plugged into Rails 4.2. It had some quirks that were fixed. It works well. There is obviously code to write in the client to handle the websocket but it's pretty much standard boilerplate. I expect some gem will appear implementing it in some clever helper, except the code we really have to write.
Just to remain slightly on topic, you can't really compare an entire application stack like Rails with a language like Go. Maybe you could do with something lighter like Sinatra.
For me Rails big win isn't that it's high performance (although done right it can handle a decent volume of traffic), but the fact it's configured out of the box. You can be productive on day one, rather than wiring together low level libraries for database access and the like.
Finally having said all that I'm having a really good time with Pliny, Heroku's Ruby API stack, which feels like I imagine Rails might have done if it were built specifically for REST APIs rather than full applications with a UI.
One of my big gripes with Rails is defaulting to ActiveRecord, compared to pretty every alternative (my favourite is Sequel). This is the problem with Rails: You can be productive if you can be productive with its default choices.
But in every project where Rails has been involved that I've worked on, sooner or later people start fighting one of the Rails default choices, and the problem with that is that so many parts are expected to be there by other components they bring in, so even things that are in theory replaceable are in practice tightly coupled.