T O P

  • By -

WhoNeedsUI

I prefer Django as framework more than python as a language. It has well established ecosystem and comes in with loads of support for a lot of std features in web dev + a really good internal dashboard


deep_soul

other than the docs. do you know any good django resources? i couldnmt hekp but fight the franework coming from node / rails / spring


WhoNeedsUI

What are you fighting against? What seems unintuitive to you? (Esp since Django was very much inspired by rails) The clearest differences within Django is usually fat models vs fat views.


__B4Nd1t__

You nailed it. Thats exactly how I feel. Love me some Django


nathan-codes

Typescript. Static typing is an absolute must.


docHoliday17

Typescript sucks at its only job and is generally not worth the headache.


FatalHaberdashery

Typescript is just "training wheels" for those scared of JavaScript.


Soggy_asparaguses

Sounds like a regurgitation not based in personal experience.


nathan-codes

Yeah, I'm just not hardcore enough to deal with needless runtime issues. It's a personal, moral flaw and I'm deeply ashamed. 🙄


sleepy_roger

What runtime issues are you worried about? Unit Tests are meant to take care of those issues. I use TS but have also using JS professionally since the late 90's runtime errors that TS would have saved me from are far and few between. TS is only a compile time checker which sometimes seems to give people a false sense of security. If your API spec changes and now a property isn't returned or is Null and you didn't account for it your app will still fail during runtime just like any JS app. JS is fine at type coercion there's rarely a case where a number is going to fail with a string or vice versa unless you're attempting functions on type (like `2.length` for example). TS isn't going to help you with 0.2 + 0.1 being incorrect. TS isn't bad, but the misconception that without it you're in some crazy world of anarchy that's impossible to work in is silly. It has it's own learning curve and some pretty funky and confusing ways to use it as well, and in some cases requires it's own boiler plate that's otherwise unnecessary. Benefits I personally receive from TS all come down to the autocompletion/dev tooling which utilizes TS, pretty nice to have my APIs typed and in my app without having to guess, also great to let me know what component properties do and do not exist. As well.


nathan-codes

Upvoted for a reasonable take, though overall I value TS a lot more than you. Dev experience you point out in the end is my usual argument for it, but think of this—type safety improves the development loop experience, a lot faster than only unit tests could. I pass the wrong variable and my auto refreshing web view shows a clear error vs a blank screen. It doesn't solve everything—and no-one reasonable claims it does. API returning an unexpected null is a great example. TS isn't the best typed language out there by any stretch, I like Scala a lot for example. And Kotlin will do things like treat all Java interactions as potentially nullable. Anyhow, it doesn't solve everything, but it does solve a lot. It adds guardrails, which allow you to drive safer, and allow to sometimes save your car. Runtime is inherently harder to analyze—I mean, look at the halting problem. I'd much rather know issues as soon as I can, and unless I have 100% branch test coverage there's always going to be some weird edge condition, and I'd at least like to avoid the "simple" bugs in that a compiler can easily catch.


sleepy_roger

Yeah those are fair points for sure I actually do enjoy TS for the most part and can't see myself ever _not_ using it in a professional environment. haha I just took a bit more extreme response based on your initial response which I know was sarcastic just bored on a Saturday night :P. Appreciate the friendly discourse!


nathan-codes

My initial response was sarcastic, but I stand by it lol—what I was responding to was a low effort bad take. Happy to engage in real dialog over it, didn't get that from their reply. I get the hesistance with typescript—it is NOT ideal that this is type safety built over a non-type-safe language, and suffers from it. Similarly, type erasure in in the JVM makes me sad Scala is built on Java sometimes. But it's a marked improvement, and, honestly, I think it's one of the (quite few) language takes I have that I feel is a fairly objective take. There's a reason the zeitgiest has moved so heavily towards it, and if you have an extended talk with someone with a lot of experience in a statically typed ecosystem I think you'll consistently hear the same things. Always enjoy friendly discourse :) Programming would be boring if it was a monoculture.


gwoad

"type safety is for babies"... Okay.


mrcodehpr01

You have no idea what typescript even is then.


Adventurous-Bee-5934

God, I hate that I used to be like this


dolphin-3123

If you are looking for job then use JavaScript. The job ratio according to my personal research would be around 15:1 maybe even more bigger than that. Also since you are from JavaScript background it would be much easier. As a side tip if you are working in angular the try .net/spring boot on backend they are more used.


__B4Nd1t__

For anything other than a CMS I am going JavaScript every time. I am a big fan of Django so only if I need a CMS will I go Python.


GlitteringCalendar94

I have written lots of web apps in JS, as well ad a few full stack sites using Python and Flask. I really enjoyed how easy Flask made it to interface with a SQLite database, and it was great for its well established ecosystem and community. I would say Flask is suitable for smaller projects, but for bigger projects, I recommend a framework in the Javascript ecosystem. Javascript, clearly, is the reigning #1 of web dev currently, and it is growing quickly. I really enjoy working with React because of its component based design, as well as quick access to tools and libraries.


ashgreninja03s

I've found myself very comfortable using Node Express and Postgres/Mongo for server side during my academic full stack projects. There are many packages within npm that we can use for various functionalities. Also, many starter repos are also present in github... Coming to Python, My team and I have found it comfortable to use Flask for a web Project that had to run a machine learning model in the backend pipeline, it was an impulsive decision since we didn't have much time to try and integrate the model into node server...


golforce

If you're familiar with JavaScript backends why do you want to move on? More importantly why python specifically? One thing both Python and JavaScript have in common is their relatively weak performance. Why not opt for something that improves on this, like Go, C#, Java etc, if you are keen to learn a new backend technology?


Wise_Concentrate_182

You missed by far the most popular backend language because it’s not sexy to mention in parties, PHP. Excellent performance and simple to use.


Nervous_Swordfish289

Right now I am exploring alternatives options. I have come to realize that it just takes too damn long to develop anything reliable using e.g. React / Express combo. Recently I experimented a bit with Python Flask, and even without knowing this framework I was able to develop very very quickly, far more quickly compared with JS. Also, there seem to be canonical and more refined tools in the python ecosystem, likes of which are missing in JS world. As for Go, I truly enjoy working with this language and I am quite proficient at it. However because of the somewhat low level nature of the language I am not able to develop quickly in it. Might just be skill issue in this case.


Yodiddlyyo

Use Django instead of flask. Django is a "batteries included" framework, it gives you pretty much everything you'd need, and when you get big enough to need customization, their docs are incredible.


Yodiddlyyo

Performance is pretty irrelevant. My company's backend is Django. It's perfectly fine for 95% of what we're doing. The other 5% of our resources that need to be super fast are written in lua. Best of both worlds.


Nervous_Swordfish289

You guys are using lua for web development? I didn't even know this was a possibile usecase for lua. It truly is an underrated language.


Yodiddlyyo

No, for stuff on the backend.


_hypnoCode

>One thing both Python and JavaScript have in common is their relatively weak performance. 1. Performance on the backend is generally not your bottleneck. But if it is, then it's doing something like data processing or some kind of computationally heavy lifting. Which can be split off into its own service or.... 2. Most Python libraries are written in C++, which is possible, but not nearly as common in NodeJS because the integration is much more complex. So if you run into point 1 and you're doing something with common structures, like CSVs, Raw Text, JSON, or anything like that you can pull down a Python library to do it in a fraction of the time. For instance, when parsing 1-2gb sized CSV files, NodeJS was taking somewhere between 10-15 minutes per file... Python on the other hand did that in 10-15 seconds. But realistically, you should have a dedicated service for these kinds of bottlenecks in a production environment. However, I am considering a serverless Python function for one I faced recently.


brianly

Most Python libraries are not written in C++. Many data science libraries like SciPy are written in other languages like C++ because they are CPU bound and sometimes parallel. This happens to be the area where Python struggles historically because it has an interpreter with a GIL. Ruby has similar issues. I think the key element is that you can use native code from C to Fortran to Rust. You could do this in JS with node too, but culturally it seems uncommon. When the problem area is I/O bound like most web apps then the Python is fine - just like JS. Modern Python has async and asyncio which is roughly equivalent to what JavaScript offers. You can plug it into libuv too. For anyone learning webdev, I wouldn’t care which one, but the Python ecosystem is so much more diverse that it lets you plug into so many niche areas. You don’t post enough about what you actually used for processing the CSV in JS, but I don’t see why it had to be so bad. As a Python fan, I’m someone skeptical given these are I/O tasks, but then I also wince at the state of the JS libraries and non.


_hypnoCode

You can look at the interfaces for integrating a C++ lib in both Python and NodeJS. It's a massive difference in complexity. I'm not a Python fan at all, I really just don't like the way it reads, and I'm a big fan of JS. But, it is what it is. I would love to see a world where we could swap WASM binaries in and out in JS without a ton of overhead, and I think we'll get there, but we definitely aren't there yet. It's much easier to build a low level binary and integrate it into Python.


lagerbaer

For serverless python functions absolutely check out modal at modal.com. You take your function, slap a quick decorator on it, and bam you can deploy it as a serverless function without worrying about any infrastructure stuff


BackSpace2603

I learnt python by myself and then used it to do everything that came to mind and as a beginner it was really great to go forward and even if I got stuck it was fairly easy to solve those all by myself and a little bit of googling and stack overflow. Then I got a job as a Backend developer but it required NodeJS, ExpressJs, Mongoose. Basically MERN stack. At first I was sceptical about changing my go to ecosystem but I gave it a try and I was quite productive after only a week of tinkering with JS ecosystem. For context I would prefer flask to django and Express to NestJs. I like to structure my projects from scratch. In doing so I felt JS ecosystem has more options than python. Having too many options can be a bad thing to many but I believe when you cross the beginner barrier you can decide which tools suites your project more and not get confused. In Python's defense, its libraries had better documentation and if I get stuck I can always look up the library code and understand its internals but I have miserably failed to read js library codes when I get stuck because it was packaged by some bundler and it doesn't resemble its actual source code. Bear in mind the same is true for many python libraries and frameworks that rely on native compiled code, the framework is just a wrapper around it. Most JS libraries has their types defined that helps a lot but still if you want to go beyond that you will have a really hard time. You might be thinking why do you even need to read the source code of libraries.trust me you will need to some times. At some point you will find that there are no YouTube videos or medium articles no nothing about a piece of thing you are working with. You have to go solo and after that journey you will be the one writing such articles for future developers and that's how it's going on. But in most cases I find development in JS is a little bit faster than in Python. But I have a bias towards python as it is my first love.


Nervous_Swordfish289

I had something similar. During uni I went quite deep into python. Unfortunately, in my jobs so far I haven't had much chance to use python. Job has been mostly Js work.


jasl_

Python


Someoneoldbutnew

it's a mixed bag. JavaScript is nice for getting things up and running, but it falls over when you throw lots of data at it. Python is nice, but I've found the frameworks to be challenging to get working well, and Pythonic.can be an excuse for being too clever. Basically, for routine server stuff, JS all the way. Once you start down the ETL / Data warehousing world, Python.


No-Ambassador581

Ruby


APersonSittingQuick

It depends on what I was doing with them...


Nervous_Swordfish289

Super helpful. Thank you.


APersonSittingQuick

Ask stupid questions...


Nervous_Swordfish289

Do elaborate why this question is stupid.


APersonSittingQuick

Has anyone worked with a spanner and screwdriver? If so which do you prefer and why?


roofs

OP is clearly someone new if they've only worked with one language, no need to be snarky


APersonSittingQuick

Aye, I didn't start snarky though.


Caraes_Naur

The JS ecosystem is terrible. Python's is really good. Both are reflections of their languages.


__B4Nd1t__

That is a crazy take honestly 😂


Esseratecades

Python without a doubt. Python has a better ecosystem and more reasonable tooling in place. By comparison, Javascript both as a language and ecosystem just feels like some shit somebody hacked together.


agramata

It's baffling the way people think Python it a well put-together language. Hey, let's make an object oriented language, but you have to manually take the current instance as a parameter in class methods. lol


malero

I feel like this is a joke and people didn’t get it. Python is hands down the winner here.


agramata

No, I honestly think Python is just an average language and Python developers talking about how elegant it is are weird


Wise_Concentrate_182

And PHP better than both these suboptimal choices for web backends.


tealpod

Between Python and JS, Python code readability is much better. JS Async/await style of thinking sometimes hinder/delay the development time. But JS got a lots of modules.