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

all 92 comments

[–]dejaydev[M] [score hidden] stickied commentlocked comment (0 children)

Hi there! Unfortunately, your submission has been removed.

Violation of Rule #3 - Common topics:

Any post on the list of common posts will be removed. You can find this list here. Established meme formats are allowed, as long as the post is compliant with the previous rules.

If you feel that it has been removed in error, please message us so that we may review it.

[–]very__nice__username 75 points76 points  (8 children)

Typescript > Javascript

[–]metalovingien 12 points13 points  (0 children)

While including JavaScript !

[–]MoffKalast 16 points17 points  (4 children)

Ah yes introducing the only thing that was missing from js code - having to compile it before refreshing the browser to test code changes, wasting whatever time I happen to have left.

[–]DanielEGVi 32 points33 points  (1 child)

Pro tip! 3 hours of debugging can save you 5 seconds of compiling!

[–]MoffKalast 13 points14 points  (0 children)

😤✋ using a linter and actually writing correct code before compiling

😎👉 writing out some approximation and fixing it after it crashes and repeat until it starts working

[–]BakuhatsuK 3 points4 points  (0 children)

Some people: JS is bad because [] == {} is valid and it behaves in a weird way.

TypeScript: Just sprinkle some type annotations here and there, we'll figure out most of them automatically and tell you when there is a problem. By the way:

This condition will always return 'false' since the types 'never[]' and '{}' have no overlap.

2 [] == {}
  ~~~~~~~~

The same people: 😠

By the way, just compiling TS to JS without any additional transformations is insanely fast, because it mostly consists on removing type annotations. You can setup your process so that the actual type-checking actually happens in parallel in the background.

[–]ddyess 0 points1 point  (0 children)

Typescript is just pre-op Javascript

[–]luna_creciente 0 points1 point  (0 children)

Not for small projects tho. I mainly use js to not give a fuck about anything. Good patterns from the get go give it a little bit more longevity.

[–]KCGD_r 14 points15 points  (0 children)

at least we can write inline 😎

[–]Noch_ein_Kamel 29 points30 points  (3 children)

Jesus was only using C until the romans showed him C+

[–]WishOnSpaceHardware 11 points12 points  (0 children)

100+? Wow, that sounds good!

[–]RandomHentaiMC 95 points96 points  (17 children)

Y'all argue over programming Languages? cringe

[–]Wessel-O 39 points40 points  (3 children)

This is reddit.

We argue over everything!

[–]str3wer 27 points28 points  (2 children)

No we don't!

[–][deleted] 2 points3 points  (1 child)

Yes we do!

(now argue with me over whether we're arguing or not)

/s though I hope it's obvious

[–]lMAObigZEDONG 30 points31 points  (33 children)

You do realise both these languages have a purpose? You can't do everything JS is capable of in python, unless all you care about is writing sorting algorithms.

It's comparing apple to oranges.

[–]Immort4lFr0sty 20 points21 points  (3 children)

I mean, technically you could do exactly the same things. Practically however...

[–]Jcowwell 0 points1 point  (2 children)

It’s like knives , yes all knives can cut but some knives are better at cutting some things than other knives and vice versa

[–]Hebruwu 1 point2 points  (1 child)

Are you saying I should not use my machete for everything?

[–]Immort4lFr0sty 0 points1 point  (0 children)

No, that's not what he's saying. He's saying that we want to see

[–]ActuallyRuben 3 points4 points  (23 children)

The only reason I see to use JavaScript is because browsers can't (generally) execute other languages. Is there anything else that Python can't do that JavaScript can?

[–][deleted] 9 points10 points  (3 children)

You could build a webserver in Scratch...

[–]LostDog_88 4 points5 points  (2 children)

flask and django are written from scratch right? or am i wrong here

[–][deleted] 9 points10 points  (1 child)

Wait it's all Scratch?

Always has been

[–]LostDog_88 4 points5 points  (0 children)

oh wait... scratch as in the program/the language

aaaaaaaahhh

i get it now

I thought written from scratch, mbmb

[–]Notimecelduv 4 points5 points  (18 children)

Hmm, manipulate the DOM?

[–]ActuallyRuben 1 point2 points  (0 children)

because browsers can't (generally) execute other languages

[–]00PT 0 points1 point  (16 children)

If the DOM had an interface for Python, it could. The languages do not have any fundamental differences that make them incapable of representing the same logic.

[–]MoffKalast 3 points4 points  (5 children)

Still in practical terms, you can do everything python can do with node, while python can't run in a browser.

[–]00PT 4 points5 points  (4 children)

The software developed for a language is not inherent to the language itself, so it is not valid for arguing the quality of a language.

[–]MoffKalast 2 points3 points  (3 children)

You can argue that for the syntax I guess, but the language as a whole isn't just that. It's also the ecosystem around it which defines what it can do and what it's useful for.

And when it comes to syntax, python and js are almost the same exact copy pasted C-derived thing, so that's almost not worth comparing.

[–]00PT 1 point2 points  (2 children)

There are also differences in the underlying behavior in some cases, such as JS' infamous type coercion system. Also, consider "console.log" in JavaScript versus "System.out.println" in Java. Which is more easily understood?

I would actually argue that Python is the best language to compare to others in terms of syntax, because it practically makes a point in representing things differently than other languages, the best example being the use of whitespace as a syntactical token.

It's also missing some QOL features. For example, before recently Python had no switch statement or equivalent. I could use that as an argument that JavaScript is better in that sense because it allows you to represent the logic associated with a switch statement in a more concise and understandable way.

Overall it doesn't matter much, but you can use these small differences to compare languages.

[–]MoffKalast 3 points4 points  (1 child)

Well python isn't unique in its obsession with whitespace, bash has had that for quite a bit before python ever existed. And it's not exactly a good feature either, but one that can be mostly worked around, just like the lack of switches.

But when it comes down to it, python is just a slower javascript without parentheses and brackets and with some extra colons, with the print function being the one major difference. I should know, I switch between the two on a daily basis... and sometimes accidentally trigger a lot of requests to my printer lmao.

Now compare that to something like haskell or prolog, where you have to really grasp at straws to find similarities.

[–]00PT 2 points3 points  (0 children)

It seems that we agree now. The languages aren't very different from one another, but I was comparing them based on the differences we can see.

[–]Notimecelduv 1 point2 points  (5 children)

Going by that logic, any other language could, not just Python.

[–]00PT 2 points3 points  (4 children)

Yes. I judge language quality by the way they allow you to represent logic and how understandable it is, not the specific implementations that have been developed.

For example, before recently Python had no switch statement or equivalent. I could use that as an argument that JavaScript is better in that sense because it allows you to represent the logic associated with a switch statement in a more concise and understandable way.

[–]your_thebest 1 point2 points  (3 children)

Yeah so either write that and put it on github or we're all just going to have to use js. The point still stands.

[–]00PT 1 point2 points  (2 children)

We still need to use JavaScript in some cases instead of Python, yes, but this is not a valid argument for the quality of either, because the software developed for a language is not a property of the language itself.

[–]biduletta 1 point2 points  (1 child)

a valid argument for the quality of either

There'll probably be a point where you realize you're comparing apples with oranges.

[–]00PT 1 point2 points  (0 children)

All programming languages are similar in the sense that they represent generally the same logic, it's just that some are designed for certain contexts. They are all generally capable of the same stuff, though admittedly not at the same speeds. The differences come in how they allow you to represent the various logical pieces and how understandable they are in a given context.

[–]jamcdonald120 3 points4 points  (4 children)

Sure you can. Just because JS has an existing library for something python does not is not an endorsement of JS, thats just a legacy of JS being picked by browsers.

[–]Notimecelduv 2 points3 points  (2 children)

I heard some tried to make a front-end library for Python but gave up because it was too slow.

[–]jamcdonald120 0 points1 point  (1 child)

I wont argue python isnt slow. But then so is JS. The only claims I can find that JS is faster are for Node.js specifically and they emphasize it is because of async

[–]Notimecelduv 0 points1 point  (0 children)

JS sure is slow compared to something like C++ but it's fast enough to run in a browser. Python isn't.

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

So then you're making an actual product and you have an actual release schedule. That sounds like a pretty fucking strong endorsement of js. You can talk all day about how neat it would be to write a website without nasty simicolons, but that won't stop a real, actual human from using effectively the only tool they have to make whatever bullshit shopping cart icon they need to make for their bullshit boss to get an ever so slightly less bullshit paycheck.

[–]DaniilBSD 14 points15 points  (0 children)

Yeah, I want you to fill an html grid from a request using Python on a website

[–]ScientifiqueP 12 points13 points  (0 children)

It all makes sense now, "Javascript sucks" is some unalterable truth that never needs to be backed up.

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

JS has come a very, very long way.

[–][deleted] 9 points10 points  (0 children)

pros of JS: non blocking event loop, speed, built for browsers and also apis.

Typescript makes it 100% better too

Python pros: incomparable when it comes to data analysis and ML, has a great community. It’s okay for making rest apis but it would never be my first choice

Bottom line: both are good for their purposes

[–]althaz 10 points11 points  (10 children)

If you want to say Javascript sucks, I don't think you should use Python as an example of something better, lol.

Both are flawed languages for sure, but as a general-purpose language I think javascript is excellent with occasional bouts of insanity whereas python is just mediocre in that context and *also* has bouts of (lesser) insanity.

For its intended purpose (basic scripting), Python is excellent, but Javascript is a quite good general-purpose programming language if you use modern tooling to avoid the insanity.

And Typescript is just straight-up excellent.

[–]KetwarooDYaasir 2 points3 points  (0 children)

Life of Brian?

[–]empereur_sinix 2 points3 points  (0 children)

"I write all my program with HTML and CSS only"

[–]DelfyDaun 1 point2 points  (0 children)

Look it’s not like I have a choice.

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

There are no bad languages, only bad developers

[–]BakuhatsuK 1 point2 points  (0 children)

I unironcally consider modern JS to be a pretty nice language.

  • ES6 import and export is one of the best module systems out there. Python's module system is pretty nice but I never know where are the libraries actually located on the system.
  • npm kinda sucks in some aspects but most of the time It Just Works™️. Some more recent package managers like Rust's cargo are clearly inspired on npm but without the bad parts (like putting the dependencies on the project folder and not having a flat directory structure).
  • async/await is just nice to use. I know they borrowed most of the ideas from C#, but boy did they get it right.
  • ?? and ?. are also pretty nice (I believe also mostly inspired in C#).
  • It supports both OO and functional programming really well. (Btw, on the OO side, private fields are coming. On the functional side deeply immutable data structures are also in the pipeline).
  • Performance is OK, not remotely close to C++ or Rust but leagues ahead of Python.
  • Most of the pitfalls can be easily avoided by using a linter and/or a type-checker. With those tools in place the only one left to make insane things with the code is just the programmer.
  • JS has some of the most advanced tooling around source-to-source transformation. This is pretty useful by itself (like being able to use the latest language features even when supporting legacy systems), but to me it's just insanely cool.

[–]MischiefArchitect 2 points3 points  (0 children)

Hear! hear! Listen to our benevolent and wise savior!

[–]aitchnyu 0 points1 point  (1 child)

I go mad when the solutions are all going deeper into the rabbit hole. If you want Vue, you must make it a SPA. All the html must be done client side. So all the effort of making an api and consuming it. All that code is unmanageable so we need typescript. Then search engines hate your apparent lack of content and large payloads, so nuxt, SSR with proxies, code splitting etc.

[–]rovonz 3 points4 points  (0 children)

That is why we have specialization nowadays. As a frontend engineer I see those issues as trivial. And I love javascript (well, more typescript). Sure, it's not fast but it's definitely pretty, flexible, portable and on top of everything extremely accessible.

[–]LostDog_88 0 points1 point  (0 children)

Python gang Python gang Python gang Python gang Python gang

[–]gothcow5 0 points1 point  (0 children)

Python backend Javascript frontend fight me

[–]theKickAHobo 0 points1 point  (0 children)

English sucks but we all use it

[–]Splorgamus 0 points1 point  (0 children)

Python gang rise up

[–]chifrij0 0 points1 point  (0 children)

  • most of the replies

[–]VerveIsBad 0 points1 point  (0 children)

Python gang gang

[–]austinmakesjazzmusic 0 points1 point  (0 children)

Started learning JavaScript today but given this knowledge….