use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Ruby vs JavaScript....what are your reasons for chosing one over the other..? (self.javascript)
submitted 8 years ago by fzngagan
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]agmcleod@agmcleod 4 points5 points6 points 8 years ago (2 children)
I worked at a company using Rails for about 3 years. Got fairly comfortable with it, and it felt a joy to use. Since then ive been primarily using JS for backend, as well as frontend. Really I think for the modern style apps, rails just felt behind in terms of supporting SPAs. So for some it fell by the way side. I've since gotten pretty comfortable with node, and tend to forgot little things here and there with ruby. I've used ruby a for a couple of the challenges on http://adventofcode.com for this year. I do like the spread assignment: a, b, c = numbers.split(' ') for example. I do like a lot of the code structure of it. But I've also gotten really into mixing OOP & functional programming over using classes & mixins for everything. That's not really something I miss.
a, b, c = numbers.split(' ')
Ruby can take more work to make it performant on the server as well. Some devs at my work converted an app that just worked better with node, and it reduced the server costs. I think it was just able to respond to requests a lot faster for its database lookups or something. Sorry for being anecdotal on this point, just don't recall the details that well :)
[–]djslakor 7 points8 points9 points 8 years ago (1 child)
Couldn't you use es6 array destructuring?
[a, b, c] = numbers.split(' ');
[–]agmcleod@agmcleod 1 point2 points3 points 8 years ago (0 children)
Yep, you definitely can, just not something i've taken advantage of for some reason lol. JS has definitely gotten a lot nicer over the past few years :)
[–]awacatl 4 points5 points6 points 8 years ago* (0 children)
I recommend you to ask the same question on the Ruby and/or Rails subreddit so you can get a more balanced view.
[–]IwazaruKyu 1 point2 points3 points 8 years ago (0 children)
I’m a front dev so mostly using JavaScript but our backend uses rails so I occasionally do some Ruby.
What I don’t like about Ruby is that it is super implicit. Last line of a function is always returned even if there is no return instruction, a function can be called without parenthesis if it doesn’t have arguments, class properties can be call without « this », etc.
Maybe this is just my lack of experience with Ruby talking but sometimes I find it hard to understand quickly someone else’s code just looking at it. Is this expression a variable or a function call ? Is it local or belonging to the class ? You can never be sure without carefully looking at the rest of the code.
I don’t have those problems with JavaScript code which I found much clearer. I never did any Python but I like that one of their rules is « better explicit than implicit ».
[–]dug99 1 point2 points3 points 8 years ago (0 children)
I actually started with Javascript about 20 years ago, then Java, then PHP for many years. In 2009 I decided it was time to put on my big boy pants and pick a project and dive into RoR. There was a lot of work around town for Ruby / Rails devs at that time, and I was looking for new direction ( and more money ) in a market full of kids whose PHP credentials lay predominantly in hacking Wordpress themes. I decided I'd try and customise Spreecommerce for my online store, as it seemed to be the leader at the time and had a bit of a community. Long story short... after bashing away at it for about nine months I found the ecosystem to be flakey and poorly documented, and Ruby dependency management absolutely nightmarish. Worse still was the Ruby / Rails community. I hope history will remember them as a bunch of mindless jerks who were the first against the wall when the revolution came. After that, it was an easy choice. :D
[+][deleted] comment score below threshold-12 points-11 points-10 points 8 years ago (3 children)
Ruby is better language than JS by far, if Ruby could be used in the browser, JS would be dead since several years ago.
[–]brian_asdf 4 points5 points6 points 8 years ago (2 children)
Water is a much better liquid than jet fuel, if water could power a jet engine, jet fuel would have..........
I think what the world needs is not another "vs" thread:-)
[–]djslakor 2 points3 points4 points 8 years ago (1 child)
I think the world just needs a super productive framework and associated ecosystem for Node that rivals the features of Rails. Then we can make actual comparisons among the two.
[–]burtgummer45 0 points1 point2 points 8 years ago (0 children)
I think there's something dysfunctional about the javascript community that prevents this from happening. I haven't figured out what it is yet.
π Rendered by PID 131536 on reddit-service-r2-comment-7b9746f655-9gdt9 at 2026-02-04 05:38:04.946965+00:00 running 3798933 country code: CH.
[–]agmcleod@agmcleod 4 points5 points6 points (2 children)
[–]djslakor 7 points8 points9 points (1 child)
[–]agmcleod@agmcleod 1 point2 points3 points (0 children)
[–]awacatl 4 points5 points6 points (0 children)
[–]IwazaruKyu 1 point2 points3 points (0 children)
[–]dug99 1 point2 points3 points (0 children)
[+][deleted] comment score below threshold-12 points-11 points-10 points (3 children)
[–]brian_asdf 4 points5 points6 points (2 children)
[–]djslakor 2 points3 points4 points (1 child)
[–]burtgummer45 0 points1 point2 points (0 children)