News for hackers. Stuff that matters.
Re:Demand for Ruby on Rails is Still Huge by ransom1538 on Wednesday June 20, 2018 @10:27AM (#17355696)
$ curl https://news.ycombinator.com/item?id=17205865 > hn.txt

$ grep -i 'php' hn.txt | wc -l 8

$ grep -i 'python' hn.txt | wc -l 50

$ grep -i 'react' hn.txt | wc -l 71

$ grep -i 'java ' hn.txt | wc -l 6

$ grep -i 'java,' hn.txt | wc -l 8

grep -i 'javascript' hn.txt | grep -v 'javascript:void' | wc -l 35

^^ thanks busterarm

$ grep -i 'objective' hn.txt | wc -l 2

$ grep -i 'object-c' hn.txt | wc -l 0

$ grep -i 'object' hn.txt | wc -l 4

$ grep -i 'haskell' hn.txt | wc -l 7

$ grep -i 'rails' hn.txt | wc -l

24 <<<<<<<

$ grep -i 'mongo' hn.txt | wc -l 10

$ grep -i 'mean' hn.txt | wc -l 21

$ grep -i 'lamp' hn.txt | wc -l

$ grep -i 'docker' hn.txt | wc -l 19

$ grep -i 'aws' hn.txt | wc -l 3

$ grep -i 'devops' hn.txt | wc -l 28

$ grep -i 'android' hn.txt | wc -l 18

$ grep -i 'ios' hn.txt | wc -l 21

$

Re:Demand for Ruby on Rails is Still Huge by js2 on Wednesday June 20, 2018 @11:00AM (#17356026)

  $ links -dump https://news.ycombinator.com/item?id=17205865 | grep -Eio '(php|python|react|javascript|java|objective-c|objective|object-c|object|haskell|rails|mongo|lamp|docker|aws|devops|android|ios|django|ruby|rails|react|swift|node|docker)\b' | tr A-Z a-z| sort| uniq -c | sort -rn
  87 react
  63 python
  42 javascript
  39 aws
  33 devops
  29 rails
  28 ruby
  28 node
  23 android
  22 java
  19 ios
  19 docker
  15 django
  12 haskell
   8 php
   7 swift
   5 mongo
   2 object
   1 objective-c
   1 objective
Used links to get just the text and not the HTML markup. Used grep -O to emit just the part of the regex which matches so we can feed it all into a pipe that emits a single histogram. By ordering the pattern we can match "javascript" before "java" and not need to add the space or "," after "java" to exclude javascript (you could also use "\b" with grep -E).Case-insensitve and case-folded. Added a few other keywords.

Since grep only emits the first match on a given line, this won't count properly if multiple keywords appear on one line.

Why did you search for "mean"?

Edit: here's another approach that splits the output into words first so that we can count multiple keywords on one line, along with a couple tweaks to the pattern to eliminate some false positives:

  $ links -dump https://news.ycombinator.com/item?id=17205865 | tr -s '[[:punct:][:space:]]' '\n' | tr A-Z a-z | grep -E '\b(php|python|react|java|object|haskell|rails|mongo|lamp|docker|aws|devops|android|ios\b|django|ruby|rails|react|swift|node|docker)' | sort | uniq -c | sort -rn
  87 react
  63 python
  42 javascript
  38 aws
  33 devops
  29 rails
  28 ruby
  27 node
  23 android
  21 java
  19 docker
  18 ios
  15 django
  12 haskell
   8 php
   7 swift
   6 nodejs
   5 reactjs
   5 mongodb
   5 mongo
   2 objective
   2 object
   1 reactnative
   1 reactive
Another issue: this only grabs the first page of comments.
Re:Demand for Ruby on Rails is Still Huge by dang on Wednesday June 20, 2018 @02:53PM (#17358512)
Yeah, we have to have comment pagination turned on these days to spare our poor single-core server with steam coming out its ears. Hopefully the performance improvements we've been working on this year can roll out in the next few months.

If you or anyone wants to run this query on the full comment set, email us ([email protected]) and we'll turn pagination off while you do that.

Re:Demand for Ruby on Rails is Still Huge by dmartinez on Wednesday June 20, 2018 @11:26AM (#17356270)
They were probably looking for references to 'MEAN' stack.
Re:Demand for Ruby on Rails is Still Huge by NegativeLatency on Wednesday June 20, 2018 @11:29AM (#17356296)
mean = mongo, express, angular, node
Re:Demand for Ruby on Rails is Still Huge by ransom1538 on Wednesday June 20, 2018 @12:14PM (#17356731)
+1 Solid thanks man.
Re:Demand for Ruby on Rails is Still Huge by 6t6t6t6 on Wednesday June 20, 2018 @10:45AM (#17355848)
The good thing about Rails is that there's not much to talk about it. It just does what it is suposed to do without any drama.
Re:Demand for Ruby on Rails is Still Huge by js2 on Wednesday June 20, 2018 @10:55AM (#17355970)

  $ curl -s https://news.ycombinator.com/item?id=17205865 | grep -Eio '(php|python|react|java[ ,]|javascript|objective-c|objective|object-c|object|haskell|rails|mongo|mean|lamp|docker|aws|devops|android|ios|django)' | tr A-Z a-z| sort| uniq -c | sort -rn
 295 javascript
  95 react
  65 python
  40 aws
  33 devops
  29 rails
  26 android
  22 ios
  21 mean
  19 docker
  15 django
  13 haskell
  10 mongo
   8 php
   8 java,
   8 java
   2 object
   1 objective-c
   1 objective
Re:Demand for Ruby on Rails is Still Huge by sethgecko on Wednesday June 20, 2018 @10:42AM (#17355832)
javascript is actually counting the scripts in the page
Re:Demand for Ruby on Rails is Still Huge by SmallDeadGuy on Wednesday June 20, 2018 @10:47AM (#17355872)
Actually no, it's counting the number of links with href="javascript:void(0)" (from a rough look at the page source).
Re:Demand for Ruby on Rails is Still Huge by busterarm on Wednesday June 20, 2018 @10:52AM (#17355923)
grep -i 'javascript' hn.txt | grep -v 'javascript:void' | wc -l 35

There.

Re:Demand for Ruby on Rails is Still Huge by busterarm on Wednesday June 20, 2018 @10:48AM (#17355881)
I guess I'll be the guy to remind everyone that Ruby != Rails. (I'm a Ruby dev and mostly do not touch Rails at all professionally)

$ grep -i 'ruby' hn.txt | wc -l 25

$ grep -i 'ruby' hn.txt | grep -v 'rails' | wc -l 22

Re:Demand for Ruby on Rails is Still Huge by pmontra on Wednesday June 20, 2018 @11:08AM (#17356104)
There aren't many job postings for Ruby without Rails. Which kind of Ruby projects do you work on?
Re:Demand for Ruby on Rails is Still Huge by yebyen on Wednesday June 20, 2018 @11:30AM (#17356300)
My first (Rails) job was not advertised as looking for Rails dev, and I didn't touch any Rails code for probably the entire first year. Hiring manager was looking for a Ruby developer without tons of experience, or strong opinions about which gems to use. It was common for me to receive an assignment with instructions to complete it without downloading any gems.

Most of my projects, were not web apps. ETL type things. When it was time for me to develop something with a web front-end, we still did not use Rails. Sinatra and (pick any template language off the shelf.)

Ruby and Rails are both large skills that take lots of experience and maybe even training to become competent at using. When hiring junior developers, I think based on my experience at least, a hiring manager would do well to defer them from learning Rails until the latest possible moment. Better to learn one major skill at a time.

(Then again most HN readers are probably not trying to get hired as a junior developer anywhere.)

Re:Demand for Ruby on Rails is Still Huge by briandear on Wednesday June 20, 2018 @11:43AM (#17356426)
Totally disagree. Rails first learning means that junior devs are immediately productive. And writing code without using any gems? What the hell for? Most of the major standards are MIT, so it couldn’t be for licensing reasons. Not using gems is just wasting effort reinventing the wheel.

Ruby on Rails isn’t a major skill that takes lots of experience. It takes experience to master it, but a junior dev could easily become productive in the framework almost instantly.

Re:Demand for Ruby on Rails is Still Huge by yebyen on Wednesday June 20, 2018 @06:33PM (#17360459)
Ruby is a language, and maybe if you already know 10 languages then it's a very easy language to pick up, but... how do you expect to know where Ruby ends and Rails begins, if you never separate the two?

I don't see this your way. Junior devs are immediately productive? What kind of fantasy land is this? Junior devs need to walk before they can run. Everyone should know enough Ruby to parse them some CSV, if that's going to be part of the stack.

Then, they can pick up a Gem library for parsing CSV and never do that again. But having the experience of working around the edge cases and knowing enough core language features to know what parts are easy without any gems, is going to make you better able to spot "using the gem wrong," or even "the gem is doing it wrong" (which also totally happens!)

In my company, CSV was something we needed to have as a core competency (customers sending us data files, and bad data files, all of the time, ETL pipeline shaping them up and making them loadable into our custom schema...) and there were just two of us devs, so nobody's got time for pair programming. You're honestly going to ask a junior developer to start with "rails new" and then somehow trust what they produced, putting it on the internet?

A junior dev could easily become productive with a handful of gems too, and practically understand every part of what they did. That's the point. You don't keep all gems out of the picture forever, just long enough to learn what hard problems look like without having them solved for you.

If I'm a hiring manager and you're my junior dev, I want to start by seeing how you think, and I want to see you thinking with first principles so I can tell you where you're going wrong. I'll help you figure out the hard parts if you're struggling with something. But I do want you to struggle with those parts a bit, and I want to see it. If 95% of the work is done for you by a gem, then I might as well let you ask Rubocop and Brakeman what else you're doing wrong, and there's probably no point in having me here at all.

Re:Demand for Ruby on Rails is Still Huge by busterarm on Wednesday June 20, 2018 @10:03PM (#17361488)
I'm really confused by some of what you're saying.

For one, CSV is part of the standard library. just "require 'csv'". No gems required.

Two, nobody without a really good reason should try implementing their own CSV parse library. RFC4180 doesn't even remotely reflect reality. It's several hundred lines of code to do right (about ~700 in Ruby currently, down from a bit over 2000 in earlier implementations). I hope they're good at RegExp.

Re:Demand for Ruby on Rails is Still Huge by yebyen on Wednesday June 20, 2018 @11:36PM (#17361912)
> just "require 'csv'". No gems required.

Seven years ago, at the time I was starting the job I mentioned, this was not a thing. The gem was called 'fastercsv' and it was made a standard library in 1.9 – we were mostly working on 1.8.7 when I started, and 1.9.2 when I did the CSV implementation(s). It was a brand new standard library and it did not do all things for all people. Almost like they just picked a pretty good one off the shelf!

It still does not do all things for all people... today, you also have other competing implementations, say 'smartercsv' with most recent commit activity 4 days ago.

It's an implementation of CSV. If you know your CSV is pristine, you can parse it in a lot less than 700 lines. We had a utility that would output "pristine CSV" dumped out from whatever garbage the client sent us, in whatever Excel or other columnular format, and we had another utility that would only accept this "pristine" format. Sometimes things went wrong. More often than you expect maybe, and we'd fix them ... or sometimes we'd get the clients to fix their shitty files, and leave it the way we thought it should work.

Depending on what you need to do with the CSV, or how many ways you're planning on handling CSV, one could argue that you will be better served by a minimal implementation that you know exactly what it does and does not do, because you told it what to do. If it's making a mistake, that's yours. You own it! That's another boon, when the quality of the data is not guaranteed.

The standard library I remember has some great idiosyncrasies that you'll know if you've ever used it to work on bad CSV. So do all of the CSV libraries. I don't work on CSV anymore and my memory of it is not so good, so I can't tell you the war stories in perfect detail, but... suffice it to say there are several CSV libraries with different strengths and weaknesses.

We mixed and matched parts that served the specific need we had at any given time and place, until I was a total CSV expert. It was not a perfect ecosystem, and 7 years ago `require 'csv'` was simply not a thing. You had to pick one off the shelf, or roll your own. I'm really not sure what's different today. (Probably not much! Parsing CSV is not a core competency of either Ruby core team, or Rails.) We had our reasons though, to be sure.

The one I remember in particular was a bit that converted your CSV rows and columns and then turned them into arrays of hashes, or converted arrays of hashes into CSV, and then another piece that expected the hashes to be identically ordered. If you used all of the standard pieces, this worked great! I think it took multiple libraries to do this, actually, and some of them were not so standard.

But wait... hash keys are not ordered at all, and that's a property of hashes that is standard and well known. But in some cases the hashes do come back with their keys in a particular, consistent order, and in a perfect walled-garden use of the particular CSV library configuration that was expected by the people that wrote this crap, yeah everything worked.

Well, everything worked until you do get a CSV with an uneven number of columns in some of the rows.

Like I said, CSV was supposed to be a core competency for us. We would not have been successful if we just picked one CSV library and stuck with it. Or, that CSV library would have got a lot of free labor from us, I'm not really sure which. I'm not sure which is worse, either. I don't do that anymore though.

Re:Demand for Ruby on Rails is Still Huge by yebyen on Thursday June 21, 2018 @11:44AM (#17366175)
Hah, I thought I was describing two unconnected things, but it turns out 'smartercsv' (at least the prerelease from 4 days ago) is actually designed to solve the very problem that I had described having seven years ago with fastercsv:

> Ruby Gem for smarter importing of CSV Files as Array(s) of Hashes, with optional features for processing large files in parallel, embedded comments, unusual field- and record-separators, flexible mapping of CSV-headers to Hash-keys

Re:Demand for Ruby on Rails is Still Huge by jstarfish on Thursday June 21, 2018 @01:35AM (#17362399)
Some environments are designed for isolation/security to such an extent that you dont have internet access to external repos.
Re:Demand for Ruby on Rails is Still Huge by yebyen on Thursday June 21, 2018 @08:56AM (#17364625)
That is true! And it's also true that some environments require full code reviews of everything that isn't already certified.

Hypothetically speaking, I don't know how you get around the fact that Ruby has way more code in it than any of the gems you'll want to pull in, but ignoring that, what's easier... getting a new gem certified, or writing just the parts you need and putting them through the normal review process?

The answer is not going to be the same each time you ask it.

Re:Demand for Ruby on Rails is Still Huge by pmontra on Wednesday June 20, 2018 @12:49PM (#17357050)
I started using Rails probably at 1.0 and it didn't have any learning curve worth telling back then. However I've been doing web development since 1994, including some CGI programs in C (nightmare), CGI.pm (Perl), Struts (Java) and occasional PHP (real garbage back then, better now) so I knew what's in a web framework. I only have to learn the way it implements what any web application has to do. There aren't many surprises, some occasional disappointments when a framework overengineers something (my general feeling with Python and Django and of course with Java.)

Rails isn't very complex even now, especially if you separate the front end (a JS SPA) and the backend (an API Rails project). You can develop two different projects in two different repositories and forget all the asset pipeline. However you must know the frontend really well or the sum of the two projects is going to be much tougher than vanilla Rails views.

Re:Demand for Ruby on Rails is Still Huge by yebyen on Wednesday June 20, 2018 @06:43PM (#17360531)
> I started using Rails probably at 1.0

> I've been doing web development since 1994

> some CGI programs in C, CGI.pm (Perl), Struts (Java) and occasional PHP

I said junior developer, didn't I? :) and also mentioned that this was my first ("permanent") job (after college)?

Getting to know what's in a web framework, is exactly the learning curve I'm talking about. People complain about magic in Rails. I just wrote an ERB view "index.html.erb" and declared an empty method "index" in my controller. Add in a route definition, and now somehow they are all connected.

What is actually happening? Why does that even work?

If you've never used any web framework before, that's inscrutable magic. If you know what a correctly designed controller method looks like (it should maybe fetch some values, then render a view... and probably nothing else) then it's obvious. Getting over that hurdle is ... definitely not the kind of shit my first boss hired me to do. I'll say again, most of my assignments for the first year had nothing to do with "on a web page."

Re:Demand for Ruby on Rails is Still Huge by busterarm on Wednesday June 20, 2018 @09:45PM (#17361408)
The magic isn't really magic if you have a basic understanding of how Active Record works, which really just means you know SQL and what kinds of queries all of those named relationships and parameters generate. This is like the critical piece to groking Rails and we minted too many "Rails developers" who don't know this. The only missing piece then is how internet requests are routed. Basic knowledge of how HTTP and TCP/IP work.

My stance on this (and how I did it as a junior) is to have someone implement a toy implementation of Active Record's basic relationships using Ruby meta-programming and to implement a basic request-response server. This is part of the curriculum of some bootcamps even.

If your junior developer can't do this, they shouldn't be touching your production Rails application. Your immediate goal on hiring them is to train them to be able to do this.

Re:Demand for Ruby on Rails is Still Huge by yebyen on Wednesday June 20, 2018 @11:18PM (#17361832)
I read your first paragraph... but then I read the rest of what you said.

Having read the whole comment, I'd say that is spot on. I knew some SQL, but didn't start with Active Record. We used SQL client libraries to connect to our SQL database, which didn't have a Rails app built onto it until well into my second year.

I did all of that, except for the implementing ActiveRecord and the meta-programming. So I didn't really do any of that. We didn't have a production Rails app until it was clear that I was gaining proficiency, and I'd be sticking around long enough to get a handle on how to manage it. (I didn't write most of it. And we avoided metaprogramming pretty much at all costs.)

We had a production Microsoft Access app (no really, VBS in Access 2000), with a MySQL server on the backend, along with tons of perl, bash, and ruby to glue the important parts together. There was a Java app that handled the web side of things. I don't think I'll ever work in a place like that again! But it was the path I took, and now I work on pretty much exclusively Rails.

Re:Demand for Ruby on Rails is Still Huge by busterarm on Wednesday June 20, 2018 @11:51AM (#17356489)
Didn't I just point out that all but 3 of the ruby jobs did not mention Rails at all?

They may be using it, but they didn't mention it. As for Ruby work that I've done, infrastructure automation, ETL, systems programming and the occasional Jekyll or Sinatra project.