r/java • • Jun 10 '24

[deleted by user]

[removed]

616 Upvotes

594 comments sorted by

View all comments

Show parent comment

73

u/roberp81 Jun 10 '24

Javascript is the worst language you can use for anything.

22

u/qdolan Jun 10 '24

Maybe not the worst, but it’s right up there in contention.

5

u/ComfortablyBalanced Jun 10 '24

It is the worst modern language.

17

u/zappini Jun 10 '24

JavaScript is in an n-way tie for worst-place. It was born worse than wrong and then went downhill from there.

2

u/Misophist_1 Jun 11 '24

I could name a bunch of contenders:

  • COBOL
  • Next to all scripting languages, from DOS Shell to every *sh out there, including Power Shell. Only exception: REXX.
  • A number of long forgotten, vendor specific '4GL' languages, like CA-EARL and MANTIS and ABAP.

2

u/Beamxrtvv Jun 10 '24

Why?

11

u/duckrollin Jun 10 '24

Javascript is a dynamically typed language which means it's fast to write and less verbose but ultimately has more errors and bugs when it's run. It's also just object-based not object orientated leading to cowboys not designing software properly.

These things tend to encourage a less efficient and less maintainable codebase. Dynamic languages are the epitome of "let me just do this one small thing with a little scripting language" or "I just need this language to do some testing with", then when they become used for big projects it becomes a nightmare.

The problem is that lots of web devs only know javascript, so the idea of "lets do everything in javascript" is appealing to them as they don't need to learn a new language.

3

u/Beamxrtvv Jun 10 '24

Thank you for that last point! That is actually very insightful to me, I didn’t give enough credit to the idea of people just wanting to work with something familiar (hence how many new tools get created for JS). I appreciate you!

1

u/Windscale_Fire Jun 10 '24

It's actually very difficult (almost impossible?) to definitively say that any language A is "better" than any other language B. The majority of people making such prognostications are actually just espousing their personal preferences and subjective opinions.

a) If language A and language B are both Turing complete, then there's nothing in A that can't be done in B and vice-versa. (Now some people might perceive one language as being more suited to some particular use-case than another, but a lot of that is down to familiarity and is highly subjective.)

b) What do you even mean by better? Can you come up with a definition of what "better" means that you can get everybody to agree with?

c) If you could agree some measurable criteria that you were going to use to decide on "better", then you could try implementing in both languages and then comparing your measurements. The problem here is that any one team, or any two teams, or any n teams are unlikely to be equally skilled in both languages (and potentially platforms). So how much of any differences you measure are just down to the quality of the implementation in the two languages and how much is down to the intrinsic qualities of both languages? You can write rubbish code in any language.

So the idea of trying to find the "best language for any particular system" is a bit of hiding to nothing. The majority of the time, it's best is to choose the language the majority of the team are most comfortable with and you are already are set up to deliver in. Only look at other things if there appears to be compelling value in doing so and not just because you've become afflicted with space-cadet-syndrome and insist on chasing the latest shiny just for CV fodder.

0

u/[deleted] Jun 10 '24

[deleted] — view deleted comment

14

u/Yesterdave_ Jun 10 '24

Yes they are weird, but also not that important/hard if you have worked with the language. What I would consider a much bigger downside is the absolute sh*tshow that is NPM. I would never let that cr*p near a backend that has to be ROCK SOLID.

10

u/woj-tek Jun 10 '24 • Take My Silver

Yes they are weird, but also not that important/hard if you have worked with the language.

Well... you can get used to anything but it's nicer if the tool isn't actively trying to harm you? ;)

-3

u/Utnemod Jun 10 '24

Uhh based department?

1

u/roberp81 Jun 10 '24

all departament you like

0

u/[deleted] Jun 10 '24

[deleted] — view deleted comment

9

u/snark42 Jun 10 '24

In what way is JavaScript superior to Java/Rust/.Net/C++ for backend?

0

u/[deleted] Jun 10 '24

[deleted] — view deleted comment

8

u/diobrando89 Jun 10 '24

The JS package ecosystem is also much better than Java’s (npm/Yarn > Gradle/Maven)

In my life, I never would have expected to read a sentence like this.

0

u/[deleted] Jun 10 '24

[deleted] — view deleted comment

4

u/TheWaterUser Jun 10 '24

left-pad a string

import org.apache.commons.lang.StringUtils

What are the other 1000s of lines I need to write?

→ More replies (3)
→ More replies (1)

1

u/exploding_cat_wizard Jun 11 '24

No untyped language can beat a typed one for anything but tiny projects.