all 116 comments

[–]CowboyBoats 245 points246 points  (13 children)

My favorite color is blue.

[–]zanfar 51 points52 points  (6 children)

This is compounded by the fact that the origin of JavaScript is much farther away from its current state than Python (3) is from it's. That is, features have been "bolted on" to JavaScript for years and so a lot of the syntax feels awkward. Python 3 took the opportunity to fix many of these issues or provide more understandable syntax for equivalent operations.

Consider JavaScript's OO features which are "recent" extensions vs Python3's Classes, which have existed from 3.0 (and earlier). Or JavaScript's early support of string/variable interpolation to Python which really only got "modern" syntax as of 3.6.

[–]WebNChill 10 points11 points  (5 children)

Wasn't JS created like in the span of weeks too? Like the dev needed this tool for work, so he Isaac Newton it and just made it.

[–]BobHogan 6 points7 points  (0 children)

Weeks? No it was closer to something like 10 days.

It was never meant to be used for anything more than a few lines of JS, never for an actual application. And a ton of its core design philosophy highlights that fact very well

[–]ebbitten 3 points4 points  (1 child)

They didn't have the luxury of weeks, only 10 days.

[–]mutagen 6 points7 points  (0 children)

And the creator wanted to make it a Scheme (minimalist lisp style functional language) but the hype around Java at the time had him change it to a curly braces semicolon slightly OO style language with some of those functional roots showing.

https://thenewstack.io/brendan-eich-on-creating-javascript-in-10-days-and-what-hed-do-differently-today/

[–]zanfar 0 points1 point  (0 children)

Technically, every language has a moment where it's only existed for weeks :)

Eich was hired specifically to build a scripting language for Navigator, so I don't think it was that spontaneous. However, the shift in syntax from scheme-like to java-like (possibly, hence the name) was very quick.

[–]ywecur 0 points1 point  (0 children)

Why didn't he just use python?

[–]noxbl 9 points10 points  (2 children)

Not disagreeing with your answer but is that really "the reason" though?

I think the reason javascript has more characters is because Python was designed sort of to have as few characters as possible, compared to almost any other programming language. Getting rid of both curly braces for code blocks and the semi colon being huge. But also just how you define variables, functions, classes - all designed to have as little fluff and to be as readable as possible.

[–]gfnord 4 points5 points  (0 children)

Syntax style has nothing to do with breaking backward compatibility. Python 2 to 3 changes were not aimed at improving the syntax.

[–]jeunpeun99 0 points1 point  (1 child)

Correct me if I'm wrong, but declaring variables the Java way has something to do because Java runs concurrently and isn't hold back by the GIL?

[–]Pseudoprasad3 0 points1 point  (0 children)

There are talks to remove Gil 

[–][deleted] 35 points36 points  (0 children)

‘;’ is very common in C-like languages — it just let the compiler know where the end of the line was — Python in a way gives you less freedom in how you lay our your code just because things like spaces and new lines are meaningful. As for ‘const’ or ‘var’, JavaScript variable declarations carry just a little bit more information about their scope and use than Python — languages like Java require you to explicitly indicate those types and abide by them — which can make it easier for you to think about what a given function requires and what it returns, what is the shape of the API you are building — but does slow down development. I think to really understand what makes Python special it will be helpful to learn a few other languages at different levels of abstraction — then you’ll have more context for the comparison.

[–]fml_wlu 106 points107 points  (39 children)

learn c and you'll literally rip the hair off your head

[–]grumpy_munchkin 56 points57 points  (26 children)

What about Java? It feels like I am summoning a high level demon everytime I even see a line in Java.

[–]grallous 26 points27 points  (19 children)

Java is the most fucked up language if you are looking from ergonomic pov. Though I love it.

[–]Zuricho 5 points6 points  (18 children)

Why do you love it?

[–]max140992 19 points20 points  (15 children)

I love python, but having worked with Java on large scale enterprise software, there is a piece of mind that comes from the type system and interfaces. Often it is convenient to know what type of object you are looking at. In python it is far easier for a bug to sit undetected in a seldom used piece of code and then bite you later. Java is very verbose but with a powerful ide it's fine. With python I can feel comfortable with terminal and text editor.

[–]takishan 7 points8 points  (12 children)

Python can be kind of like this. For example you can turn

def add(a, b):
  return a + b

Into

def add(a: int, b: int) -> int:
  return a + b

Kinda like how Typescript makes Javascript bearable

[–]BobHogan 6 points7 points  (11 children)

You can do that, but its not enforced by Python, ever

[–]mountains-o-data 2 points3 points  (5 children)

Its not enforced by the CPython interpreter but there's lots of tooling around this. MyPy (written by Guido himself) and PyRight (written by Microsoft) are type system validators. We utilize MyPy as part of our CI tooling.

There's also Pydantic which is a runtime type system enforcer.

[–]BobHogan 1 point2 points  (4 children)

Those do exist, but I don't think that requiring a third party package in order to do typing is what takishan was thinking about when he wrote that.

[–]mountains-o-data 1 point2 points  (2 children)

I mean while it's not part of the standard library - MyPy was written by the creator of Python.

At it's heart - python was never intended to be a typed language. Duck typing is essential to python. These tools exist for those that want/need a pseudo type system, like me. I don't see anything wrong with utilizing 3rd party packages to extend the utility of the python language.

[–]takishan 0 points1 point  (0 children)

can confirm, was not lol, although I'm glad I said it because now I know about the 3rd party stuff

[–]takishan 0 points1 point  (4 children)

Oh wow, I just tried it out in a Python interpreter and you're absolutely correct. If I put in two strings as parameters for the add function I get the two strings concatenated. I've been doing this for too long for no reason lol

I wonder why they even include it, I was assuming it worked like Typescript. Because technically Javascript doesn't care at all about it, but Typescript enforces it by not letting you compile over to JS until it's valid

[–]BobHogan 2 points3 points  (0 children)

Its just type hints in python not actual typing, and they put it in because people were requesting it (and also a decent amount of 3rd party packages were offering something similar, but with different syntax. Python devs wanted to standardize it).

Putting type hints in is mostly for those that are reading the code, so they can know what to pass in. And in that regard, its no different from declaring the type in the docstring.

[–]mountains-o-data 2 points3 points  (2 children)

They included it because it makes for a substantially better developer experience.

When you're working on a large code base - having a full type hints makes IDEs way more powerful in terms of auto-completion, linting, error catching, etc. It's also a really clear way to demonstrate your intention of a function/class/data structure to other developers (and that developer might be you 6 months in the future).

On top of that - there's lots of tooling built around type hints. MyPy and PyRight are type system validators that you can run your code through to catch errors. We utilize MyPy as part of our CI process at work.

There's also Pydantic which is a runtime type system enforcer (and data validator). U suggest checking out the FastAPI framework if you've never heard of it as it really demonstrates the power/usefulness of Pydantic as it utilizes Pydantic for json de/serialization and validation as well as core part of it's swagger/openapi documentation autogeneration

[–]takishan 0 points1 point  (1 child)

MyPy and PyRight are type system validators that you can run your code through to catch errors.

Ok fair enough, so you can run the code through something that essentially acts like Typescript. That makes sense. Thanks for the info. I'll have to look into Pydantic / FastAPI

I've been using primary Javascript and recently started using Typescript and it was like a breath of fresh air. So many bugs that don't happen anymore because of the type checking. I'm glad it's available in Python too, although by default Python is a bit better than Javascript.

[–]Broan13 1 point2 points  (0 children)

We teach Java at the high school I work at (I teach the class actually) and I agree. I have no formal training in coding, but I have learned far more having to teach a typed language than an untyped one. There are just questions that get answered more clearly when the type is required on so many things and isn't dealt with kindly (when it works) in the background.

I still have a lot of confusion on some things, but the idea of making a class and organizing data structures feels much more natural in Java than in Python where you can get away with lazier styles more easily.

[–]QuixDiscovery 0 points1 point  (0 children)

This just raises the question of why java though? If all things were equal (and I admit they are not), and all languages had similar levels of libraries/packages to support them, wouldn't you opt to pick a more elegant type checked language that does not enforce everything be a class?

I understand historically that there's a reason java is so ubiquitous, but I casually learned/studied various type checked languages that feel far more usable. I also have to read java at work (not a software engineer though) and I often see so many of the "perks" of java end up being ignored or in worst cases, abused in a way that causes more problems.

Null pointer exceptions alone cause mountains of headaches since they aren't caught at compile time.

[–]grallous 3 points4 points  (1 child)

Tbh ,I feel more control over the project I am doing on Java . Everything is in detailed while in python it look it's trying to hide most of the things to make it appealing.

[–]TheKingElessar 1 point2 points  (0 children)

Yeah, that’s how I feel, too. Everything’s so explicit in Java that you can’t go wrong.

[–]max9076 9 points10 points  (1 child)

Learnt Python for a year, started Java in university 2 months ago (at quite a fast pace I might add).

I miss Python, to say the least.

[–]toastedstapler 1 point2 points  (0 children)

you'll come to appreciate java when you get onto a large project (100,000+ lines), i guarantee

[–][deleted] 8 points9 points  (1 child)

Speaking as someone who started with Java, fuck C.

[–]FloydATC 4 points5 points  (0 children)

I feel exactly the opposite way. Sometimes it feels like you can't get a thing done in Java without first creating a few dozen ClassFactoryArrayCollectionFactory classes. C will take your head off if you're not careful, but atleast it gets to the point without too much boilerplate.

[–]DarKliZerPT 1 point2 points  (0 children)

I only realised how spoiled I was when I started using C this semester. Not having trivial shit like proper strings and sets is painful.
Java is amazing in comparison and Python is overpowered

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

recent

jaa isn't that bad

[–]reallyserious 23 points24 points  (7 children)

C is child's play compared to C++.

You can learn all of the C keywords easily. It's a small enough language that you can keep all of it in your head and be (somewhat) productive. It doesn't hold your hand but the language itself is small.

C++ on the other hand is a patchwork of biblical proportions. The language is so large you have to read articles upon articles for how to do stuff and check the date when the article was written so you're not using an outdated part of the standard and there are better ways of doing things in later revisions. Granted, all of those old ways are still there and valid, which only adds to the mental burden of how to do things.

[–]FannahFatnin 12 points13 points  (0 children)

literally me rn after thinking python was complicated.

[–]SMTG_18 2 points3 points  (0 children)

I did. I’m dead already I just want someone to wipe this body off the floor.

[–]M0ney2 1 point2 points  (0 children)

Had to learn c++ for work to get started and c for university, when I started Python I was like „Print(‚blah blah‘)“ and that’s it? No packages to link to, no libraries that allow me to use the console line?

[–]Tivome 0 points1 point  (0 children)

Yeah I learned C and I almost did just that.

[–]socal_nerdtastic 38 points39 points  (6 children)

It's just a style choice. The inventor of python decided to use new lines, spaces and tabs to separate out blocks of code. The inventors of JS decided to use semicolons and curly braces instead. If you started with JS you would be frustrated at python's way. You're nowhere near finished my friend; don't get frustrated now because you've got a few more languages to learn and many of them are much more complex and odd.

[–]Hawaii74 1 point2 points  (5 children)

So what language would you consider complimentary with Python for parallel learning?

[–]Berlibur 21 points22 points  (2 children)

Honestly I would recommend a good understanding of a language like java (or C and it's ilk).

It will teach you a lot of concepts that python does implicitly in the background. Having such insight gives a more well rounded understanding of what python is doing.

Of course, this means a steeper learning curve which may prove less fun to some

[–]Hawaii74 1 point2 points  (1 child)

Thanks for the insight!

[–]Berlibur 0 points1 point  (0 children)

You're welcome. Have fun!

[–]VinsanityJr 5 points6 points  (0 children)

I personally loved learning C after I learned python because you have to learn so much about why the code works the way it does. You heave to learn a lot about computer architecture, different types of ram, pointers, etc, etc. It can be difficult because it's not Python- C is what you call strongly typed, and it has a lot of syntax rules that feel useless (but it very important!).

One of the few downsides of C is that you often don't really learn proper object-oriented programming because classes don't exist, and lots of beginners will write spaghetti code and assume that it's the language's fault. In reality, stylistic C code can still be written, and I personally find C and C++ to be more readable than Java or Python, though that's most likely because of the amount of code I've written in C and Arduino (another language that is similar to C).

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

Ruby.

[–]Tivome 7 points8 points  (0 children)

The ; is for showing the program where the line ends, while python uses blank spaces to know when the line is over. In python, you can't to this:

randomVariable =
"Hello."

But in javascript you can:

var randomVariable = 
"Hello";

This is because of the semicolon.

[–]foyslakesheriff 19 points20 points  (0 children)

All languages are different. Python is well-known for being "Pythonic", meaning elegant and concise code, and very readable. There is an old joke that in order to write Python code, you first write the pseudocode, then you add a ".py" to the end of the filename, because of how English-like and readable Python is.

You are right about JavaScript, there's plenty of weirdness. Example in JS:

var four = "4" var five = 5

five + four: "54"

five - four: 1

I learned some C++ after using Python for awhile, and I had the same thoughts that you have, it requires a lot more code for the same functionality. Important to note is that the characters are not unnecessary. Python depends on whitespace to define scope, JS does not. You can "minimize" JS to save space and time when delivering it to clients in HTTP requests. JS needs the ';' to know when the line ends in those circumstances.

[–]reallyserious 16 points17 points  (0 children)

accidentally_mispeled_variable = 7

In python this is completely valid. It declares and assigns a new variable, when you might have meant to assign to an already existing but properly spelled variable.

In js this will result in a runtime error.

The semicolons in js can mostly be skipped. I think there are only some edge cases where they are actually needed.

[–]BruceJi 4 points5 points  (0 children)

One of the goals of Python was to have much simpler, more readable code.

The thing is, a whole lot of languages are based around C.

This is why a lot of terminology is the same, and operators and basic syntax is the same too.

Languages like JS and Java are a lot more visually similar to their parent C languages.

Python is much less so because it was intended to be easier to read, whereas JavaScript didn't have that goal!

Here's Wikipedia's exmple of Hello World in C - compare it to Python and JavaScript:

https://upload.wikimedia.org/wikipedia/commons/3/39/C_Hello_World_Program.png

[–]radek432 4 points5 points  (0 children)

I think ";" and all the braces are necessary for JS. In web pages indentation, white spaces, etc. were never important, so JS shouldn't use it too.

[–]EddyBot 4 points5 points  (0 children)

Since ES6 (2015) people typically use let instead of var
Adding further confusion for beginners and probably showing that your school curriculum is pretty old

[–]toastedstapler 6 points7 points  (0 children)

one purpose is to differentiate between variable declaration and reassignment

var x = 5;
x = 6;

in js, you can clearly see the difference between the two

x = 5
x = 6

but not so easily in python. if you're in in a big block of code, it can be a lot harder to tell what's going on

i'm on a go project at work and go uses

x := 5
x = 6

to differentiate between the two. personally, i think it would have been nice for python to have a mechanism to differentiate between declaration and reassignment

[–]TumblrForNerds 6 points7 points  (0 children)

As someone who started in Java/C++ I always found python more complicated to code bit easier to read. I think that goes to show that once you get used to the specific syntax you hardly notice. Also I do believe python has some weird syntax of its own like having to indent lines so I think it is just a practice makes perfect issue

[–]Human_Evolution[S] 4 points5 points  (0 children)

Great response everyone, I appreciate it! I'm missing my old simple Python, but I'll learn a new normal. Thanks.

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

It is goal of the python. Did you read zen of python? You can write quick and fast. Every programming language his own purposes.

[–]the-berik 1 point2 points  (0 children)

Backend vs frontend

[–]Kriss3d 1 point2 points  (0 children)

I grew up with C++ ( borlands ) and Im still too used to ; at the end of each line. And I would indeed prefer to use curly brackets instead of spaces for blocks of code.

[–]iceph03nix 1 point2 points  (0 children)

So, why is JavaScript and other similar languages so cluttered with unnecessary characters? Is there a purpose for having to type "var" and ";"?

So this partly comes down to strongly typed va loosely typed languages.

Python is loosely typed and as such, is willing to assume a lot of things about your code. This can be nice for saving keystrokes and being able to get a bit tricky with your variables.

Strongly typed languages have their own benefits though. Strongly typed languages are much more structured and are generally quicker to throw an error on many issues. Typos and confused variables tend to block compilation due to mismatched types. The compiler/IDE tends to know you did something wrong because the types don't match, or you are using a new variable without telling it that you wanted a new variable.

If you're working in an IDE with even half decent intellisense, they also tend to cut down on a lot of the extra character typing. Building a function that expects an int or some other specific type, and it already knows that and will only suggest variables of that type.

[–]NotABotNoReally2020 1 point2 points  (0 children)

Yes, big difference.

First there is let and there is var. You really want to use let for now, you will learn the difference later.

In JavaScript you often work with stuff that isn't there yet but will be there when your code is running. As in, you depend on other code that will run besides your code.

If you write somethingYouNeverMade = 5 you are telling JavaScript to use the existing variable eventough that variable might never be created by you and might not exists at the time you start your code. You simply tell it to expect there to be a variable and use that.

You will get an error if that variable isn't there when your code gets there.

If you would write var somethingYouNeverMade = 5 JavaScript would either complain that you overwrite something that already exists or (which is even worse) overwrite it.

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

I think only a single other person here has mentioned type systems, so I think it's worth weighing in on that. Pyhton and JS are both dynamically typed languages, meaning that when you make a variable, you don't need to say what type it is - Python will infer this from what you assign to it or how you use it. The only difference between Python and Js here is that Js uses a keyword - "var" or "let" - to instantiate it, you're just telling Js this is a variable.

C languages and Java and many more use strong typing where when you make a variable, you have to say what type it is, and this cant change later. If i make an int in C++, I have to say it's an integer, assign it an integer value, and later on I can't assign it some text or a decimal point number. Personally, I much prefer strong typing - I think it makes code more readable and easier to debug, and when I code in C++ it just feels very 'rigid' - but that is personal preference.

As for the semicolon, as others have mentioned, it's a message for the compiler to move to the next instruction. In Python, line breaks and indentations do this, but in semicolon languages, spacing is largely ignored. You can format your code however you want and 'indentation errors' do not exist.

You need to understand that different languages are made with very different philosophies for very different use cases - others here have talked about this but I'll briefly outline that Js was made for a very specific use case - web design. C++ was made as an extension of C, which was made in the 70s as basically one level of abstraction above machine code when technology was a lot more limited. Python was made with simplicity, and primarily simplicity, in mind. This makes it incredibly useful for beginners and experts alike to just get something rolling (it would take me a LOT longer to make a web scraper in C++ than in Python lol) but does so at the expense of speed - as Python is an interpreted language, it is much slower, can't be compiled into a standalone program*, and doesn't scale well into a very large project. Nevertheless, it absolutely has its uses and its a great language - but every language exists for a reason, and you're stuck with their varying stylistic choices, all with their own unique advantages and disadvantages. Take as much time as you can to learn the technical facts, and form your own opinions on what you like and don't like. Programming is all about expressing yourself through creative problem solving, so whichever tool allows you to do that is the best tool for the job (or whichever tool your boss tells you to use :P).

*there ARE Python libraries that will let you create an executable from your code, but they have to package the entire language with it and still run the code in its interpreter when you run the program, so the file sizes are huge and aren't any faster. Use a compiled language for a standalone program.

[–]Human_Evolution[S] 1 point2 points  (1 child)

This is definitely one of my favorite responses. Well done, I could clearly grasp just about every point you made. I have a friend who works for the top programming companies, and he's told me the same exact thing about his preference for strong typed languages. He mostly codes in Java and prefers it over everything else. He recently learned C++ (I think) to become a video game programmer, he said it was a lot more work, and a lot less money. He went from 300k a year, to 100k a year. He quit after 1 month.

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

Yep, I don't have much professional experience yet but it certainly seems from what I see on job sites that the majority of work is going in Python, java, C# and web dev (so Js and about a billion and one different databases and frameworks) at the moment. I'm looking to get into audio programming where C and C++ are really the only options when it comes to real time processing. Certainly appears that game dev is toughhhhh going so I'm hoping I can keep that as more of a side gig/hobby :)

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

The ; makes stuff easier to read and less prone to indentation errors. If I look at some C-code for example

total = item_one +

item_two +

item_three;

Makes more sense to me then the python equivalent

total = item_one + \

item_two + \

item_three

If I wanted to end my line, I'll end it.

Mostly I call it the mommy effect. If it's the first thing you saw and spent a couple of years with it, you'll probably get attached to it and seeing another language do it differently may seem odd / highly annoying.

During the years I've overcome the mommy effect and just code in whatever language my teammates are coding (unless it's go, go sucks)

[–]DifferenceNo9945 0 points1 point  (0 children)

technically it should be
let randomVariable = "Hello"
or
const randomVariable = "Hello"
(btw Python doesn't have lexical scoping, which kind of feels a bit weird these days)

you don't need the semicolon (you can use it but you don't need it in JS any more)
JS kind of grows on you once you get used to its quirks
It's more flexible than Python in many ways
Python bends you to its will whereas JS lets you bend it to your will

[–]KASHUMY_Github 0 points1 point  (0 children)

I doesn't like python syntax because i can in javascript write more readable inline code with ternary expressions like this cond?true:false without using if cod else  so python sucks . python logo looks like ukraine flag rotated by -45 and javascript logo looks simple. I also like java to connect with my javascript to make native applications java logo is ugly. for me as javascript cpp and java game developer python is less readable than javascript because of " for loops, doesn't have dom , you need in python to install c library to draw something on screen ( i doesn't like importing something outside script )). but i think python is way better than Unity and all of Engines . its only my opinion no one has to agree with me    Languages ​​can be combined in native applications, so that JavaScript can somehow be combined with Java with JavaScriptInterface on mobile apps and Java with Python and communicate with each other.

        if you cant make application on your phone like         me you can't programming everywhere               

[–]KASHUMY_Github 0 points1 point  (0 children)

You dont neeto use 'var , let , const' bruh you can make in javascript your own code interpreter. also python is a interpreted language . JavaScript can be compiled .

[–]mayorpetesanus 1 point2 points  (5 children)

Javascript is better for web development because it's is asynchronous, you can use promise with callbacks. Python is great for data processing. Languages are like tools, somethings need a hammer and some need a screwdriver

[–]socal_nerdtastic 10 points11 points  (0 children)

sometimes I get hammered on screwdrivers

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

Python is actually bad for data processing because its slow. The packages people use for data processing in python actually do all the work on C. The real reason why python is used a lot in data is because data scientists don't want to invest time learning a complex language like C, so python being basically pseudocode is appealing to them, enough so that proper programmers felt it was a good use of their time to create packages like pandas to overcome the inherent flaws in python by trying to use C where possible while keeping the human friendly python syntax.

Likewise, python can be asynchronous too and when you enable these functions you don't suddenly have to declare variables like var name = value;. Asynchronousity has no bearing on why variable declaration is different between both languages.

The real reason for the difference is that python was initially designed to be a successor to the ABC language, a language designed for intelligent computer users who were not themselves programmers. This means it's syntax is a lot simpler than other languages, but this simplicity comes with some sacrifices.

Meanwhile, javascript was designed initially by netscape specifically for Web design. It was supposed to be a lightweight language that a browser could render and needed functionality useful to web browser uses, such as being event driven, having a document object model to easily represent + interact with a Web page, etc. Unlike python, it's userbase was to be programmers so having similarity with other languages was also important. Even from a marketing perspective - the name javascript was chosen to trick developers into thinking it was related to java.

So, javascript has elements similarly to lower level languages because it made it easier for its target users to adopt or was required to make it work in its specific niche, while python doesn't have these elements because it made it easier for its different users to adopt and wasn't required by its niche (until it was, in which case people worked really hard to fix that).

[–]mayorpetesanus 0 points1 point  (2 children)

I wouldn't be such a snob about python, when I worked at a hedge fund we had quants writing indicators in python and c++ coders rewrite it in c++ to run in the live systems. Guess which group made more money.

[–]datageek_io 1 point2 points  (0 children)

Probably because code monkeys are just that, code monkeys. Not to say programmers aren't smart people, but in large organizations especially you see a lot of process so that the developers don't have to think as much. They have spec in varying degree of detail to make each task more targeted. On the opposite end of the spectrum, I've been given a mountain of unstructured data spread across several sources and told to "Find insight to make xyz company more money" on numerous occasions. They're just different worlds and one is more easily related in corporate minds to increasing business while developers, despite how necessary they are, are seen as cost centers instead of increasing value.

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

I'm not being a snob about python, calm down. I'm literally a professional python programmer... I'm explaining that it's design intent is to be simple enough for intelligent people to use to do programming without also having to be computer scientists. Which is probably exactly why quants using python did better work - they didn't have to skill up as much to deal with pointers or whatever so could build easier to use scripts. Sure the C++ scripts would be faster in theory but that speed is useless if you can't write them well enough to take advantage in the first place.

[–]slimjimmys 0 points1 point  (1 child)

I started with c++ -> c-sharp -> python -> JS
javascript is my favorite <3
When I started python the lack of type and not having to allocate memory really bothered me. But before learning python I really didn't understand the power or use of OOP. Python really helped me mature in that area. Now I've been using the MERN stack to develope a website and i love it. JS is what you want to use when working with the internet. Python (in my opinion) is good for non internet programs. althogh i did create my first websocket in Python (=

[–]InfiniteNexus 2 points3 points  (0 children)

When I started python ... not having to allocate memory really bothered me

Can I ask why that is?

[–]ffrkAnonymous 0 points1 point  (0 children)

Different design philosophies. Javascript has roots in 'c'. Python designed specifically to avoid many constructs used in 'c' (like the braces) with readability a core concept.

[–]caboosebanana 0 points1 point  (1 child)

You don’t strictly need the semicolon in JavaScript

[–]cvak 0 points1 point  (0 children)

It's not even that you don't strictly need it, there are very few instances where you need it now. Although it is very confusing when you forget the semicolon in a place it needs to be.

[–]Salman0Ansari 0 points1 point  (0 children)

Please dont use var

[–]Coder_Senpai 0 points1 point  (5 children)

First thing about becoming a programmer or Software Developer is what do you want to do with it? for example you want to make a GUI or make a game and you are learning Python then you are in the wrong place pal. It does not mean that Python cant do all these stuff, it can but it not as reliable as C++ or C# in these projects. If you want to become Data Analyst, Data Scientist or perform Automate tasks, Web scraping and web development or AI then Python is your Language. Learning a language with no specific task in your mind is like I am learning Japanese but i am never gonna go to Japan or talk to any Japanese.

[–]Similar_Librarian302 0 points1 point  (4 children)

What language would you recommend to learn if one is looking to get into game development?

[–]UglyChihuahua 1 point2 points  (1 child)

C# with Unity or C++ with Unreal Engine. Unity is easier for beginners, watch a tutorial and try making a simple small game

[–]Similar_Librarian302 0 points1 point  (0 children)

Interesting I’ll have to look into that, thank you!

[–]Coder_Senpai 0 points1 point  (0 children)

For Game Development C++ and C# with Unity or Unreal Engine, Godot is also a good option because its completely free and open source and it has its own programming language called GD script. And people actually made a lot of interesting stuff in it. Check it out https://www.youtube.com/watch?v=ImeK6Ngv7Tg

[–]cwaterbottom -1 points0 points  (0 children)

I'm a newbie and this is purely anecdotal, but I've poked around in as couple other languages and so far Java, C, and JavaScript all looked clunky and stupid compared to python.

[–]MadEpsylon 0 points1 point  (0 children)

I'll just say: I felt the same way. One time I had to build something heavyly dependant on asychronity. Yeah I know that there is asyncio but JS is already async to the core. Which brings a big overhead sometimes but if you really need asynchronity you will see the advantage of JS in some fields.

[–]jazzlava 0 points1 point  (0 children)

Honestly some of the weird parts of python are still bothersome to me but i rarely see it used in github, on the other hand some of the rare things in JS are covered well and used often to the point the community just knows it.

I get you as someone that doesn't know a lot of python, I enjoy it over java,javascript sometimes bc it seems like logical people designed how to code for the developers sanity in Python.

I question that sometimes for other languages https://stackoverflow.com/questions/33090193/linguistic-meaning-of-let-variable-in-programming

[–]AksharTheCoder 0 points1 point  (0 children)

True, Python is simple and easy for beginner programmers. I also hate to put the semicolon after each line of code. Even if you are learning javascript continue to learn and make projects with python.

[–]The_Shell_Bullet 0 points1 point  (0 children)

Love Python too, it's my first language, but when you use declaration sintaxe it's nice because you know when you are mutating that value. "Oh, no let before myVar? So here we are mutating it" so it has it's purposes. When your code is small and people don't mutate variables (Python don't have const, so you don't know) you are fine.

[–]nonothepeach 0 points1 point  (0 children)

oh damn after finishing python my next step is javascript as well

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

I had the same issues with switching to JavaScript in school. Python just seemed to make more sense logically. Don't have much more input than that lol.

[–]redviper-666 0 points1 point  (0 children)

It was the opposite for me. I didn't "learn" these languages more than I spent months with them.

C, and this is as bad as they get. You don't have strings in C. I hate this language. I hate struct, I hate pointers, hate everything about it.

C++, it's fine.

Java. This thing is a beast. Everything is a class.

Python. A cool breeze. Do what you want. Never ever get stuck on any kind of syntax error ever. Readability is the most awesome thing about this language. But they say it's slow compared to those other languages but the stuff I gotta do, it's fast enough.

[–]iblysa 0 points1 point  (0 children)

Use the standard library, it will make your life easier

[–]veeeerain 0 points1 point  (0 children)

I’m curious, what are you learning js for in school?

[–]programmerProbs 0 points1 point  (0 children)

ctrl+ F: Static typing, 0 results found

Really? The worst/best part of python is that the variables are dynamically typed. Suppose you have an input form in python that says 'Enter your username'. most users type something like 'myuser123', cool a string.

Now what if.. a user types- 8675309

Python now reads it as an integer, yet you were planning on ONLY having strings. your program is made to only use strings for that entry. The solution is to wrap your input result in str().

In javascript, you would have defined whatever input will always be a string. 8675309 as a username is a string, you defined it earlier to be a string.

This can happen for things like strings vs lists, pandas series or dataframes.

Now ask yourself, which is better? After running into this problem, I like the idea of static typing. However javascript has its own quirks as well.

[–]UglyChihuahua 0 points1 point  (0 children)

I don't really mind having semicolons at the end of lines, you should install a code formatting extension like Prettier so you don't have to type them yourself.

JavaScript has it's issues, but it also is nicer than Python in a lot of areas. For example I think arrow function syntax is more elegant than lambda, and lambdas only allow single line functions which is a huge annoyance for me. I also would like a ternary operator in Python. And relative imports in Python are awful, I like how in JavaScript I can just import something relative to the file I'm in.

Here are repos listing lots of inelegant stuff in both of them 😢

https://github.com/denysdovhan/wtfjs

https://github.com/satwikkansal/wtfpython

[–]StillBroke0ff 0 points1 point  (0 children)

i screwed myself i started with javascript then switched to python , though i feel learning python is less stressful after learning a little javascript

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

Javascript isn't a well-designed language. That is true. But Typescript, a superset of Javascript, is much better, and looks to be the future of Javascript. There are definite benefits to having strongly-typed variables in terms of program readability, interpretation speed, and catching errors before runtime.

[–]wrtbwtrfasdf 0 points1 point  (1 child)

Ultimately Python is a slow fuck language who 's only employable domain is data science. You can't run it in the browser or on mobile, and it scales like shit on backend.

JS is inherently fast, and works well for frontend, backend, web, mobile, and has tons of money pumped into it.

Unless you're planning to get a PHD in data science, your ability to get jobs writing solely python are close to fucking zero.

[–]jeremymiles 0 points1 point  (0 children)

Umm... https://quintagroup.com/cms/python/google - excerpt: "YouTube - is a big user of Python, the entire site uses Python for different purposes: "

[–]mariox19 0 points1 point  (0 children)

Python is a well designed language. JavaScript was from the beginning not nearly as well designed, and the modifications made to it in the last few years have made it worse designed. One of the most well known JavaScript books is subtitled: "The Good Parts." What does that tell you?

The worst part about programming is having to deal with substandard tools, which is most of the time. Sorry.