r/programming • u/Caterpillarfox • May 29 '23
Python vs JavaScript: Which is a Better Programming Language?
https://thecompetenza.com/python-vs-javascript/6
3
u/oneeyedziggy May 29 '23
Better langue, technically? Probably python... More practical, versatile, portable, and occasionally infuriating? Javascript.
3
u/ryantxr May 29 '23
They are ok. Neither is great. JavaScript is famous for its odd incoherent responses at times. The only reason JavaScript succeeded is because it’s the only language built into browsers.
I find Python’s use of indentation to indicate structure infuriating.
2
2
u/tu_tu_tu May 29 '23
I find Python’s use of indentation to indicate structure infuriating.
The greatest thing ever for a script language. If you get a piece of code written by some random ops at least it won't look like a modern art.
1
u/Reasonable_Strike_82 Oct 31 '23
That's what IDEs and linters are for. If somebody else wrote code that's a misformatted mess, I just pop it open in VSCode, hit "Save", and it magically fixes itself.
I used to carefully indent and format my code to make it look just so. Then I discovered that I could have the computer do it for me, and now I don't even think about it.
Except in Python, where the indentation has semantic meaning, so I still have to do it all by hand.
8
u/caskey May 29 '23
They're both awful languages. Poorly designed and prone to producing unmaintainable garbage.
5
u/tu_tu_tu May 29 '23 edited May 29 '23
I'd say they are an exhibition of design mistakes of languages from 90's.
2
u/caskey Jun 03 '23
I will say they were as good as was available. I know the last time I did a CVS check I've written hundreds of thousands of lines of perl.
Now I reserve it for command line scripts for stream processing. Its original purpose.
4
u/knome May 29 '23
Nah.
They're both pretty great languages that have gotten better over time. Neither was created with the ideas of entire companies of engineers working on million line productions in them. The scope was rather smaller. Both have since had typing tacked on. I think typescript did a lot better there than python did.
What came before them was generally either too low level (c/forth/etc), too constrained to be useful (scripting languages from the time that I've seen seem clunky and difficult to use), or too weird (smalltalk and lisp are significantly weirder), or perl, which got wedged into everything during the 90s since it allowed rapid implementation, if not the ability to know what the hell you wrote later (javascript and python are both generally better than perl in that regard).
prone to producing unmaintainable garbage
this just means a language is easy enough for noobs and even non-professionals to use. BASIC and PHP fall into the same category. They made creation easy enough for anyone, and as most people are trash at it, they made a lot of semi-mostly-kind-of-functional trash.
The trash these devs created probably outweighed the amount of and usefulness of professional code in the same era by an order of magnitude or so. Sure, you need a core of competent programmers in the industry, but most work happens on the edges and just needs someone willing to hammer a (permanent) temporary solution into place. Most code will go bad and get tossed well before it matters if it was pretty or not. And the parts that don't can get rewritten by the exasperated professionals trying to figure out what
$$$$$alkfja();really means.Python is easy today. So is javascript.
You're going to see trash in it. And they're amazing for letting that trash happen.
3
u/caskey May 29 '23
Omg perl. I embedded the perl compiler into a C based web platform back in the day to allow for embedded perl code in web pages served up via an Apache extension. Oh the crimes we committed in the name of doing good things...
*twitch* *pain*
1
1
-3
u/persism2 May 29 '23
Both shit.
4
u/pcjftw May 29 '23
And yet incredibly useful at the same time:
JavaScript you simply can't avoid if you're doing web, and while I personally wouldn't use it server side, there seems some weirdos doing that.
Python, well for AI and data science Python is king of the hill, and you can't really avoid Python if you want to do anything related to data science or even general purpose data cum glueing..
0
u/persism2 May 29 '23
AI and data science Python is king of the hill
For no good reason except that the Sheldon Cooper types like it. It's completely insane using a single threaded, compatibility breaking, won't ever have a 4.0 version language.
2
u/mrprgr May 29 '23
It's very fast to develop in Python and it can have excellent performance by hooking into C/C++. Not sure what you mean by compatibility breaking, major version bumps will never have a guarantee to be backwards compatible.
1
u/ryantxr May 29 '23
It’s not any faster to develop in python than many other languages.
0
u/mrprgr May 30 '23
It's highly abstracted and has a ton of libraries that make it pretty easy to read and analyze data. That makes it good for developing something quickly. Plus, with data science/analysis, the code is often incidental rather than of great importance, which is quite different from software engineering. You don't need optimal performance or low-level control, you don't need much in the way of maintainability, you mainly need to get the job done. Python is great for that, so it's the tool of choice.
1
u/uardum Jun 01 '23
And that's why I hate integrating code from data scientists and AI people into real projects. They write shit code because they barely know how to program. My life would be so much better if they had to access TensorFlow directly in C++, simply because it would force them to delegate the programming to a programmer.
17
u/Sarcastinator May 29 '23
Bug-free non-trivial applications don't exist, and even less so when you push potential errors to the runtime.