6 ms·
web development seems to be twice as popular as ML use. Anyone knows why? Given node.js is known to be much faster while still offering the dev speed of a scri
by bogdan314 6y ago
web development seems to be twice as popular as ML use. Anyone knows why?
Given node.js is known to be much faster while still offering the dev speed of a scripting language. I love python for algorithms and DevOps scripts but feel afraid of using for web as it might end up with huge cost for hosting (higher CPU power)
- pydry 6y agopython has a sane packaging ecosystem and type system. CPU power is cheap and developers are not.
- eru 6y agoTypeScript seems better (or at least on par) typing wise to Python. I don't think anyone is picking Python for it's type system. It's still a second class citizen at best.
- deleted 6y ago[deleted]
- nojito 6y agoCommon misconception. You have startups choosing a language while trying to absorb unsustainable operations costs to justify using the wrong language instead of picking the right language from the start.
- salex89 6y agoUntil 7 years down the line you have to round up a team of your most experienced engineers and add some to figure out how to scale the frecking' thing.
- jhayward 6y agoThis is an outcome most startups pray they are lucky enough to see.
- krzyk 6y agoJavascript & co is not the most popular among backend developers. I for example wouldn't even think about doing anything in it (or in Typescript). Look at https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages https://insights.stackoverflow.com/survey/2019#technology-_-... Python is not on the list of most dreaded languages, but Javascript is.
- ezzzzz 6y agoMention Python in a HN thread, and prepare for people to start moaning. IDK, maybe it's the SV filter bubble dealing with some mono-repo from google with a bajillion lines of legacy Python to support. Yeah, I can't imagine how unwieldy that might be. But for those of you that extol the virtues of the 'safety' a compiled language brings I say, try supporting a Java app that's been held together with shoe-strings and bubble-gum for 15+ years (in the enterprise world). Same nightmare, but much harder to re-architect.
- Pandabob 6y agoI'm no expert in the matter, but AFAIK, concurrency is becoming relevant in Python web dev. One can already use stuff like FastAPI [1] and Django is supposed to be getting async/await support later this year [2]. So that should make Python more competitive when compared to node. [1]: https://fastapi.tiangolo.com/ https://fastapi.tiangolo.com/ [2]: https://docs.djangoproject.com/en/dev/releases/3.1/ https://docs.djangoproject.com/en/dev/releases/3.1/
- GlennS 6y agoI think ML is a bit niche in terms of overall number of programmers doing it? Meanwhile, making websites has turned out to be very popular. I suspect the response rate there is actually skewed high by the large chunk of students. Regarding the CPU use and hosting cost, it's probably not an issue for most websites. Usually you end up database bottlenecked much sooner, and that doesn't kick in until you're on >100s of millions of rows.
- slightwinder 6y agoI'm more surprised that ML is so widely used. Still quite special area IMHO. > Given node.js is known to be much faster while still offering the dev speed of a scripting language. Is this so? I consider python as a language and ecosphere far above javascript and nodejs. And how well can nodejs be optimized with non-js-code? But regarding the numbers, likely it's because a python-shop wouldn't use nodejs and introduce an additional liability. Everyone usually chooses their prefered language and environment for a task as long as there is no significant advantage in using something different.
- black3r 6y agoI've started with Web Development in 2013. Back then Node.js was still in 0.x versions, Electron was basically non-existent and Django looked ten-times better than anything PHP was able to offer. I've dabbled with some PHP/Node/Java framework tutorials since then but haven't really had reason to fully switch. But if I started today I would probably try to find some framework to do everything in JS/TS.
- padthai 6y agoI started web dev in 2012 with a MEAN stack. Now I work with a LAMP stack. I deal with far less migrations and dead packages, but that's probably because Node.js was not very mature back then. The real question is why someone like me should pitch JavaScript to my Django/Flask shop instead of technology with clearer competitive advantages: Elixir/Rust/whatever. If I want better CPU usage I can get halfway there it with FastAPI and other Python frameworks.
- colinmorelli 6y agoIt's usually not the language itself that makes dev speed faster. Of all the time I spend building a reasonably sane Java app, the time I spend recompiling/restarting it is a small fraction. Rather, it's the programming models put in place by the initial framework choices and architectural decisions that will make the biggest difference. Prototyping a web app in Python isn't fast because Python as a language makes it fast. It's fast when you use Django to effectively wire a database model directly to a set of CRUD endpoints in less than a dozen lines of code, complete with validation. The same can be said about Ruby + Rails. Node could, in theory, provide a similar capability, but the platform was popularized after large sections of the developer community seemed to demonize frameworks like Django and Rails. So, whether for this reason or another, Node doesn't really have anything quite like Django or Rails, and thus would likely not match the dev speed of those frameworks, all else being equal. Python is _fast enough_, and early stage companies rightfully tend to not worry about CPU usage or hosting costs, because they don't have the scale for it to matter. ------ With all that being said: pick an early tech stack that helps you optimize for iteration speed, not necessarily raw dev speed (although they often overlap). Importantly, you typically want to build a system that minimizes the cost of being wrong in a reasonable time frame. If that's Python? Awesome. If that's Node? Also awesome. If that's Java? Awesome. Pick what you/your team know best and can architect in a sane way to help you find the balance between time to market and ability to experiment.
- aaai 6y agoEverybody's starting to figure out that to get affordable development you need: 1. fast development (both Python and node) 2. boring platform where it's usually OK to leave smth unupgraded for >5 yrs (Python wins here hands down) 3. cheap devs (good Node.js devs have a lot of option to "jump around" between front and back and frameworks so higher room for leverage ...with Python you can hire cheapest newly grads since it's now taught in most unis) ...on top of this: - performance in terms of "requests served per CPU power" does NOT matter for most apps (and when it does caching saves most situations) - and if it does, modern Python can deliver now (async is mature) - using same stack as ML and datasci comes as a bonus - you can have backend-full-stack-devs jumping between data pipelines, APIs/web, ML models, data analysis code etc. who can stay separate from frontend-full-stack-devs doing web frontends + mobile hybrid etc. It would be great if we could also standardize on a static high performance language common to all (eg. usable for special-performance-sensitive-code either standalone services or Python-modules or node-modules) ...this area's a mess, too much overlap, duplicated work, and too hard for devs to jump from one ecosystem to another (Rust and C++ as lib/extension langs... Java/Kotlin or Go or C#/F# for standalone services... now Swift an option too...).
- nojito 6y ago>(async is mature) is Django or Flask async yet?
- philote 6y agoNot that I'm aware of, but Tornado is a great async web framework. We use MongoDB and an ODM called umongo (that uses Motor for async, pymongo-like connections). I'm not sure what good async ORMs are available.
- msluyter 6y agoAlso, check out FastAPI, which is quite nice. Fully async with a lot of other nice features: https://fastapi.tiangolo.com/ https://fastapi.tiangolo.com/
- nojito 6y ago
- Macha 6y agoOnce upon a time, Python's most common use was in web dev where it was basically the middle ground where you wanted something more productive than Java but more explicit than Ruby. While it get a big boost from the ML trend and these days has mostly finished displacing Perl in the "Non-bash operational scripting" department, there's still plenty of projects and users that have been happily or otherwise using it all that time.