Developers March 27, 2020

Best Languages for a scalable startup?

Jacob Olenick @jacobolenick

We are about to start the technical side of our startup and were wondering what would be the best languages to build the startup on that we would be able to scale with. We were thinking Javavscript and Node.js.

  1. 17

    If you listen to interviews of successful founders, the tech stack/programming languages is usually non-issue. The takeaway I got from those interviews - founders use the technology they are most familiar with (sometimes old school and boring) to get their MVPs running fast so they can spend more time talking to customers.

    Good discussion here: https://www.indiehackers.com/post/ruby-vs-javascript-82d2233897

    1. 4

      I double that. It doesn't matter. Facebook was built with PHP, GitHub and Basecamp are built in Ruby. Modern banks like Monzo are built in Go.

      Want to use truly scalable language? Go for Elixir. But if you're not familiar with that, you'll waste 1 year becoming proficient in that (not just learning the syntax, but also the libraries, the patterns, tools, etc).

      In the end, it's not the language that is the bottleneck, it's developers' experience, patterns they use is what matters.

      Stop chasing the latest and supposedly greatest new technology that a startup X or developer Y is using now. Create a working business using the stack you're most familiar with, and if/when things start bringing in profit and you actually see the bottleneck in some of the earlier choices you've made, invest into re-writing or upgrading your stack.

      1. 2

        Ah yes!!! I don't see enough praise for Elixir. I started learning and did a project for a client in one single month. I wasn't proud of it, but I got it done (part of the problem was communication with client anyway). Now I'm just loving it and can't look back.

        I don't disagree with "just choose comfy". I was a long-time believer in that. In fact, all of my prototypes were made in Node.js since I was familiar. In most cases however I ended up wasting more time on the end-phase of the MVP just to get it out - because the language was in my way. I don't mean JS is bad per se. It's more like - JS let's me write bad code and productivity falls exponentially.

        So anyway. I am so glad I'm also prototyping in Elixir now since this prototype can easily be continued into the new project. Many times I've had to rewrite whole projects because of my "spit it out" mentality.

      2. 1

        Go for Elixir. But if you're not familiar with that, you'll waste 1 year becoming proficient in that (not just learning the syntax, but also the libraries, the patterns, tools, etc).

        Three years ago, I re-wrote the infrastructure for my entire startup from Rails into Elixir in about two months, as I was learning. I didn't have the advantage of my 150+ tutorials I've since created, either!

        The really nice thing about Elixir and Phoenix is that you don't have to understand all or even most of the language to become productive with it. Many great web apps and APIs have been written in Elixir by people who haven't learned much of anything about Elixir protocols, macros or OTP. Phoenix and other libraries make use of them, but you don't have to dig into those parts for a long time as a user.

        This is in contrast to a language like Rust, where you really do kinda need to understand all the basic pieces to get productive (and I'm not there yet).

    2. 1

      The thread you posted is actually my co-founder. We were debating on building it in Ruby or Javascript. We saw that a ton of companies started off with Ruby because you can build it fast.

  2. 6

    Hey there, are neither of you technical? There is no such thing as a "best language", just like there is no "best car". You need to know what you care about in a language to decide. Will you have a lot of users? Do they need real-time responses (like chat)? How important is loading speed vs how easy it is to write the code?

    Happy to help you come to a conclusion, but you definitely need to at least talk about your idea a bit so I can help you :)

  3. 2

    Has been said repeatedly, use the technology you're more familiar with and start doing.

    If you plan to hire, I would suggest to use that where there are more programmers available rather than niche technologies. It's easier to find new team members and they can easily understand the existing code base.

    Bear in mind technology will change, so anything you start with right now will change in 5 years.

    Languages are languages, and you can write good and bad code in any of them.

    1. 1

      This is a great insight.
      Framing hiring and training as a bottleneck is very undervalued.

      The hottest tech can't help you if you can't hire enough talent.

  4. 2

    Personally, I prefer Javascript with Hasura as the backend.

    For years I used Ruby on Rails as the backend but I found that I spent more than half my time writing simple CRUD interfaces. Over and over again... I think that's literally the definition of insanity.

    A few months back I found Hasura and my life was changed. Now I spend most of my time focusing on the user. The only backend code that I write is serverless functions for the tricky bits.

    I truly believe that the days of writing bespoke backend services is coming to a close.

  5. 2

    Don't think about scalable language, but about building a scalable architecture. You can build a scalable system in any mainstream programming language (some will just take more RAM etc.), but choose your architecture carefully.

    1. 1

      Recently started with Vue.js , it is quite nice.
      As backend I use Laravel which still is awesome (acts as an API for Vue.js)
      Though not easy if you just start.

    2. 1

      But that's for the front end - for the back end, if you need an MVP, take Django or Flask and look no further.

  6. 1

    You're wasting your time by asking this question because:

    1. There is no such thing as a best language.
    2. Let's say three people on this forum say the following to you:

    Person A - An MIT Computer Science grad tells you "Choose X man, it's the best!"

    Person B - A guy who works as a technical architect and IT project manager for NASA and has a CS degree from Stanford says "No way, Choose Y, the first guy is out of his mind. He's smart but he doesn't have enough business/work experience to be recommending anything...blind leading blind. Go with Y."

    Person C - A guy who never went to college and is not technical says "No no no, go with Z. Trust me because I have started and sold 4 startups by myself and now have $40m in the bank. For a startup, IT decisions are strategic business decisions and I'm the only guy here with a proven track record of success doing exactly what you're trying to do now. Go with Z."

    Which advice are you going to take? MIT... or Stanford/NASA... or proven serial founder millionaire and has Zuck, Musk, and Gates personal numbers on speed dial but doesn't know the difference between JS and Java. But obviously knows how to make the right decisions.

    If you're planning to learn to code to build your own platform, how can you be confident in betting the farm on the recommendation of a person with no skin in the game?

    So let me ask you.....After receiving tons of responses from all these people, was it helpful in being able to select the "best language?" If so, which language did you decide on?

  7. 1

    What about giving some background about the startup you have, at least in what domain it is. Maybe for some domains, some stack of languages provide better scalability.

  8. 1

    Hi Jacob,

    I'd like to throw Kotlin into the mix for backend development! It's also heavily used in Android development. In terms of scaling your engineering team, I feel it gives you 80% of the power of Scala with 20% of the effort in terms of the learning curve for new devs. Any competent Java dev can be up and running writing idiomatic Kotlin code in less than two days in my experience. It also has excellent tooling (it is built by JetBrains after all, the makers of the IntelliJ IDE).

    But I also agree with the other comments; if you're not experienced with the JVM/more experienced with other languages/runtimes, then I'd go with them.

    I just wanted to give you another option to consider.

    Good luck with your startup!

  9. 1

    We need to know more about your startup to answer that questions.
    Some tech are not great in some cases. Is it a MVP you need to build ?

    Overall always find a tech that is widely use and so you will not struggle finding developers to hire. Thats a huge paint point.

    Also depending on you project I would suggest you to go for server-less infrastructure. Better if you can start without have do a line of code that also great. But that depends on what is the current stage of you product.

  10. 1

    Node's not the "best" for scalability, but Uber used it and didn't need to scale horizontally until New Year's 2013. That was as an already gigantic company and running on 2012 hardware with no AWS. They had an entire engineering team at that time and were experimenting with both other languages and algorithms.

    Are your needs going to scale faster than Uber did?

    My guess is no, and that you'd be best served by focusing on whatever gets you customers first and worrying about scaling later. If it's ever a problem, you'll have money to solve it.

    1. 0

      Saying "Node's not the 'best' for scalability" doesn't mean much. Usually when you have scaling problems, the language isn't at fault. It's what you're doing with the language. You gotta profile and find the bottleneck.

      Usually the #1 culprit is database since that is the central store of state. You can alleviate it by using distributing the load e.g having more read replicas, or partitioning so you slice the database tables based on some keys. Remember facebook scaled MySQL for a long time with shards.

      If the app is the bottleneck, usually it shouldn't hold any persistent state. If it's not stateful, create more replicas and shove a load balancer in-front that routes to different replicas. Kubernetes and docker makes this easy.

      Shove frontend static assets on CDN.

      If you've got a scaling problem and customers are ready to throw money at you, that's a good problem, it can be easily fixed in the modern days of cloud. If you've got a product-market fit problem, then that's going to take a lot of pain and if you don't fix it soon, you'll run out of money and have to close shop.

      1. 1

        Then why does Google, Facebook, Tencent and every other company with truly massive scale write core infrastructure in C/C++ and other bare metal languages? Why did Dropbox re-write their infra in Rust?

        Of course algorithmic failures can overwhelm even the most efficient language, but pretending that every language is equally suitable for writing high-performance code is naive.

        1. 0

          You gotta profile and find the bottleneck.

          That's what these companies did. Found what was performance sensitive and optimized it.

          Usually when you have scaling problems, the language isn't at fault.

          Usually. Profile + optimize. You can still write god awful slow code in C++ with the wrong algorithms and data-structures. Remember wikipedia still runs on PHP. A language that gets a lot of hate for being slow and laggy. Basecamp runs on Ruby, another language that gets perf hate. They're all doing fine.

          You can waste eons of time doing pre-mature optimization. Languages come with pros and cons, some suited well for some tasks and not others. Choose something that lets you be productive in the long term.

          1. 1

            Sure, I agree with all of that, but are you disputing that there are any differences in performance between low-level and high-level languages?

            Or are you claiming that JS is the most performant or scalable language?

            Both of these issues have been empirically settled. I'm not sure why you've taken so much exception with the claim that Node isn't "the best" for scalability or my comment suggesting a focus on productivity over scalability concerns in the short term.

            1. 1

              Or are you claiming that JS is the most performant or scalable language?

              Absolutely not claiming this.

              I guess I was just debating the fallacious logic, "'best' is relative, if X isn't the best, it doesn't mean it's not good enough. Sometimes good enough is what you need because other factors are more important"

              I'm glad we're on the same page.

  11. 1

    JavaScript is a valid choice for both front and back end. Tooling is excellent in 2020 and high quality resources are easily available, plus it's a very good ecosystem. Having one language and for someone coming from an UX design background such as yourself, it will help you start faster because you will have to learn only one language. (But beware! Front end and back end are very very very different pieces of code in reality!)

    The next choice lies in frameworks/libraries/philosophies and is not an easy one. I would recommend you to try Vue.js for the front end, even though I would choose React (personal preference).

    As for the back end I recommend you find some open source projects and choose the one that feels the easier to understand for you and start working from there.

    That is if you start from scratch without prior knowledge of course, otherwise, stick to what you know as said above ;)

  12. 0

    I would say choose the technology you're most familiar with.

    I would highly recommend Typescript everywhere though. This is what I am using for https://boomadmin.com and these are my learnings.

    1. Code re-use: I am a huge fan of Typescript. Mostly because it makes javascript very tolerable. Javascript works in both browser and server with nodejs. This means I can re-use a bunch of things like validation logic, utils and types.

    2. Server in TS: I fully type my api requests and responses. So whatever nodejs responds with, I know I can safely consume in front-end, since they are working with same types and Typescript can enforce this. It makes writing frontends and backends a joy.

    3. HTML in TS (TSX): I've been burnt by Angular since the templates are strings. I am a huge fan of JSX (TSX is the typescript flavor). This means my ui components are fully typed and I get great code completion. I am using preact which is a fast lightweight react. Very responsive app in a couple of kilobytes. Preact can do serverside rendering so I can output the UI shell as a .html file.

    4. CSS in TS (jss.ts): I've used less/sass/stylus and it's been a pain, because I don't know where the classes are used, it's not modular and sometimes you have class name conflicts. With the library css-in-js + csstype, I get excellent code completion for css. VSCode makes hovering on variables immediately show their definition from jsx. e.g style.bigButton shows me what it's made of. I can jump to definition and also find references. JSS and JSX are tightly bound. Refactoring a class name automatically changes everywhere its used. webpack compiles to a good ol' css file and I get all the benefits of css. Lastly css-in-js generates a unique suffix for each class name so I am guaranteed that there'll be no class name collisions and the css is very flat (this is also very fast for browser since there is no deep class name nesting)

    Overall I absolute love it. One language, excellent code completion, type-checking, refactoring, and modularity. This means my code can scale to complexity well. With eslint and prettier, code is autoformatted on save and simple issues are auto-fixed. Webpack minifies, prefixes assets with md5 hash. Github actions shoves frontend assets in cdn with long term caching headers + gzip compression. Another action builds the docker containers if needed and deploys it to Digital Ocean kubernetes.

    In terms of server scalability, it's just good ol cloud MySQL + CDN for frontend + Kubernetes on Digital Ocean. You can go pretty far with this setup and scale up as needed.

    Digital Ocean is simple, fast and affordable. I highly recommend it.

    1. 1

      how about SSL? I hate using letsencrypt.

      1. 1

        Why do you hate letsencrypt? If you’re just starting out, let cloudflare handle the ssl/https part. Sure between cloudflare and your site, it won’t be encrypted, but what the customer sees will be encrypted. Cloudflare also offers a free cdn so that makes life quite easy.

        1. 1

          I host my frontend/backend app at ubuntu, through reverse proxy, so I have to use letsencrypt

  13. 0

    If you really want to scale, go with Go or Java, if it's just MVP - go with Django.

  14. 0

    No, JavaScript is a bad choice - it has multiple vulnerabilities and is not type-safe. Python, Go, Java. I'd go with Django or Flask as a default choice.

    1. 1

      Could you explain what you mean (multiple vulnerabilities)? Right now javascript has to highest adoption rate of among professional developers. So it seems like most professional developers would disagree with you.

      https://insights.stackoverflow.com/survey/2019#technology

      Also, to the original question. Do whatever you're most comfortable with.

      1. 0

        No, those are not professional developers. Those are self-taught folks that failed learning real programming languages. JS is not the real technology taught in universities. It's a Front End tool that is not meant to be used on server. You'll end up with abandoned codebase that you'll have to dispose and nobody will be able to maintain. Forget about JS - it's the worst choice you can ever make. JavaScript belongs in the browser, and nowhere else. Debugging JavaScript is a pure nightmare and it fails silently. Remember, it's a sure road to failure to use JaveScript on the server. Cutting corners is not substitute to real development. Those whom you call real developers are not real developers - those are con artists. JavaScript does not scale well, it fails silently, it's single-threaded, it's not type-safe and it was not meant to be used anywhere besides in the browser, on the front end, and nowhere else. There are many fake developers that use it as first choice, but most of them are con artists and they fail miserably long term. Stay away from JS on the server. Remember my word - going with JS on the server is a sure recipe to failure.

        1. 2

          Hahaha! wtf

          Forget about JS - it's the worst choice you can ever make. JavaScript belongs in the browser, and nowhere else. Debugging JavaScript is a pure nightmare and it fails silently.

          Dude, Javascript has one of the best tooling available with Typescript, VSCode, Chrome DevTools debugger + profiler, npm, webpack e.t.c.

          JavaScript does not scale well, it fails silently, it's single-threaded.

          Lol! Not sure if you want to start a flamewar or you're serious. Single threaded is good. Because js/nodejs runs in an event loop, it is non io blocking and is very efficient at using the single thread. You can easily scale it to use full server capacity by using pm2. A million requests/sec with nodejs on a single server is very doable. Trello.com was one of the first nodejs apps and it runs circles around Atlassian Jira written in Java until Atlassian acquired it.

          You can't blame everything at language. Usually the algorithms & datastructures are the culprit. Some are suited well for some tasks, others aren't. Javascript has evolved a lot in the last few years and is very suited for web development.

          Choose whatever works for you. As someone said, there is no "best car".

          1. 0

            JavaScript's rise among fake developers from bootcamps is explained by the fact that they just were unable to learn real CS, algorithms, data structures, that's just scam that tries to survive. You can't become a developer just because you want to. It requires some brain and critical thinking most don't have, and there's nothing you can do about it. JavaScript has not evolved - I've seen JS used in windows applications. It's awful. Most resort to JavaScript because any other language is too hard for them and they don't have brain to learn the real languages. Period.

        2. 2

          I can't tell if you're being serious or not. But I 100% disagree with you and think there's thousands of real "professional developers" who would as well.

          1. 1

            They are all fake. This market is full of scam and everybody claims to be real, as a lot of money involved. I studied C++ and C in university. worked as Java developer for 10 years and another 10 as Python developer. Those scammers that use JavaScript - those are recent phenomena, bootcamp boys that can't code, and are not real developers. You don't come out of university as JS developer. Those are fraud. My stackoverflow rating is above 2500 on answers only, and for a reason.
            "There are many developers" - the key word is "many", absolutely right. For some reason you have a cognitive bias telling you the majority is always right. No. Many times the majority is a fraud and is wrong. That's how you get inquisition, dictatorships and ugly kleptocracies. There's a lot of scam, that's why the majority fails. To be successful you need to use real technologies, not their substitute.
            And real means C, C++, Java, Go, Scala, Python, but not JavaScript, sorry to disappoint. Take some university courses and stop saying JavaScript is the real programming language.
            Greedy pays twice. I understand you want it cheap, but it doesn't work like this.
            You have a lot of so called JS developers not because it's popular, but because that's the ONLY thing they were able to learn. All the rest requires brain.
            By obeying majority you confuse quantity with quality. There's a price to pay when you do what others do just because they are many.

            1. 4

              you come across like someone who is mad because their Haifa CS degree from 1999 is not as valuable as you think it should be , you are inflexible and cant adapt to the shifts in the tech world so instead of learning new tech and styles outside of your wheelhouse you try to denigrate and insult the tech you are bad at implementing or afraid of, a bad craftsmen blames tools and a good one accepts even the unconventional ones(like JS)

              1. 0

                I understand, being a bootcamp scam is kind of stigma. Deal with it.
                Mine is valuable. I use Django, Flask, Go, Java and it pays great. JS on the server, I repeat on the server side, is only used by those who FAILED learning real programming languages. To me it takes 1 hour to fully orchestrate Ubuntu VM with nginx, uwsgi and Django, so deal with it and continue being envious. With my C.S degree I'm top 10% in Python on stackoverflow. Google "False consensus bias" to get a better idea of the phenomena you're a part of. It's like being atheist in the sea of religious zealots. Sane minds are few.

            2. 1

              How do you know Javascript is not a "real" programming language. Personal experience? Like did you spent 5 years programming in it and got nowhere. Or you came to that conclusion by pure mental analysis?

              What does your 2.5k StackOverflow rating represents here or has to do with any of this?

              1. -1

                This comment has been voted down. Click to show.

                1. 2

                  Hm I see, so you're basing your dislike on something that happened 27 years ago. Got it.

                  There have been a lot of changes since then. Google did wonders on that regard.

                  Anyway, just wanted to know more about why you don't like it.

                  Btw. I wouldn't be around bragging about 2.6k rep. Doesn't even give you editor's rights in SO.

                  And I don't know how do you get you're top 10% in python if you don't even have a bronze tag on it (you only have 75 pts, you need at least 100 pts)

                  And StackOverflow reputation is not an indication of anything but of time you spent on stackoverflow (I know that I have 175k and I'm top 0.06%)

                  But I was not asking to pick up a fight or anything. I apologize if any of this seems confrontational. I was just interested in why you thought javascript was bad choice and everyone in SO are "self-taught folks that failed learning real programming languages" and now I clearly understand why.

                  1. 1

                    Try getting 2600 on answers only and then tell me how was it.
                    Why I don't like it? Because I know cognitive psychology well and I know how those cheap choices originate as negative consensus biases. JavaScript came from the point where too many not particularly smart and not particularly capable were trying to become developers - understandable, pays well, but were unable to go to universities, learn data structures and algorithms, learn operating systems, learn math. So they picked up the least restrictive choice and the easiest for them to pick - a framework for browsers that is full of memory management issues, threading issues, zero testability - and made it a legitimate language, despite it's being unfit to be used as such. They needed money and were unable to learn Python, Java, Go. You can't become a developer just because you want to. You need brain, and not everyone has brain. It's not bad at all to be critically thinking atheist in the sea of religious zealots locked deep in their biases and unfounded beliefs. Sane brains are few. Remember, majority is NOT ALWAYS right.
                    JavaScript was created by NetScape for browsers, and it belongs in the browser.

  15. 1

    This comment was deleted 3 months ago.

  16. 0

    This comment was deleted a month ago.

Recommended Posts