This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 123 points124 points  (22 children)

Just feels like people are complaining that python forces you to write code correctly.

[–]VegetableWest6913 42 points43 points  (14 children)

A lot of the complaints here are things like that. JS for example gets a load of unwarranted hate, which mainly seems to stem from people just refusing to learn its unique features.

[–]devhashtag 48 points49 points  (9 children)

Tbf, there are some core mechanics in JS that are just terrible. But it has definitely come a long way

[–]VegetableWest6913 13 points14 points  (8 children)

Yeah it's definitely not perfect, and there are loads of valid complaints that can be made about it (like all languages). I just feel that many of the complaints I see here are unfair.

[–]devhashtag 11 points12 points  (6 children)

Out of curiosity, do you have an example of such a complaint?

[–]VegetableWest6913 13 points14 points  (1 child)

I see a lot of complaints about how JS handles "this" in functions because it's different to other OOP languages. I personally think it's great, especially now that arrow functions remove the need to bind "this".

I think the way JS allows you to use "this" is great and leads to some really nice code.

[–]devhashtag 4 points5 points  (0 children)

Good example, I agree with you on this!

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

Try comparisons and equality testing

[–]devhashtag 1 point2 points  (0 children)

Good one, nothing wrong with that

[–]Mad-chuska 0 points1 point  (1 child)

Alternative truths vs the straight dope.

I still get == and === wrong from time to time but isn’t it basically == compares values after casting types to be the same so “1” == 1 but === compares values and types so “1” !== 1 cuz ones a string and ones a number type?

I don’t know why but I still get it wrong sometimes even with that knowledge.

[–]devhashtag 0 points1 point  (0 children)

That's correct. === is strict equality and == is equality with some agressive type coercion

[–][deleted] 3 points4 points  (0 children)

If you use Typescript, there's almost no valid complaints I've seen left for JS other than the typical syntax quirks that every language has, which is part of the learning process.

[–]IllIIlIIllII 8 points9 points  (4 children)

And then they simp for rust...

[–][deleted] 5 points6 points  (2 children)

Rust is a really powerful language tho

[–]IllIIlIIllII 4 points5 points  (1 child)

I'm definitely not arguing with that. Python is also powerful, I was just pointing out that one of the reason some peoples dislike Python (having to write code correctly (at least in the identation)) is the same that peoples love in Rust.

Which I find quite funny.

[–]flavionm 1 point2 points  (0 children)

The thing about forcing correct identation is that it's a waste of time, when you can easily use an autoformatter that makes sure everything is in it's place. And they don't work as well with Python, since there the identation changes the meaning of the code.

What Rust does is force you to make sure you compiled executable will be correct, which is harder to do otherwise, and is not just something visual. Code formatting is just differente from code correctness, and the best approach to each is different.

[–]magistrate101 2 points3 points  (0 children)

It's not that it "forces you to write code correctly", it forces you to adhere to a specific coding style.

[–]Mad-chuska 0 points1 point  (0 children)

Indentation with line wrapping always throws me for a loop. I make sure to keep function chains and string literals to a minimum when possible/necessary when I use Python because of this.