Developers March 24, 2020

Ruby vs Javascript?

Jero Esguerra @jeroesguerra

I know this is a very noob question and the answer to this is "it depends on your goals."

However, I'm looking to build my own projects whether that be apps, websites, or random products. Ideally, starting at the beginning of 2021, if not earlier.

I have no experience in either language.

Ideally, I'd like to be able to build my projects as quickly as possible.

  1. 8

    Ruby + Rails. Battery included approach is better for indie devs in my opinion.

  2. 8

    Ruby is a lot easier to write, because it was designed to be human readable. There's no semicolons or syntax. It's very succinct and elegant. If I were doing it all over again, I would still learn Ruby on Rails first, then if your projects requirements really need JS, then use that.

    1. 1

      Ahh I see, that would make sense. So would you jump straight into rails before learning ruby first?

      1. 1

        Definitely learn ruby first.

      2. 1

        You'll learn them both at the same time.

    2. 1

      In javascript--newer ecmascript spec--Semi-colons are optional

  3. 5

    If it's about learning how to become a good developer, it doesn't matter with which language you start with.
    If it's just about building something usable as fast as possible, I'd go with rails because it has everything you need already built in. No js backend framework comes even close to the features rails provides out of the box.

    1. 1

      I’ve come to the same conclusion! I kind of think this may be a gap filled in the nodejs world at some point.

      There’s a bias toward front-end SPA frameworks in the Node world, which I think has meant full stack frameworks get less attention.

  4. 4

    Yes, I think this depends very much on who you ask. :)
    I am working on projects with in both languages, but I am more familiar with Ruby.

    personally I think Ruby (and Ruby on Rails for web apps) is much easier and faster. To me it seems the ecosystem has more defined best practices and which makes it easier to get started. Also you can rely on loads of existing libraries which make it easy to get the job done.

    JavaScript has the advantage that you can use the same language that you learn also the client side.
    in the end it depends a bit on what you try to achieve.

    1. 1

      By faster, do you mean faster to learn? or faster to build out a project?

      I guess a couple of projects that I had in mind were creating a project tracker that can be sent to clients for my marketing agency. I'm also thinking of creating a web scraper for finding how many times a brand is featured somewhere.

      1. 2

        Faster to learn but also faster to build. - Especially for "default" webapps.
        I think the tour give a nice impression: https://rubyonrails.org/
        and the https://www.railstutorial.org/book is a good book to get started

        1. 1

          Thanks for resources! I'm definitely going to take a look.

          It looks like the common sentiment in this thread is RoR.

          Would you recommend just jumping into that before Ruby?

          1. 1

            I personally like learning on actual projects. Which I find much more motivation than to do some tutorials.
            So I'd recommend to jump right into whatever is closest to build your app and quickly start building.
            You learn ruby on the way while using ruby on rails and other libraries.

  5. 3

    I would say JavaScript to start and then expand to Ruby if you are still interested.

    If you plan to build websites you're going to need to learn javascript anyway.

    So it's either

    javascript in the browser and server
    or
    javascript in the browser and ruby in the server

    Currently there's a huge momentum on JS which brings a lot of libraries and resources which is another benefit.

    1. 3

      “If you plan to build websites you're going to need to learn javascript anyway.“

      This isn’t true at all.

      1. 2

        Can you elaborate?

        I cannot think of any usable website that doesn't use javascript, but, an example showing otherwise would be appreciated.

        Are you talking about no-code solutions?
        Transpilers?
        Something else?

        I think OP (and myself for sure) would like to know more about how this isn't true at all.

        1. 1

          You don't need to learn javascript. I maintain that.

          I've built several large web apps and my javascript SHIT. You can more than get by with the stuff that comes with bootstrap. For a lot if things when you use a framework like that, you're using javascript without even knowing that's what's happening.

          I'm not saying web apps don't use javascript, I'm saying that to build large, complex web apps you don't need to learn it.

      2. 2

        He meant if you planning to develop client-side programming you surely need javascript.

        Whether someone learn Ruby or other language on server, Javascript is a must for any kind of web applications.

        1. 1

          I think there's confusion between two things

          1. web apps USE javascript
            and
          2. the requirement for a web developer to LEARN javascript.

          As I said above. My javascript skills are beyond shit. I've never learned it - but I manage to build and deploy large, complex web apps all the same.

  6. 2

    I'd start with Ruby because it's considerably easier and more beginner-friendly. It's also what Rails—arguably the most startup/indie friendly web framework ever—is built on.

    You'll still need to learn JavaScript and likely other languages in the future, too! That's okay. Your background in one will help accelerate your path when you learn the next. The same is true of human languages. In my past career related to language teaching, I saw that English speakers who had learned a European language first do much better than those who start with a harder, more alien language.

    1. 3

      ˆI second the above suggestion.

      The Javascript ecosystem looks deceivingly simple, but the devil is in the detail. It's super fast to prototype an app from create-react-app or from cut-n-paste Node + express examples. By the time you wire all the pieces together coupled with authentication + database, Ruby developers already launch v2 of their apps :D

      It's taking me 4 full working days to build this simple full stack demo, recipe sharing app with React + Express + Auth0 + Sqlite (I wasted a lot of time dealing with auth0)

    2. 2

      Yeah, you make a good point. Once I learn one, it shouldn't be as hard when learning another language.

      arguably the most startup/indie friendly web framework ever

      This definitely makes Ruby more enticing now haha

  7. 2

    I'd take a hard look at Ruby on Rails paired with Heroku for deployment. It's still the framework I reach for when starting most new projects.

    1. 2

      :+1: my favorit stack to be super productive.

    2. 1

      Checkout Hatchbox instead of Heroku.

    3. 1

      Oh okay, it looks like this is a pretty common route to go. Would you say the learning path would be: Ruby > Rails > Heroku?

      1. 1

        Do you have any prior programming experience?

        In general I think focusing on learning the underlying language is a waste of time. I’d jump right into Rails rather than spending time on focusing on Ruby.

        Doing it that way limits your needed learning to “things I need to understand / debug about ruby for this particular project” rather than learning ruby generically. For me, diving in to a topic generally, rather than have it be project based, is a quick way to kill my personal motivation for the project.

        1. 1

          Not really. Like a few lessons in js and Wordpress PHP. But that does make sense.

          Doing it that way limits your needed learning to “things I need to understand / debug about ruby for this particular project” rather than learning ruby generically. For me, diving in to a topic generally, rather than have it be project based, is a quick way to kill my personal motivation for the project.

          This probably explains why I wasn't able to stick to one language...

  8. 1

    It's not a Noob question, it's a question even seasoned developers ask every now and then.

    The question is "What do you want to build?" , because when you want to hammer in a nail, you choose a hammer, but when you want to bake a cake, choosing a hammer is slightly odd :D

    1. 1

      Haha love the reference!

      But one of the projects that we're looking to build requires:

      • Reservations
      • Geolocation
      • Form submissions
      • User accounts
      • Process payments
      • Search functionality based on location, type, and date

      These are pretty much the main things we'd need for an MVP.

      1. 1

        Another personal project would be a project tracker that I can share with clients.

        Pretty much tracking campaigns and progress.

        And another personal project would be a task management software for myself where you have a 'master list of tasks' or a bank with all the tasks that you need to do and it allows you to drag and drop which ones you need to work on today.

  9. 1

    For quick and faster deployment RoR,

    1. 1

      Would you say it's best to just jump straight into RoR before even learning Ruby?

      1. 1

        I would recommend learning a little Ruby first, but really this does not need to be anything more than a quick crash course. If you have 30 minutes, try https://try.ruby-lang.org/ and then maybe find more free info online if you're still hungry for more. Even the most basic knowledge will suffice when beginning to learn Rails.

  10. 1

    I’m an experience JS dev and have come around to asking a similar question. There’s a lot of good discussion on my posting a week or two back: https://www.indiehackers.com/post/unpopular-opinion-node-js-insert-spa-framework-is-the-wrong-choice-for-my-next-indie-hacker-project-a7c16fd319

    Otherwise, I’d echo the sentiments of others on the thread that if you’re looking to build projects on your own, go with Ruby on Rails. It’s built for that.

    If you want to broaden your considerations, consider PHP and Laravel. You can get pretty far with the bare framework, or layer in some of the paid products like Laravel Forge for deployments or Laravel Spark for a SaaS scaffolding.

    In the JavaScript community, AdonisJS is a probably the closest thing to Rails or Laravel. It’s worth a look if you want something that’s batteries included and know JS. It feels a lot like a Laravel port to be honest.

    1. 1

      Interesting thread you have going on there.

      To me, it seems like there's a pretty even sentiment saying working with node is just fine and others are agreeing with you.

      However, maybe it's because you're in a different situation since you already know node and I'm noob haha

      But nonetheless, it's interesting to see how there are numerous ways to accomplish a project.

      If you were to start over, would you still start with JS or go straight into RoR instead?

      1. 1

        I think if your just planning on doing indie hacking on some web based projects, RoR is a great place to start. There’s also lots of jobs out there for RoR devs too, so not a bad thing I’d you want to do corporate stuff later.

        Nodejs is great; I use it every day. But I guess I wouldn’t suggest starting their for an Indiehacker project.

  11. 1

    I strongly encourage you to use Ruby on Rails and deploy to Heroku. If you need to manage client-side logic, please take a look at Stimulus, which is by the same team as Rails.

    rails new myproject --webpack=stimulus

    https://stimulusjs.org/

  12. 1

    "It depends on your goals!"

    I'd say start much sooner than 2021, as soon as you can, even just on something simple. For game developers, they say that your first game shouldn't be that Great Big Game that you're carrying around, it should be a Tetris clone. Tetris is small enough to be approachable by someone new, and you'll learn so, so much just from writing and shipping a Tetris clone, and that will make your real big idea so much more likely to be successful.

    So you may as well start ASAP and create a note-taking app that you're not planning on really doing anything with. What you learn during the process will be so much more valuable than the actual app you have at the end of it.

    As far as languages, I'd generally lean towards Javascript, since if you're targeting the browser, you'll need to learn it anyway. That way, any business logic code you write can be used for both the client and the server, so long as you're just a little careful.

    I'm actually building a SaaS starter kit for people in roughly your position. The idea being, it provides user creation/authentication/managment, an admin panel, subscription management, etc. so that you can install it and immediately start writing business code. It's still under heavy development, but when you do decide to get started, let me know!

    1. 1

      Ahh I guess I mentioned 2021 since I'm probably going to spend months learning either one of these languages (or both... depending on how fast I can pick one language up). And 2021 was when I planned on going full indie.

      But that does make sense to start building out small apps ASAP.

      I guess a couple of projects that I had in mind were creating a project tracker that can be sent to clients for my marketing agency. I'm also thinking of creating a web scraper for finding how many times a brand is featured somewhere.

      And all the other ideas that pop into my head. haha

      But to tie it all together, I'm probably going to start building small projects ASAP as you mentioned

  13. 1

    Hi Jero , i've been teaching myself web-development over the past 2 months , and that includes html, css , python and Javascript . I'd love to give you an insight on the learning process, send me an email to discuss further.
    To keep it short a simple because the information is quite overwhelming , literally either ruby with heroku platform deployment or javascript with heroku doesn't really matter.
    What you need to know is that both of these languages can help you create these products, just in a different process. You can create identical products*(to an extent) with both javascript and ruby and you wouldn't be able to tell the difference* .
    Both languages are a 'tool' , and no matter the tool you choose , it will allow you to create the product you desire as long as you learn how to use it to it's full potential. That being said , as i am learning javascript there is a very steep learning curve which can be overwhelming and tough to digest , but surely once you get the hang of it it pays of.

    1. 1

      I'm definitely up for discussion. What's your email?

      1. 1

        This comment was deleted 6 months ago.

  14. 0

    NodeJS + ReactJS full stack and you are ready to go

    1. 1

      Given the posters goals, I’d respectfully disagree here. I’ve found that Nodejs is quite simple, and React isn’t too bad either. But tying everything together and maintaining the whole stack gets really cumbersome. And you don’t get a lot things for free like you do with stuff like Rails.

      More about my thinking on this thread: https://www.indiehackers.com/post/unpopular-opinion-node-js-insert-spa-framework-is-the-wrong-choice-for-my-next-indie-hacker-project-a7c16fd319