|
I'd upvote your post twice if I could.
I think another reason it got a bad rep is for years it was strictly functional back in the day... not procedural like C but functional more like F#. Technically you could do procedural in JS, but a lot the solutions to common problems used a functional paradigm. Functional languages and concepts just aren't as popular. So peeps would rather insult than learn. These days that's all changed though as you can do both OOP or functional.
For the types... totes get it. Personally I see value in using a loosely typed language. However, I also see the value in a strongly typed one. Fortunately these days, when you need strong types we have TypeScript and Flow.
Jeremy Falcon
|
|
|
|
|
Haters gonna hate buddy. Everyone who claims to be an expert at JS that hates is lying. It's more ego where they're fooling themselves than them actually being experts. Programmers aren't known for being mature and all.
Jeremy Falcon
modified 12-Jun-24 22:15pm.
|
|
|
|
|
Bah. I've been good enough at it to spot obvious idiocy from 'experts'.
It's a bad tech founded on bad principle with more bad practitioners than pretty much any other language you want to pick.
It will die. It may take a bit, but it will be an archaic relic in the dust bin of history and it will be consigned there inside half a decade once the right bits come along.
|
|
|
|
|
I'm absent minded, but I often spend hours debugging stupid things that C# would flag instantly. Also, the VSCode Intellisense and code navigation in JavaScript projects tend to be sub-par when compared to C# projects on Visual Studio.
|
|
|
|
|
A good, but old and oft repeated question about JavaScript (JS).
Most of those who make their living in the HTML/CSS/JS world span the spectrum of loving it to putting up with it in order to make a living. Like generations of developers before them, change is often resisted. There is nothing wrong with liking JS and wanting to stick with it. In past generations, FORTRAN, COBOL, QuickBasic, Visual Basic, Delphi/Pascal, etc. developers were in their "comfort zone", and did not want to learn new languages, frameworks, and newer ways to design software. What I write is not a criticism of those who like or want to stick with JS. It is an explanation of why many software engineers would like to move past JS to newer, better, technology.
To answer the question, there are several reasons some software engineers do not want to use JS unless they absolutely have to. It is not so much a dislike, but a growing realization that JS is not as suited for 21st century software development as newer, OO, compiled, languages that are designed for broader functionality or extensible to take on new functionality. Many software engineers don't want to be locked into older, less flexible, languages like JS when they can choose from multiple newer, better suited languages.
Here are a few of those reasons.
- JS is not object oriented (OO). OO design and programming has a lot of advantages over procedural languages like JS. Tools like TypeScript try to overlay some OO techniques over JS, but in the end, what is emitted from TypeScript is still non-OO JS.
- JS is a script language. It is not compiled but run by an interpreter. There are some tools that try to approach the benefits of compiling to machine code, or at least byte code for an intermediate just-in-time interpreter/compiler, but the execution speed of JS is slower than compiled languages, especially ahead-of-time compiled (to machine code) languages.
- While JS is supported well in the browser (with inconsistencies between browsers), running JS as a server-side language is slow and not designed for that. Compiled, OO languages work much better server-side.
- JS tends towards being cryptic, not as developer-friendly as modern compiled OO languages.
- JS was never intended to do a lot of what it does. In 1995, the beginning of the dot-com boom, Netscape assigned a programmer, Brendon Eich, to create a language for the Netscape browser to allow dynamic behavior that had Java-like syntax (which is mostly C/C++ syntax), but not derived from Java. Brendan Eich spent 10 days writing a language called LiveScript to do some basic automation in the Netscape browser. Netscape renamed it JavaScript for marketing purposes. Since 1995, JS has been patched and had other functionality hammered into it that is often kludgy and inefficient, since JS was not designed from the ground up to do what it does, or to be efficiently extensible.
There are some reasons why even those who prefer not to use JS will still use it.
- For simple, short, browser functions (e.g. onclick(), onblur(), etc.) involving the DOM, JS is still useful.
- During conversion of large web apps, keeping parts of JS may be useful to get the app converted in stages, until all or most of the JS is gone.
Here is an example of where one will see some of the JS/no-JS tension in software engineering today.
Several years ago, the need for faster-executing browser code was recognized, and the drive to create [^web assembly (wasm)] started by W3C. WASM was created with more careful engineering than JS was (not Brendan Eich's fault, he was under pressure from Netscape). Every major browser has a WASM engine in addition to its JS engine. WASM is byte-code compiled language for the browser, with all the safety protections the browser has in JS. Several modern OO languages compile to WASM as ahead-of-time (AOT) or just-in-time (JIT) implementations. Languages that can be compiled to wasm (not including experimental compilers or little used languages) are:
- C#
- C/C++
- Rust
- Go
- Java
- Kotlin
- Ruby
- Swift
JavaScript, however, due to its design and lack of OO, does not compile to WASM, though some are trying to find a way. However, the WASM engine in browsers does provide for JS interop so the language being used for WASM can call via interop out to execute JS in the JS engine. Keep in mind that interop, regardless of language, is usually noticeably slower than using the compiled code without interop.
Microsoft, for example, has implemented (without changing the W3C standard, for a change) WASM with their Blazor implementation. You write the HTML/CSS, but instead of JS, you can use C#. The HTML code recognizes C# methods and variables, so they are seamlessly integrated into HTML. Microsoft's implementation only replaces the parts of the compiled code that have changed since the last load, to reduce the bytes being sent to the browser. The tiny binaries that are downloaded by the browser on first use, for typical web apps, are about the same size in a lot of cases, as the JS downloaded by the browser on first use. The full .NET environment is not installed by the browser.
Other languages and tools have their own syntax and structure, but you still wind up with wasm in the browser, executing faster, more efficiently, just as safely, than using JS.
A long response, to be sure. But without getting into religious language wars, there are reasons to migrate from JS to a modern browser language like WASM. Apply good software engineering principles, and WASM in the browser is a good choice for small or large web apps. I've been writing WASM browser apps for about 3 years and love it. Change is a part of being a good software engineer over the timespan of a career.
See also [^Wikipedia article on WASM]
|
|
|
|
|
I agree with most of this with the exception of "Not OO". JS is not OO in the Data/Procedure or Data/Procedure/Relational (C++, C#, Java) sense. But it is OO in the Process/Message model. Though none of these are "Object Languages" that confirm to Classical Object Theory. Thus "Object-Oriented" and not "Object".
|
|
|
|
|
I never had much against it until, out of the blue, it was considered a serious programming language.
I mean I like to stick close to the metal as much as sanely possible (I constantly remind people C is a high-level language). That said, I know I'll have to relearn JS at some point in order to load WASM modules (written in whatever: LISP, C, RUST)
|
|
|
|
|
I really used to dislike JavaScript until I realized it was the engines/environments not the language itself that was the problem.
|
|
|
|
|
Wordle 1,089 4/6
⬜🟨⬜⬜🟨
🟨🟩⬜⬜🟨
🟩🟩🟩⬜⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,089 3/6*
⬜🟨⬜⬜🟨
🟨⬜⬜🟩🟩
🟩🟩🟩🟩🟩
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 1,089 4/6
⬜⬜⬜🟨🟨
🟩🟩⬜🟨⬜
🟩🟩⬜⬜🟨
🟩🟩🟩🟩🟩
|
|
|
|
|
⬜🟨⬜⬜🟨
⬜⬜⬜⬜⬜
⬜🟩🟨🟩🟨
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,089 4/6*
⬛🟨⬛⬛🟨
⬛⬛🟨⬛🟨
⬛🟩🟨🟨⬛
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,089 2/6
🟨⬜🟩🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
(12. Juni 2024) 5/6
⬛⬛⬛🟨⬛
⬛🟩🟨⬛🟩
⬛🟩⬛🟨🟩
🟩🟩⬛⬛🟩
🟩🟩🟩🟩🟩
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
Not playing since a good while but I didn't lose my touch
Wordle 1.089 3/6
🟩⬛⬛⬛⬛
⬛⬛⬛⬛🟨
🟩🟩🟩🟩🟩
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
The shortest horror story: On Error Resume Next
|
|
|
|
|
Wordle 1,089 4/6
⬛⬛⬛⬛⬛
⬛🟨⬛⬛🟨
🟨🟩🟨⬛🟨
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 1,089 3/6*
⬜⬜🟩🟩🟩
🟨⬜🟩🟩🟩
🟩🟩🟩🟩🟩
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|
Wordle 1,089 3/6
⬜🟨⬜🟩⬜
⬜⬜🟨🟩⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,089 6/6
🟨⬜⬜⬜⬜
⬜⬜🟨⬜⬜
⬜⬜⬜⬜⬜
⬜🟩🟨🟨🟨
🟩🟩🟨🟨⬜
🟩🟩🟩🟩🟩
Phew.
|
|
|
|
|
Nice resume. Mr Hendrix, but are you experienced?
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Great motivational speaker... really lit a fire under the team.
|
|
|
|
|
I know, it's a groaner. Jimi fan
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Imgflip [^]
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I'm obviously missing something here
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|