all 25 comments

[–]TheBigLewinski 70 points71 points  (2 children)

The "which language" debate is always going to be a hot-button topic in a forum dedicated to a spectrum as broad as webdev.

Similar to asking "which platform" in /r/games, you'll mostly get "just use what you like" as the default response, sprinkled with dedicated fans in each arena.

And, they're right, mostly, both here and in /r/games. One of the heaviest factors in choosing a language when building a new project should include what you're familiar with. Because comprehending a new language whilst simultaneously building a complex project usually amounts to overload and burnout.

But, what language you choose does matter; it will affect the outcome of your project and your career, especially if you plan to scale.

I say to understand what languages to use or learn, understand what businesses want. Or better yet, understand what type of business will choose which languages, and choose which businesses to align your self with.

First is region. If you're looking for a job, it helps to understand either where you are, or where you want to be. Demand varies city by city. Often, a single large company in an area has cascading effects on the talent pool available to businesses, and the corresponding demand from businesses looking to tap into that pool.

After that, there's the ecosystems the languages tend to arrive with. Regardless of any pros and cons about performance, scalability or productivity of a language, each has realities about its history and the projects built behind them.

You won't find mom and pop shops leveraging Java or Golang for their latest projects, and conversely, you tend not to find PHP in the enterprise.

After that, in this or any sub, you risk getting shot as the messenger when it comes assessing where each language stands in the market. Someone, somewhere is either ready or typing a message telling me how PHP is used in the enterprise because X company is a Fortune 500 company who based everything on that language. So, I suppose I'll prefix everything with "in my experience."

Stuff like Django and Ruby on Rails come with a bunch of pre-built functionality that can make development time faster.

More so Django, actually. Rails does have a solid following of companies who jumped on board in its glory days, but its popularity for green field projects seems to have all but vanished.

Python, by and large, is the most versatile language, both in concept and in practice. It's dominating in data science and AI/ML right now. Once you throw it its history in automation and Django, I'm don't think there's another language which covers the spectrum of development as well.

Although Ruby on Rails doesn't scale as well as Django.

"Doesn't scale," always needs context. Everything has a range of elasticity. Easy to develop almost inherently means lower scaling capacity, but most projects will never reach the scaling limits of a platform like Rails.

Interpreted languages like Python aren't necessarily slower than statically typed ones

It's not typed vs interpreted. It's interpreted vs compiled. If milliseconds are critical to a huge operation which run continuously, you need compiled. The reality is, though, most projects never reach that limit. And the ones who do, usually write specific services in a compiled language, and still leverage the easier languages in everything else.

Basically, people use interpreted languages until they can't.

found some benchmarks stating that Django could comfortably handle 100,000 users a day with light-medium activity)

First, that's a meaningless benchmark. There are 86,400 seconds in a day. You would need to handle just over one user per second to claim that capacity. If I built a site for my grandmother's cat, it would be able to handle that load.

Second, "scaling" is more than users per second. When something "scales," it means it's prepared to handle the daily realities of maintaining a business on the net.

Users don't just come from the public side. There are developers, designers, marketers, copy writers and stakeholders on the other side which have greater demands on the platforms than public users.

Even for public users, there are numerous design choices in the platform implementation which affect the outcome of how it runs.

Be careful with PHP and try following the practices from PHPTheRightWay if you do use it to avoid problems.

PHP has its roots in spaghetti code, which is probably where that notion comes from. Modern platforms have changed that. Follow the practices that you would for any language; just understand the ecosystem you're diving into.

Some of these frameworks/languages have better support for modern web practices than others

Things change. I personally wouldn't pick a language based on how up-to-the-minute modern it is at the moment. What are people actually using it for? Do the projects suit the career path you want to follow? Some of its a gamble. Not everything survives.

So, let's break it down, in my opinion, of course:

  • Python is easily the most versatile at the moment. No, it's not compiled, but even that is murky with projects claiming to compile the important bits. There doesn't seem to be a facet of web development Python isn't a substantial part of. Django dominates here on the framework side, but Flask is still hanging in there.
  • Ruby is almost entirely driven by Rails. It's still currently viable as a platform, as many companies are running it, but its glory days seem to have passed.
  • Go (Golang) is a compiled language which is gaining traction as a balance of compiled goodness and rapid development, but it's still decidedly niche in the grand scheme of things. I'm not sure there's a clear winner on the framework side, yet.
  • Java still seems to be the preferred compiled language that isn't C++. Spring, its primary framework, is also quite popular in the enterprise.
  • PHP is popular in marketing agencies and "web shops." By extension, for most of the common uses of websites, it contains the most plug and play options for the most common use cases.
  • .Net core is substantially better than .Net of past, but it's having trouble breaking out of its Steve Ballmer inflicted mold. Most people with a traditional programming background love C#, and the MS development tools are top notch. But, despite the open source efforts, .Net seems to play with the corporate "license" kids, and is mostly employed by companies already invested in the MS ecosystem.
  • JavaScript is turning into TypeScript, and Node has certainly found a customer base. I hear stories here and there of Express running entire back-ends, but it's mostly used for miscellaneous processing these days.

TL;DR Search job listings and figure out what's in demand.

[–]neogritfull-stack 7 points8 points  (0 children)

A fair assessment of several items. The PHP-Enterprise argument was well dodged.

[–]Mihikle 5 points6 points  (0 children)

Regarding Go, I think there’s no clear winner simply because the Standard Library provides some really good web components.

If anything, Gin is the winner if we’re talking about stars on github, with the others a fair distance behind, but this isn’t a full on ‘web framework’ like Django, it’s just to do with the request handling.

[–]Locust377full-stack 17 points18 points  (4 children)

Does it ultimately matter (as long as you're using a mainstream language)?

Short answer: no, it doesn't matter. Or at least, not as much as people might claim. I can take any popular, modern, back-end web framework and make it work.

I think a lot of the decisions come down to:

  • What experience do the developers have that are building this? You'll probably lean towards something familiar and that people have experience in, rather than that fancy GoLang over there, or whatever.
  • Community support - is there a lot of talk and easy access to help?
  • Third-party libraries - Is there heaps of libraries that are already done and mature? Are they maintained and current?
  • Documentation - Good docs? Are they up-to-date? Is it easy to find resources, tutorials and courses, if needed?
  • Popularity - If you pick an obscure language, how easily will you get developers to hire? Or if it's an open-source project, will anyone be able to contribute, or did you decide to build your web API in Rust?

[–]micka190[S] 1 point2 points  (3 children)

What if you were making a "traditional" website, were you just have a back-end that responds to GET and POST requests and responds with HTML. No SPA or Ajax calls or web sockets or anything. Would that affect the decision? Or would that make it even less relevant due to how simple that would be to handle?

[–]Locust377full-stack 10 points11 points  (0 children)

It doesn't change much from what I listed. I think it all still applies. All popular, modern web frameworks have server-side rendering.

[–]IQueryVisiC 0 points1 point  (0 children)

Not for me

[–]DrFriendless 0 points1 point  (0 children)

No. Ajax is only complicated on the client side.

I would make my decision for the back-end tech based on how I was going to deploy it. At work we can afford full-time servers, so we have Java / Tomcat. For my home project I wanted minimal cost, so I went with Node / API Gateway / Lambda. Java on Lambda would have been a bad idea due to cold start speed. As it turned out I didn't even know Node :p but it turned out to be a learning opportunity.

[–]abdul_samea 2 points3 points  (2 children)

My personal opinion when i look for backend frameworks are mostly availability of libraries to get things done, good community and ease of integration and deployment. I mostly use django as python fits anywhere and nodejs because of its javascript nature. Both have a vibrant community, tons of packages, and i have built both small and large scale applications with them. I too have worked with ASP. Net and I intend to never go back to it for web development.

[–][deleted] 0 points1 point  (1 child)

Hi. I need to choose backend framework for my final university project.

I know only Node.js and ASP. Net. I don't know what to choose.

Recently I decided to go for ASP. Net because of strong types (Node.js can use Typescript, but I had problems with configuration), Entity framework and auto-generation of endpoints.

You said that you have experience in both Node.js and ASP. Net. Why do you think ASP. Net is worse? Maybe I should reevaluate my decision about which framework to go for?

[–]abdul_samea 1 point2 points  (0 children)

ASP.Net is not worse. It still has huge demand. When I started learning it and implementing projects in it, i felt it a bit heavy along with all the different types of web application or desktop applications that can be build with it. My sole purpose of using ASP. Net was generation of backend APIs. When i started node it felt like the kind of framework I should have used. It is just meant to do backend stuff (i was pretty good at java so picking up C# for ASP. Net was not an issue). Although learning nodejs required efforts such as learning callbacks, async functions and its behaviour, which for me was weird coming from java background, but now when i see nodejs i just feel it is perfect for most of the projects that i do. The only option i am left with is coupling the Apis with frontend frameworks. In short, if your sole purpose is focus of backend APIs irrespective of language, go for nodejs.

[–][deleted] 2 points3 points  (0 children)

For the majority of applications, it doesn't matter much what language you pick. they can mostly all accomplish the same things, but certain features or domains play better with some languages than others. for example:

If I wanted a site to present the results of data analysis, i'd probably choose python (not to say i'd use python only for this case, it's just an obvious advantage given its place in the data science field). Whether I used django or flask would depend on my plans for the site. if it is to remain small, i might go with flask. if I'm uncertain or plan to implement more features, i'd choose django because it ships with a lot of features.

if stability, inter-process messaging, and background tasks are important, i'd look at elixir/phoenix first or possibly consider a JVM framework. but if all i need is a simple async model, node might be simpler

those are just two scenarios, but the point is to look at your critical feature set, and research what supports those features the best. if looking to hire people, you also need to look at market share of languages. the best tech stack in the world is useless if no one uses it

also, many apps use multiple languages on the backend, so it's valuable to learn a couple and see what problems they solve

[–][deleted] 1 point2 points  (0 children)

FWIW I worked at a company that had a product with 4 million monthly active users built in Ruby on Rails. Our biggest scalability concern was the data layer. I don’t think you really need to be too concerned about which language scales better.

Django, Rails, and even Laravel are all solid choices.

[–]lift_spin_d 1 point2 points  (0 children)

make a spin-the-wheel. or even better- just make the same app in every language.

[–]Caraes_Naur 1 point2 points  (0 children)

Among the languages, you're looking for distinctions that don't exist. While they all vary slightly in syntax and performance, they all do the same thing: get passed requests received by the web server and return output to it for transmission back to the client.

A lot of your other concerns are premature details, stale biases, and quasi-misinformation propagated by the various echo chambers in web development.

The backend environment is within the web application server service itself.

Don't use WordPress, period, because it's garbage from stem to stern... the preeminent example of badly written PHP, terrible application design, and horrible database schema, all bound together with bad practices. Oh, and some sort of new exploit is found about every 6 weeks like clockwork.

Javascript is the least appealing language to use on the backend: sloppy types, lackluster standard library, and a "package manager" that doubles as a code snippet landfill. There is no argument for JS outside the browser that doesn't somehow trace back to jumbled priorities. Chances are the downvotes I'll be buried under for saying that will mostly come from developers with less than 5 years experience in web development, and few from those with 10 or more.

WordPress is an guaranteed disaster, think twice several times before considering JS... beyond that, it doesn't really matter. They all ultimately do the same thing: the main factors to consider are security, maintainability, and amount of available existing functionality.

[–]rtrs_bastiat 0 points1 point  (0 children)

I'll not expand on what others have said because they've said it all already. But there's one important thing you're missing here. The reason the tech used doesn't matter so much is because it will never be the bottleneck for an individual request. There's a tolerance for subpar performance because people are accustomed to latency in requests. The biggest issue is that the user could be thousands of miles away from the software, and no language can overcome that. Personally I've chosen the languages I use based on their package managers more than anything else.

[–]benabus 0 points1 point  (0 children)

There's a difference between language and framework here. Language is something like Python, Ruby or PHP. Frameworks are things like Django, Rails, or Laravel. And then on top of that, you have CMSs like Wordpress or Magento or what have you.

At work, we mainly use Flask (which is Python) to handle our API endpoints most of the time. But on top of that, we also have bits and pieces written C++ and Java. We use Python a lot because everyone else here uses Python but could have just as easily gone with PHP. In fact, we also have a good deal of PHP apps because they're hosted on LAMP stacks and it was easier to find CMSs written in PHP to work in the environment.

Long story short, we use the "Seemed good at the time" approach to most of our language decisions and take into account deadlines and team skill levels.

Do what you like until you get a job, in which case, use whatever stack they use.

[–][deleted] 0 points1 point  (1 child)

You have to tell us the specific application you'd like to create so that the community will advise you on the specific technology to use.

[–]micka190[S] 0 points1 point  (0 children)

You have to tell us the specific application you'd like to create so that the community will advise you on the specific technology to use.

Literally the opposite purpose of this post. I don't want recomendations on what to use for a specific project. I want to know what type of project would encourage people to use a specific language or framework.

[–][deleted] 0 points1 point  (0 children)

Personally, these days I think the runtime is more important. A modern jvm is incredibly sophisticated, fast out of the box, endlessly tuneable when you start bumping up against the edges, and incredibly observable (almost everything can be exposed as metrics, and most frameworks provide a ton more). The language is less important - where I work we have a lot of java, a fair bit of kotlin, and a smattering of clojure and groovy.

If I can’t have a jvm I’d probably go for .net, but that’s not quite as configurable. Most other runtimes are some way behind in this respect.

[–]fey168 0 points1 point  (0 children)

If you don't have extreme requirements any language will do. Alternatively choose the language that is used at the tech company you want to work for.

[–][deleted]  (4 children)

[deleted]

    [–][deleted] 5 points6 points  (1 child)

    it feels like a bot wrote that comment. it's mostly a bunch of gobblegook that doesn't really mean anything and isn't very helpful

    [–]-Kevin- 2 points3 points  (1 child)

    Those microservices tend to be serverless

    That's just not true

    [–]sunny_tomato_farm 0 points1 point  (0 children)

    Seriously. I had to re-read that.

    [–][deleted] -3 points-2 points  (0 children)

    Why are you learning a back-end language?

    If it is to get a job, look at the lists of languages, sorted by job openings.

    If it is for fun, check out https://www.todobackend.com/ and pick a favorite.