dis_honestfamiliar@lemmy.world
on 30 Jul 2024 02:48
nextcollapse
I wish death upon it, but it just won’t die. I guess that’s cuz it’s the only frontend. Or at least the only frontend that allows DOM manipulation.
atzanteol@sh.itjust.works
on 30 Jul 2024 02:58
nextcollapse
That’s exactly it. Every single webapp in the world has some level of javascript in it.
masterspace@lemmy.ca
on 30 Jul 2024 03:27
nextcollapse
It’s because it’s a great language. Legitimately cannot understand why anyone would dislike it, especially with the the ES5+ editions and the advent of Typescript.
I started with C#, and have used Python, Java, PHP, and Ruby in professional capacities and still find Typescript to be my favourite by a significant margin.
AlecSadler@sh.itjust.works
on 30 Jul 2024 04:39
nextcollapse
I worked for a company that refused to use TypeScript because it “slowed devs down”. It was…a laughable period in my life.
pkill@programming.dev
on 30 Jul 2024 07:38
nextcollapse
typescript is a linter
count_dongulus@lemmy.world
on 30 Jul 2024 07:47
nextcollapse
Which is faster, getting a squiggle instantly or discovering a silly bug at runtime later? So happy I could write code in Typescript and be confident it would do what I expected when it ran without digging out the debugger.
GissaMittJobb@lemmy.ml
on 30 Jul 2024 16:00
collapse
While the rest of the world shifted left dudes went ahead and shifted right
arendjr@programming.dev
on 30 Jul 2024 05:52
nextcollapse
As much as people like to make fun of JS/TS, I think you’re right, especially compared to the languages you mentioned. It’s my second-favorite language after Rust.
I think I would put Swift above it as well, except I don’t really use it since it’s too domain-specific in practice.
leisesprecher@feddit.org
on 30 Jul 2024 06:56
collapse
The newest iteration of the language might be okay, but the ecosystem is an absolute mess.
Working with npm projects is always a pain, everything changes all the time for no reason, and often enough in subtle ways you can’t anticipate.
Plus, there’s just an army of not very good and/or inexperienced developers vomiting their incompetence into the ecosystem.
Languages are not isolated. Java doesn’t force abstractFactoryBuilders, yet hundreds of developers follow that pattern. So Java in practice is rather verbose.
count_dongulus@lemmy.world
on 30 Jul 2024 07:45
nextcollapse
The language and its standard libraries lead developers towards common patterns. Javascript’s standard library is pretty sparse excluding browser-only web apis, so there are tons of external libraries to fill the gap for better or worse.
masterspace@lemmy.ca
on 30 Jul 2024 13:33
nextcollapse
Languages are not isolated. Java doesn’t force abstractFactoryBuilders, yet hundreds of developers follow that pattern. So Java in practice is rather verbose.
Java basically does because it did not support functional programming forever forcing most of the base standard libraries to eschew those patterns (looking at you spring), and because even today it does not treat functional programming as first class and it is difficult to accomplish the same things with it then with other languages.
It is also missing many extremely common shorthand syntax expressions like optional chaining.
leisesprecher@feddit.org
on 30 Jul 2024 14:27
collapse
Not really, no. The over-abstraction Java is often doing is a question of mindset. Java devs tend to be very keen on reusability , which is fine, but often enough the result is unusable.
The problems behind abstractFactoryBuilders are not inherently unsolvable without these constructs, it’s just that Java devs chose this rather weird approach.
arendjr@programming.dev
on 30 Jul 2024 14:02
collapse
I absolutely agree with you. If I can avoid NPM I will indeed do so. Sometimes that means using Deno, but sometimes it can be a valid reason to avoid using the language altogether. And sometimes we have to suck it up 🤷♂️
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 09:31
nextcollapse
People dislike JS because it’s packed full of moronic footguns and technical debt. The “standard library” is full of baffling decisions and, much like the language, rarely does what you expect. Even its creator agrees it’s a terrible language and should have been replaced by now.
TypeScript is better, but at the end of the day it’s just an illusion. Add an any anywhere, which will happen, and you’re back to square one. It also still inherits some of the weirdness of JS, because it is just JS with fake types bolted on. Plus, the amount of work one has to do to create a proper library with TypeScript support completely undermines the few advantage of JavaScript. Might as well use a real statically typed language at that point, at least you’d be sure your types are actually enforced.
Also, the whole web ecosystem is ass.
The hoops one has to jump through nowadays to do web development are absolutely batshit crazy. And no, having a create-whatever that sets things up for you is not a real solution.
masterspace@lemmy.ca
on 30 Jul 2024 13:23
nextcollapse
People dislike JS because it’s packed full of moronic footguns and technical debt.
Lol, no it’s not. The literal only footgun is the truthiness aspect of equality and using ===, and it’s really not hard to figure out and avoid. Especially given that linters will automatically flag it for you.
TypeScript is better, but at the end of the day it’s just an illusion. Add an any anywhere, which will happen, and you’re back to square one.
It is extremely easy to not let any slip into your code, you do this little thing called review code before merging. Crazy, I know, but by just following the most basic software development practices it turns out you can also avoid other basic junior mistakes! Wild right?
And lmao, oh my god the web ecosystem is ass because a framework for producing robust complex applications isn’t just an html and CSS file? Lmao bruh, tell me you’ve never coded in a different language without saying you’ve never coded in a different language. You think a .csproj or a .gradle file is simpler and more intuitive?
You’re mistaking basic junior programming mistakes for issues with the language.
Feathercrown@lemmy.world
on 30 Jul 2024 13:54
nextcollapse
THANK YOU
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 14:38
collapse
Lmao bruh, tell me you’ve never coded in a different language without saying you’ve never coded in a different language.
I’ve been a software developer for over 10 years, on both on the front end and the back end.
I’ve worked with jQuery, React, plain old DOM manipulation, god damn PHP. I’m not new to web development.
Outside of web technologies, I’ve worked on nautical charts processing software and microcontroller firmware in C, C++ and Rust.
I’ve worked on native GUI applications with C++, Java and C# using JavaFX, WPF, GTK, Qt.
All under strict corporate standards.
I also work on compilers and rendering engines in my spare time.
So no, I’m not a “junior programmer” making “basic junior programming mistakes”. Your favourite language is ass.
You shouldn’t immediately jump to the conclusion that someone has never written a line of code only because they say so.
Sorry if it hurts your feelings, but even senior developers, web or otherwise, say it. I’m not the one swimming against the current, you are.
And lmao, oh my god the web ecosystem is ass because a framework for producing robust complex applications isn’t just an html and CSS file?
Alright, let’s do a little experiment, shall we? Let’s try and create an empty electron app with React and TypeScript.
A quick create-electron-app and some configuring TS, ESLint and WebPack later we reach a whopping 3_087_725 lines of code. 3 million lines. ~700MB.
This all requires a linting step, a pre-compilation step though tsc, multiple additional translation steps through webpack for older ES versions.
All of that for an empty page on a webview.
This is batshit crazy. And I come from fucking CMake for crying out loud.
There is nothing robust about this, the slightest misstep and your sourcemaps are fucked.
Whoops the author of left-pad decided to pull it from npm - half the JS ecosystem on its knees.
Whoops the author of is-even one day decides it’s a stupid package to need - half the JS ecosystem on its knees.
Web developers are standing on a crumbling, fermenting pile of shit. Get over it.
…
With that said, you can still enjoy JS and all the web stuff, there’s nothing wrong with that…
masterspace@lemmy.ca
on 30 Jul 2024 14:44
collapse
Sorry if it hurts your feelings, but even senior developers, web or otherwise, say it. I’m not the one swimming against the current, you are.
Lmao bro, I don’t think I’m the one with hurt feelings given your unhinged credential boasting and several paragraphs of unprompted bitching about electron.
You make basic JavaScript mistakes that should be caught by linters, and certainly by any intermediate to senior level reviewer. Get over it and learn to be better and not make basic mistakes.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 15:07
collapse
You seem to confuse “people making mistakes” with “a language that is designed in such a way that those mistakes are not only common, but integral part of the experience.”
I’m not saying I make such mistakes, I say the design is crap. It’s not a skill issue, it’s a design issue.
People say null pointers were a mistake. I’m inclined to agree. Not because I get a null pointer exception every five minutes, but because there are better ways to handle cases like that.
You said I was a rookie, I proved you wrong.
You said there was nothing crazy about web application complexity, I provided you with a common, glaring example. There’s nothing unhinged in saying “look I installed Electron and React and not my project has 3 million lines of crap I have to worry about”.
Everything else was just emphasis for the sake of it.
But when you don’t have a valid argument, you resort to personal attacks. Maybe it’s you that should learn to be better.
urshanabi@lemmygrad.ml
on 30 Jul 2024 15:35
nextcollapse
Hi, I don’t really code besides computation stuff in Python. You seem to be really knowledgeable, could I ask, what does the future of the web look like? Is it Rust and WASM? Or will JS and TS always have a place even a decade from now?
BatmanAoD@programming.dev
on 31 Jul 2024 03:32
collapse
The fairly unique thing about the web is that the tech stack is pretty much entirely dependent on what browsers are “winning” at any given time. There are web standards, but Chrome steamrolls them regularly (either by ignoring them or by pressuring the committee to standardize what they want). This is why browser monoculture is bad, and why people recommend Firefox and other non-Chrome (or really, non-WebKit) browsers, as a matter of principle.
So right now, with Chrome’s dominance, Mozilla’s struggles, and the extremely slow progress of WebAssembly and WASI, it definitely feels like JavaScript will remain dominant for a long while. But since Chrome does support WebAssembly and Google participates in WASI, and since there’s no fundamental reason why WASI can’t eventually provide everything that JS does today, there’s good reason to expect the JS stranglehold not to last forever.
And the great thing about WASM/WASI is that, since it’s designed as a compilation target rather than a language, there won’t be any remaining reason for a single language (such as Rust) to dominate. Rust got an early lead in WASM because they put the effort into making it a viable target platform for the compiler, and because it’s the kind of language that attracts people who dislike JavaScript (such as myself). But there’s no reason a different language couldn’t rapidly become the most commonly used WASM language if, say, a web framework in a previously-niche language becomes popular. (After all, Rails, a back-end framework, is what popularized Ruby.)
masterspace@lemmy.ca
on 30 Jul 2024 16:47
collapse
I’m not saying I make such mistakes, I say the design is crap. It’s not a skill issue, it’s a design issue.
That’s what people with skill issues tend to say.
You learned how to write == in every other language, but you can’t figure out === in typescript?
You’re bitching and whining about a tiny syntax issue that enables backwards compatibility for literally every web site ever created.
You said I was a rookie, I proved you wrong.
You apparently still bitch and whine like a rookie. Maybe work on your emotional maturity if you want to come across as an experienced senior and not just a Reddit-read edge lord.
You said there was nothing crazy about web application complexity, I provided you with a common, glaring example.
No, you didn’t.
There’s nothing unhinged in saying “look I installed Electron and React and not my project has 3 million lines of crap I have to worry about”.
Yes, there is, given that the vast majority of web applications run in this thing called a web browser, and you decided to instead choose the project example where you install a whole web browser alongside operating system shims into your project.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 18:05
collapse
That’s what people with skill issues tend to say.
Not that’s what people who can recognize genuine architectural defects and aren’t blind fanboys say.
You apparently still bitch and whine like a rookie.
Only to your eyes since apparently pointing out genuine problems is whining. It’s okay for people not to like the stuff you like. And no, using a few swear words for emphasis doesn’t make someone immature, nor does listing what one has worked with for context.
You learned how to write == in every other language, but you can’t figure out === in typescript?
…you still haven’t realised that === is not what I have a problem with have you? It’s literally a non issue. In fact, equality in general is a non issue. It’s the wonky standard library, lack of proper support for binary operations, serialization and almost everything being an afterthought that I have a problem with.
Does it prevent me from using the language and write proper, stable software? No. But it’s not good.
you install a whole web browser alongside operating system shims into your project
Except that amounts to a mere ~180_000 lines of the 3 million. Did a plain create-react-app without Electron, still over 3 million.
Now, since it’s impossible to have a genuine conversation if the other party’s response is “haha you suck” to any genuine, documented criticism, are you gonna grow up or are you gonna keep acting like an offended 13 year old who can’t find a better retort?
masterspace@lemmy.ca
on 01 Aug 2024 14:11
collapse
Not that’s what people who can recognize genuine architectural defects and aren’t blind fanboys say.
That’s what people say to people who don’t raise valid criticisms but just go on unhinged rants about how credentialed they are.
…you still haven’t realised that === is not what I have a problem with have you? It’s literally a non issue. In fact, equality in general is a non issue. It’s the wonky standard library, lack of proper support for binary operations,
Wonky standard library? Name your issues.
Lack of proper support for binary operations? Like Jesus Christ you also frustrated by a lack of direct access to the assembly instruction set? Do you know why those arent properly supported? Because it doesn’t come up for 99.99% of software developers, and for those who do need to do bitwise math and manage memory directly, you have the entirety of Web Assembly available to you.
serialization and almost everything being an afterthought that I have a problem with.
As opposed to other languages where the entire concept of functional and async programming were implemented after the first version? Name your specific criticism of how JavaScript implements serialization that you don’t like.
Except that amounts to a mere ~180_000 lines of the 3 million. Did a plain create-react-app without Electron, still over 3 million.
Who the fuck cares? Do you know how much easier it is to parse through and find a problem in 3 million lines of JavaScript code then it is to try and figure out what part of the millions of lines of closed source compiled code that make up Java or C# or whatever other language you like?
You’re also using a deprecated project, and you’re checking against the dev version with dev dependencies, not the final minified version. Oh my god look at how big this Java project is before I compile it, what a nightmare!!1!1!1!
You’re the one who came into this thread bitching like a Reddit edge lord about the most popular language and the most successful cross platform development platform in the entire history of programming, I’m the one saying it’s no worse than any other major languages and is better than many of them.
But no, I’m sure it’s the millions of successful developers and users who are wrong. Everything is shit but you amirite?
shy_mia@lemmy.blahaj.zone
on 01 Aug 2024 15:30
collapse
Oh my god look at how big this Java project is before I compile it, what a nightmare!!1!1!1!
When shipping to customers, all code is your responsibility, dependency or otherwise. A bug or a security vulnerability, which aren’t rare in the JS ecosystem, is your responsibility whether you wrote the code or not. Customers don’t care if someone else wrote it, it’s your product, you are to blame.
Thus, the less code, the better. Less moving parts also means more stability in general.
the most popular language and the most successful cross platform development platform in the entire history of programming
But no, I’m sure it’s the millions of successful developers and users who are wrong.
People can be successful with things that aren’t perfect. It’s often a matter of being the first, not being the best. Something can be popular and still not be good, momentum is hard to stop. If JS’s own creator saying so in the last few years can’t convince you of that, I don’t know what will.
Flash at one point was the most popular. It was still flawed, and a liability, but I bet that doesn’t hurt you as much to hear.
Everything is shit but you amirite?
Quite the contrary. I have flaws like everybody else, but at least I don’t deflect every single criticism of stuff I like because in can’t fathom it not being perfect. It’s fine, use it. Maybe one day you’ll find a platform that’ll make you realize there’s better stuff out there.
But I’m done arguing with you. I should have known by the tone of your first reply that this wasn’t going to be a real discussion, just you being butthurt because someone said something negative about your favourite language. Go get butthurt somewhere else.
masterspace@lemmy.ca
on 01 Aug 2024 21:41
collapse
You still havent actually articulated a single criticism that’s not a vague generality, after coming in like an edge lord ranting about it like it’s the devil spawn.
And yeah bud, all the code you ship is your responsibility, which is why building on open source code that you can fix whenever you need is far preferable to building on a closed source compiled black box like most languages.
People can be successful with things that aren’t perfect. It’s often a matter of being the first, not being the best. Something can be popular and still not be good, momentum is hard to stop. If JS’s own creator saying so in the last few years can’t convince you of that, I don’t know what will.
Flash at one point was the most popular. It was still flawed, and a liability, but I bet that doesn’t hurt you as much to hear.
Lmao, one salty dev, vs the literal millions of seniors developers and fortune 500 companies who disagree and choose to use it.
Again, if it’s a liability name how, if your argument is “oooo open source scary, there’s no way to verify it, I’ll trust Oracle to give me a closed source compiled library that’s sure to be flawless”, I’m going to laugh in your face. Supply chain attacks are a problem, they are not an unsolvable one or even a particularly difficult to address one compared to the benefits of open source.
Quite the contrary. I have flaws like everybody else, but at least I don’t deflect every single criticism of stuff I like because in can’t fathom it not being perfect. It’s fine, use it. Maybe one day you’ll find a platform that’ll make you realize there’s better stuff out there.
Try and quit bitching about tone and vague bullshit you heard on Reddit and articulate an actual real world problem that you have with it on a day to day basis. You came in here screaming it’s shit like the devil’s spawn, all I’ve done is ask you to explain why and point out why issues like equality comparison, converting to 32bit for bitwise operations, and it being open source, are not big deals for most devs.
Feathercrown@lemmy.world
on 30 Jul 2024 13:53
collapse
Also, the whole web ecosystem is ass. The hoops one has to jump through nowadays to do web development are absolutely batshit crazy.
I don’t recall the experience being even equally pleasant in other languages, let alone better.
amju_wolf@pawb.social
on 30 Jul 2024 14:45
nextcollapse
For all the hate PHP gets (or used to get) it’s ecosystem is amazing. And so is the language and standard library itself for the most part. It still inherits some of the original issues, but a lot of work has been done to minimize them.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 15:09
nextcollapse
It definitely isn’t in some circumstances.
Frankly I’d put C/C++ in a similar category when it comes to compilation.
Dealing with Make, CMake, linkage and all that can be a nightmare.
The ecosystem is a little bit better though in my opinion. If nothing else you get a proper standard library and don’t have to rely on thousands of dependencies to get anything done… or you often roll your own if you are in C… which is meh.
I find Rust, C#, Go and anything slightly more modern to be a great or at least good experience.
Python as well if you use venv and your runtime and package versions align.
My point is, there is no perfect platform and ecosystem, but the web is generally regarded as one of the poorest.
I’m not saying someone can’t enjoy working on web stuff, they most certainly can. But it is objectively overcomplicated.
Feathercrown@lemmy.world
on 30 Jul 2024 15:34
nextcollapse
I won’t argue that the web is complicated, but a lot of that complexity comes from the necessity of supporting so many different environments that you can’t control.
I’d also like to ask when the last time you used JS was-- we use one UI framework (Angular) but no lodash, jquery, etc. to provide library functionality. Everything’s just built into JS now.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 15:51
nextcollapse
I had to go back to working with React just recently.
I’m technically using TS, but the standard library is the same anyways. It hardly has everything imo.
It does have what it needs to interface with the browser, and quite a few -sometimes poorly thought out- facilities, but not much more.
Don’t get me wrong, for a web scripting language it’s plenty, but if one wants to use JS for stuff that isn’t just putting a simple page on a screen, that’s not enough.
Maybe you mean Node instead of JS?
Feathercrown@lemmy.world
on 30 Jul 2024 16:13
collapse
What kind of standard library features are you looking for that don’t exist?
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 16:26
collapse
Anything that isn’t plain web browser stuff.
You can’t write files without Node specific APIs.
You can’t even do proper bitwise operations because everything’s a float.
Binary serialization is a pain and proper deserialization in general is not enforced, even in TypeScript, because types are an illusion.
Up until recently there were no synchronization primitives, though now the idea of having them in JS seems terrifying.
There are no other data structures than arrays and maps, which are often not enough.
It’s just not a language I’d use for anything more than… well… Scripting.
But even though other, better solutions exist for cross platform development, people insist on using JS, so here we are.
Feathercrown@lemmy.world
on 30 Jul 2024 17:27
collapse
You can’t write files without Node specific APIs.
You seem to be confused about what JS is. It’s a high-level interpreted language. It’s not C. Of course it can’t open files. Can you imagine if any webpage could open files on your PC? This is like asking why Rust doesn’t have a certain Blender shader node or Scratch block. The language fundamentally doesn’t include those concepts directly. As an interpreted language, of course JS is going to access OS APIs through its host program. If the concern is that the APIs aren’t standardized-- well, yeah, that’s true. Although the basic stuff (file I/O) is included in runtimes directly.
You can’t even do proper bitwise operations because everything’s a float.
Is there something I’m missing here? Why would you expect to be able to do bitwise operations on floats and get a sensible value? And if you want to do integer bitwise operations… you still can? Just use integer values and the bitwise operators? If you’re complaining that you can’t be sure if a number is an integer, that’s 1. a separate issue, bitwise operations still work fine, and 2. easily solved.
Binary serialization is a pain and proper deserialization in general is not enforced, even in TypeScript, because types are an illusion.
Have you looked at the bit arrays JS has now?
Up until recently there were no synchronization primitives, though now the idea of having them in JS seems terrifying.
Do you require multithreading for a language to be considered “good enough”? Why complain now that JS does have these abilities?
There are no other data structures than arrays and maps, which are often not enough.
This is patently false. JS has sets, maps (actual ones, not objects like you were referring to), etc. We’re soon getting records and tuples. If you want to build a linked list in JS, you do it the exact same way as you would in any other language. Not that it would be very useful.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 22:32
collapse
Is there something I’m missing here? Why would you expect to be able to do bitwise operations on floats and get a sensible value? And if you want to do integer bitwise operations… you still can? Just use integer values and the bitwise operators?
No that’s my point. You can’t, because there’s no such thing as an integer value. It’s all floats, always. They get casted to integers, the binary operation is done, then they get converted back to floats. That’s a lossy process, so some binary operations with certain values are simply not possible and you get weird results. The max width of an integer you can store is 53 bits, the maximum addressable width is 32 bits for binary operations. That’s wonky.
This is patently false. JS has sets, maps, etc…
Ah yes I forgot sets. But I don’t think there’s anything else? Last time I checked there were no binary trees, no proper (ring buffer) queues, no ordered sets, but I may be wrong on that. It’s not enough imo for a proper standard library.
For everything else:
My point is that JS is an okay scripting language for the web. As I said, for that it’s perfectly fine, though the frameworks are often lacking imo.
But there is this tendency to use it to create backends, desktop applications and tooling. That’s where the language falls apart, because it’s not made for that. It needs to be more robust, well defined and fully featured to be used in those contexts, both in terms of JS itself, and its standard library. Same with TS.
You seem to be confused about what JS is. It’s a high-level interpreted language. It’s not C.
I know and that’s the point. It’s underspecified for things outside the web, so it’s terrible for those use-cases. You can make it work for Node, but not for Bun or any other runtime. And even then, the experience is acceptable at best.
I personally would never use it for such use-cases, but people keep touting it and TS as these amazing general purpose languages you can do anything in. You can, but you really shouldn’t.
Feathercrown@lemmy.world
on 31 Jul 2024 03:14
collapse
You can’t, because there’s no such thing as an integer value. It’s all floats, always.
But you can. Any number that precisely represents a 32-bit integer can be used with binary operations as if it was one, and there will be no loss of information or unexpected results. Is it weird that JS has no integer type, or that its max safe integer representation caps out at 2^53? Yes, but that’s not the complaint you made. Binary operations work literally perfectly as expected for any inputs that have the appropriate type. Actual float values are truncated, which fits the language design.
Ah yes I forgot sets. But I don’t think there’s anything else? Last time I checked there were no binary trees, no proper queues, no ordered sets, but I may be wrong on that. It’s not enough imo for a proper standard library.
I’m sure you’re aware of push, pop, shift, and unshift, which together can make a FIFO or FILO structure, or a more complicated one, from an array. If you’re using TS you could create a semantic type that only allows a subset of these operations. I will concede that we have no tree type, although I’m not sure if that’s standard in other languages? I haven’t needed to use one myself.
Anyways, I won’t fight you on JS being overused. I will say that it’s flexible enough that it can be used in any way, even if it’s not the greatest idea. Something like embedded programming or safety-related things shouldn’t use JS. And as you keep mentioning, it wasn’t made for low-level stuff, although it can do it. I don’t think that’s a requirement for a stdlib though.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 15:55
collapse
I can understand accounting for different environments. That’s unfortunately unavoidable. But I found web framework developers in particular have a weird tendency of piling up ungodly amounts of abstractions just for the sake of it.
It’s kind of a cultural problem in modern software development in general imo. It’s not limited to web dev by any means, but it’s particularly bad there because JS lends itself to it quite well.
Feathercrown@lemmy.world
on 30 Jul 2024 16:13
collapse
I ❤️ abstraction. I’m an abstractionpilled layercel. I’m in my abstracting era.
shy_mia@lemmy.blahaj.zone
on 30 Jul 2024 16:27
collapse
Ah that’s fine. There’s nothing wrong with abstraction, until it becomes too much.
Feathercrown@lemmy.world
on 30 Jul 2024 17:07
collapse
Day 43. My tech stack has breached the clouds. I can no longer see the ground. I fear that I will not be able to return to the surface.
sukhmel@programming.dev
on 31 Jul 2024 16:33
collapse
You will not, indeed, it’s going to be abstractions all the way down from now on
Feathercrown@lemmy.world
on 31 Jul 2024 16:44
collapse
C# with the M$ echosystem sucks ass though. It’s like at first wow nice language, now how do you do this or that basic stuff and it’s just crap.
I want a Map. map map; ? Oh no ; Map map=new(); ???
Where are the destructors?
Etc.
I get the feeling it’s too steered by the corporate and not enough open source.
ZarkleFarkle@sh.itjust.works
on 31 Jul 2024 22:11
collapse
I think it probably could be, in Lisp. Like the one they used in early MIT computer labs (Scheme).
Many of the best ever known programmers came out of MIT computer labs, and for good reason.
Feathercrown@lemmy.world
on 01 Aug 2024 00:31
collapse
Lisp on the web is a fascinating alt history scenario
ZarkleFarkle@sh.itjust.works
on 01 Aug 2024 01:28
collapse
Yes. And I want academics online like Matt Parker to discuss it with me.
Feathercrown@lemmy.world
on 30 Jul 2024 13:50
collapse
B-b-b-but you can’t do that!!1! What if my customer wants to calculate 5+“three”*[] ???
jimmy90@lemmy.world
on 30 Jul 2024 09:26
nextcollapse
thanks to wasm any language is a browser running language. JS is relegated to some token binding boilerplate as part of any framework and with things like servo/tauri rendering html will be pure rust
coloredgrayscale@programming.dev
on 30 Jul 2024 16:12
collapse
thanks to wasm any language is a browser running language.
Theoretically yes, practically you may have to deliver a whole runtime depending on the languagey making websites even bigger and slower to load initially. And unless it’s a webapp with data processing on the client the perceived performance benefits may be negligible.
dis_honestfamiliar@lemmy.world
on 31 Jul 2024 22:44
collapse
Document ObjectModel. Think using code to add a JavaScript to make a drodown menu appear like for a navigation bar. That would be manipulation. And I think there’s so much more Angular and React do with DOM that I don’t know enough to explain it.
pkill@programming.dev
on 30 Jul 2024 07:37
collapse
wonder when Rust will saturate it’s niche as a C/C++ replacement, I’d guess 3-6 years would be when we might start to see some stabilization.
PlexSheep@infosec.pub
on 30 Jul 2024 16:14
nextcollapse
What exactly do you mean with stabilization? Rust itself is pretty stable already.
BatmanAoD@programming.dev
on 31 Jul 2024 03:19
collapse
In this context, stabilization refers to the adoption growth curve flattening out.
FizzyOrange@programming.dev
on 31 Jul 2024 06:50
collapse
I think it will take much longer than that. There is so much legacy C++ code. Maybe 10-15 years.
threaded - newest
I wish death upon it, but it just won’t die. I guess that’s cuz it’s the only frontend. Or at least the only frontend that allows DOM manipulation.
That’s exactly it. Every single webapp in the world has some level of javascript in it.
It’s because it’s a great language. Legitimately cannot understand why anyone would dislike it, especially with the the ES5+ editions and the advent of Typescript.
I started with C#, and have used Python, Java, PHP, and Ruby in professional capacities and still find Typescript to be my favourite by a significant margin.
I worked for a company that refused to use TypeScript because it “slowed devs down”. It was…a laughable period in my life.
typescript is a linter
Which is faster, getting a squiggle instantly or discovering a silly bug at runtime later? So happy I could write code in Typescript and be confident it would do what I expected when it ran without digging out the debugger.
While the rest of the world shifted left dudes went ahead and shifted right
As much as people like to make fun of JS/TS, I think you’re right, especially compared to the languages you mentioned. It’s my second-favorite language after Rust.
I think I would put Swift above it as well, except I don’t really use it since it’s too domain-specific in practice.
The newest iteration of the language might be okay, but the ecosystem is an absolute mess.
Working with npm projects is always a pain, everything changes all the time for no reason, and often enough in subtle ways you can’t anticipate.
Plus, there’s just an army of not very good and/or inexperienced developers vomiting their incompetence into the ecosystem.
Languages are not isolated. Java doesn’t force abstractFactoryBuilders, yet hundreds of developers follow that pattern. So Java in practice is rather verbose.
The language and its standard libraries lead developers towards common patterns. Javascript’s standard library is pretty sparse excluding browser-only web apis, so there are tons of external libraries to fill the gap for better or worse.
Java basically does because it did not support functional programming forever forcing most of the base standard libraries to eschew those patterns (looking at you spring), and because even today it does not treat functional programming as first class and it is difficult to accomplish the same things with it then with other languages.
It is also missing many extremely common shorthand syntax expressions like optional chaining.
Not really, no. The over-abstraction Java is often doing is a question of mindset. Java devs tend to be very keen on reusability , which is fine, but often enough the result is unusable.
The problems behind abstractFactoryBuilders are not inherently unsolvable without these constructs, it’s just that Java devs chose this rather weird approach.
I absolutely agree with you. If I can avoid NPM I will indeed do so. Sometimes that means using Deno, but sometimes it can be a valid reason to avoid using the language altogether. And sometimes we have to suck it up 🤷♂️
People dislike JS because it’s packed full of moronic footguns and technical debt. The “standard library” is full of baffling decisions and, much like the language, rarely does what you expect. Even its creator agrees it’s a terrible language and should have been replaced by now.
TypeScript is better, but at the end of the day it’s just an illusion. Add an
any
anywhere, which will happen, and you’re back to square one. It also still inherits some of the weirdness of JS, because it is just JS with fake types bolted on. Plus, the amount of work one has to do to create a proper library with TypeScript support completely undermines the few advantage of JavaScript. Might as well use a real statically typed language at that point, at least you’d be sure your types are actually enforced.Also, the whole web ecosystem is ass. The hoops one has to jump through nowadays to do web development are absolutely batshit crazy. And no, having a
create-whatever
that sets things up for you is not a real solution.Lol, no it’s not. The literal only footgun is the truthiness aspect of equality and using ===, and it’s really not hard to figure out and avoid. Especially given that linters will automatically flag it for you.
It is extremely easy to not let
any
slip into your code, you do this little thing called review code before merging. Crazy, I know, but by just following the most basic software development practices it turns out you can also avoid other basic junior mistakes! Wild right?And lmao, oh my god the web ecosystem is ass because a framework for producing robust complex applications isn’t just an html and CSS file? Lmao bruh, tell me you’ve never coded in a different language without saying you’ve never coded in a different language. You think a .csproj or a .gradle file is simpler and more intuitive?
You’re mistaking basic junior programming mistakes for issues with the language.
THANK YOU
I’ve been a software developer for over 10 years, on both on the front end and the back end.
I’ve worked with jQuery, React, plain old DOM manipulation, god damn PHP. I’m not new to web development.
Outside of web technologies, I’ve worked on nautical charts processing software and microcontroller firmware in C, C++ and Rust.
I’ve worked on native GUI applications with C++, Java and C# using JavaFX, WPF, GTK, Qt.
All under strict corporate standards.
I also work on compilers and rendering engines in my spare time.
So no, I’m not a “junior programmer” making “basic junior programming mistakes”. Your favourite language is ass.
You shouldn’t immediately jump to the conclusion that someone has never written a line of code only because they say so.
Sorry if it hurts your feelings, but even senior developers, web or otherwise, say it. I’m not the one swimming against the current, you are.
Alright, let’s do a little experiment, shall we? Let’s try and create an empty electron app with React and TypeScript.
A quick
create-electron-app
and some configuring TS, ESLint and WebPack later we reach a whopping3_087_725
lines of code. 3 million lines. ~700MB.This all requires a linting step, a pre-compilation step though
tsc
, multiple additional translation steps throughwebpack
for older ES versions.All of that for an empty page on a webview.
This is batshit crazy. And I come from fucking CMake for crying out loud.
There is nothing robust about this, the slightest misstep and your sourcemaps are fucked.
Whoops the author of
left-pad
decided to pull it from npm - half the JS ecosystem on its knees.Whoops the author of
is-even
one day decides it’s a stupid package to need - half the JS ecosystem on its knees.Web developers are standing on a crumbling, fermenting pile of shit. Get over it.
…
With that said, you can still enjoy JS and all the web stuff, there’s nothing wrong with that…
Lmao bro, I don’t think I’m the one with hurt feelings given your unhinged credential boasting and several paragraphs of unprompted bitching about electron.
You make basic JavaScript mistakes that should be caught by linters, and certainly by any intermediate to senior level reviewer. Get over it and learn to be better and not make basic mistakes.
You seem to confuse “people making mistakes” with “a language that is designed in such a way that those mistakes are not only common, but integral part of the experience.”
I’m not saying I make such mistakes, I say the design is crap. It’s not a skill issue, it’s a design issue. People say null pointers were a mistake. I’m inclined to agree. Not because I get a null pointer exception every five minutes, but because there are better ways to handle cases like that.
You said I was a rookie, I proved you wrong.
You said there was nothing crazy about web application complexity, I provided you with a common, glaring example. There’s nothing unhinged in saying “look I installed Electron and React and not my project has 3 million lines of crap I have to worry about”.
Everything else was just emphasis for the sake of it.
But when you don’t have a valid argument, you resort to personal attacks. Maybe it’s you that should learn to be better.
Hi, I don’t really code besides computation stuff in Python. You seem to be really knowledgeable, could I ask, what does the future of the web look like? Is it Rust and WASM? Or will JS and TS always have a place even a decade from now?
The fairly unique thing about the web is that the tech stack is pretty much entirely dependent on what browsers are “winning” at any given time. There are web standards, but Chrome steamrolls them regularly (either by ignoring them or by pressuring the committee to standardize what they want). This is why browser monoculture is bad, and why people recommend Firefox and other non-Chrome (or really, non-WebKit) browsers, as a matter of principle.
So right now, with Chrome’s dominance, Mozilla’s struggles, and the extremely slow progress of WebAssembly and WASI, it definitely feels like JavaScript will remain dominant for a long while. But since Chrome does support WebAssembly and Google participates in WASI, and since there’s no fundamental reason why WASI can’t eventually provide everything that JS does today, there’s good reason to expect the JS stranglehold not to last forever.
And the great thing about WASM/WASI is that, since it’s designed as a compilation target rather than a language, there won’t be any remaining reason for a single language (such as Rust) to dominate. Rust got an early lead in WASM because they put the effort into making it a viable target platform for the compiler, and because it’s the kind of language that attracts people who dislike JavaScript (such as myself). But there’s no reason a different language couldn’t rapidly become the most commonly used WASM language if, say, a web framework in a previously-niche language becomes popular. (After all, Rails, a back-end framework, is what popularized Ruby.)
Edit to add: I say “fairly unique”, but in fact there’s a very analogous situation with C: faultlore.com/blah/c-isnt-a-language/
That’s what people with skill issues tend to say.
You learned how to write == in every other language, but you can’t figure out === in typescript?
You’re bitching and whining about a tiny syntax issue that enables backwards compatibility for literally every web site ever created.
You apparently still bitch and whine like a rookie. Maybe work on your emotional maturity if you want to come across as an experienced senior and not just a Reddit-read edge lord.
No, you didn’t.
Yes, there is, given that the vast majority of web applications run in this thing called a web browser, and you decided to instead choose the project example where you install a whole web browser alongside operating system shims into your project.
Not that’s what people who can recognize genuine architectural defects and aren’t blind fanboys say.
Only to your eyes since apparently pointing out genuine problems is whining. It’s okay for people not to like the stuff you like. And no, using a few swear words for emphasis doesn’t make someone immature, nor does listing what one has worked with for context.
…you still haven’t realised that === is not what I have a problem with have you? It’s literally a non issue. In fact, equality in general is a non issue. It’s the wonky standard library, lack of proper support for binary operations, serialization and almost everything being an afterthought that I have a problem with. Does it prevent me from using the language and write proper, stable software? No. But it’s not good.
Except that amounts to a mere ~180_000 lines of the 3 million. Did a plain create-react-app without Electron, still over 3 million.
Now, since it’s impossible to have a genuine conversation if the other party’s response is “haha you suck” to any genuine, documented criticism, are you gonna grow up or are you gonna keep acting like an offended 13 year old who can’t find a better retort?
That’s what people say to people who don’t raise valid criticisms but just go on unhinged rants about how credentialed they are.
Wonky standard library? Name your issues.
Lack of proper support for binary operations? Like Jesus Christ you also frustrated by a lack of direct access to the assembly instruction set? Do you know why those arent properly supported? Because it doesn’t come up for 99.99% of software developers, and for those who do need to do bitwise math and manage memory directly, you have the entirety of Web Assembly available to you.
As opposed to other languages where the entire concept of functional and async programming were implemented after the first version? Name your specific criticism of how JavaScript implements serialization that you don’t like.
Who the fuck cares? Do you know how much easier it is to parse through and find a problem in 3 million lines of JavaScript code then it is to try and figure out what part of the millions of lines of closed source compiled code that make up Java or C# or whatever other language you like?
You’re also using a deprecated project, and you’re checking against the dev version with dev dependencies, not the final minified version. Oh my god look at how big this Java project is before I compile it, what a nightmare!!1!1!1!
You’re the one who came into this thread bitching like a Reddit edge lord about the most popular language and the most successful cross platform development platform in the entire history of programming, I’m the one saying it’s no worse than any other major languages and is better than many of them.
But no, I’m sure it’s the millions of successful developers and users who are wrong. Everything is shit but you amirite?
When shipping to customers, all code is your responsibility, dependency or otherwise. A bug or a security vulnerability, which aren’t rare in the JS ecosystem, is your responsibility whether you wrote the code or not. Customers don’t care if someone else wrote it, it’s your product, you are to blame. Thus, the less code, the better. Less moving parts also means more stability in general.
People can be successful with things that aren’t perfect. It’s often a matter of being the first, not being the best. Something can be popular and still not be good, momentum is hard to stop. If JS’s own creator saying so in the last few years can’t convince you of that, I don’t know what will. Flash at one point was the most popular. It was still flawed, and a liability, but I bet that doesn’t hurt you as much to hear.
Quite the contrary. I have flaws like everybody else, but at least I don’t deflect every single criticism of stuff I like because in can’t fathom it not being perfect. It’s fine, use it. Maybe one day you’ll find a platform that’ll make you realize there’s better stuff out there.
But I’m done arguing with you. I should have known by the tone of your first reply that this wasn’t going to be a real discussion, just you being butthurt because someone said something negative about your favourite language. Go get butthurt somewhere else.
You still havent actually articulated a single criticism that’s not a vague generality, after coming in like an edge lord ranting about it like it’s the devil spawn.
And yeah bud, all the code you ship is your responsibility, which is why building on open source code that you can fix whenever you need is far preferable to building on a closed source compiled black box like most languages.
Lmao, one salty dev, vs the literal millions of seniors developers and fortune 500 companies who disagree and choose to use it.
Again, if it’s a liability name how, if your argument is “oooo open source scary, there’s no way to verify it, I’ll trust Oracle to give me a closed source compiled library that’s sure to be flawless”, I’m going to laugh in your face. Supply chain attacks are a problem, they are not an unsolvable one or even a particularly difficult to address one compared to the benefits of open source.
Try and quit bitching about tone and vague bullshit you heard on Reddit and articulate an actual real world problem that you have with it on a day to day basis. You came in here screaming it’s shit like the devil’s spawn, all I’ve done is ask you to explain why and point out why issues like equality comparison, converting to 32bit for bitwise operations, and it being open source, are not big deals for most devs.
I don’t recall the experience being even equally pleasant in other languages, let alone better.
For all the hate PHP gets (or used to get) it’s ecosystem is amazing. And so is the language and standard library itself for the most part. It still inherits some of the original issues, but a lot of work has been done to minimize them.
It definitely isn’t in some circumstances.
Frankly I’d put C/C++ in a similar category when it comes to compilation.
Dealing with Make, CMake, linkage and all that can be a nightmare.
The ecosystem is a little bit better though in my opinion. If nothing else you get a proper standard library and don’t have to rely on thousands of dependencies to get anything done… or you often roll your own if you are in C… which is meh.
I find Rust, C#, Go and anything slightly more modern to be a great or at least good experience.
Python as well if you use venv and your runtime and package versions align.
My point is, there is no perfect platform and ecosystem, but the web is generally regarded as one of the poorest.
I’m not saying someone can’t enjoy working on web stuff, they most certainly can. But it is objectively overcomplicated.
I won’t argue that the web is complicated, but a lot of that complexity comes from the necessity of supporting so many different environments that you can’t control.
I’d also like to ask when the last time you used JS was-- we use one UI framework (Angular) but no lodash, jquery, etc. to provide library functionality. Everything’s just built into JS now.
I had to go back to working with React just recently. I’m technically using TS, but the standard library is the same anyways. It hardly has everything imo.
It does have what it needs to interface with the browser, and quite a few -sometimes poorly thought out- facilities, but not much more.
Don’t get me wrong, for a web scripting language it’s plenty, but if one wants to use JS for stuff that isn’t just putting a simple page on a screen, that’s not enough.
Maybe you mean Node instead of JS?
What kind of standard library features are you looking for that don’t exist?
Anything that isn’t plain web browser stuff.
You can’t write files without Node specific APIs.
You can’t even do proper bitwise operations because everything’s a float.
Binary serialization is a pain and proper deserialization in general is not enforced, even in TypeScript, because types are an illusion.
Up until recently there were no synchronization primitives, though now the idea of having them in JS seems terrifying.
There are no other data structures than arrays and maps, which are often not enough.
It’s just not a language I’d use for anything more than… well… Scripting. But even though other, better solutions exist for cross platform development, people insist on using JS, so here we are.
You seem to be confused about what JS is. It’s a high-level interpreted language. It’s not C. Of course it can’t open files. Can you imagine if any webpage could open files on your PC? This is like asking why Rust doesn’t have a certain Blender shader node or Scratch block. The language fundamentally doesn’t include those concepts directly. As an interpreted language, of course JS is going to access OS APIs through its host program. If the concern is that the APIs aren’t standardized-- well, yeah, that’s true. Although the basic stuff (file I/O) is included in runtimes directly.
Is there something I’m missing here? Why would you expect to be able to do bitwise operations on floats and get a sensible value? And if you want to do integer bitwise operations… you still can? Just use integer values and the bitwise operators? If you’re complaining that you can’t be sure if a number is an integer, that’s 1. a separate issue, bitwise operations still work fine, and 2. easily solved.
Have you looked at the bit arrays JS has now?
Do you require multithreading for a language to be considered “good enough”? Why complain now that JS does have these abilities?
This is patently false. JS has sets, maps (actual ones, not objects like you were referring to), etc. We’re soon getting records and tuples. If you want to build a linked list in JS, you do it the exact same way as you would in any other language. Not that it would be very useful.
No that’s my point. You can’t, because there’s no such thing as an integer value. It’s all floats, always. They get casted to integers, the binary operation is done, then they get converted back to floats. That’s a lossy process, so some binary operations with certain values are simply not possible and you get weird results. The max width of an integer you can store is 53 bits, the maximum addressable width is 32 bits for binary operations. That’s wonky.
Ah yes I forgot sets. But I don’t think there’s anything else? Last time I checked there were no binary trees, no proper (ring buffer) queues, no ordered sets, but I may be wrong on that. It’s not enough imo for a proper standard library.
For everything else:
My point is that JS is an okay scripting language for the web. As I said, for that it’s perfectly fine, though the frameworks are often lacking imo. But there is this tendency to use it to create backends, desktop applications and tooling. That’s where the language falls apart, because it’s not made for that. It needs to be more robust, well defined and fully featured to be used in those contexts, both in terms of JS itself, and its standard library. Same with TS.
I know and that’s the point. It’s underspecified for things outside the web, so it’s terrible for those use-cases. You can make it work for Node, but not for Bun or any other runtime. And even then, the experience is acceptable at best.
I personally would never use it for such use-cases, but people keep touting it and TS as these amazing general purpose languages you can do anything in. You can, but you really shouldn’t.
But you can. Any number that precisely represents a 32-bit integer can be used with binary operations as if it was one, and there will be no loss of information or unexpected results. Is it weird that JS has no integer type, or that its max safe integer representation caps out at 2^53? Yes, but that’s not the complaint you made. Binary operations work literally perfectly as expected for any inputs that have the appropriate type. Actual float values are truncated, which fits the language design.
I’m sure you’re aware of push, pop, shift, and unshift, which together can make a FIFO or FILO structure, or a more complicated one, from an array. If you’re using TS you could create a semantic type that only allows a subset of these operations. I will concede that we have no tree type, although I’m not sure if that’s standard in other languages? I haven’t needed to use one myself.
Anyways, I won’t fight you on JS being overused. I will say that it’s flexible enough that it can be used in any way, even if it’s not the greatest idea. Something like embedded programming or safety-related things shouldn’t use JS. And as you keep mentioning, it wasn’t made for low-level stuff, although it can do it. I don’t think that’s a requirement for a stdlib though.
I can understand accounting for different environments. That’s unfortunately unavoidable. But I found web framework developers in particular have a weird tendency of piling up ungodly amounts of abstractions just for the sake of it.
It’s kind of a cultural problem in modern software development in general imo. It’s not limited to web dev by any means, but it’s particularly bad there because JS lends itself to it quite well.
I ❤️ abstraction. I’m an abstractionpilled layercel. I’m in my abstracting era.
Ah that’s fine. There’s nothing wrong with abstraction, until it becomes too much.
Day 43. My tech stack has breached the clouds. I can no longer see the ground. I fear that I will not be able to return to the surface.
You will not, indeed, it’s going to be abstractions all the way down from now on
WittyResponseFactoryBuilder.setTone(‘lighthearted’).build().createResponse().send()
There’s a distinct lack of
FactoryFactoryFactoryBuilder
s in this code snippet.Clearly you have yet to reach true abstraction nirvana.
Alas, I am but an instance, not yet a class
C# with the M$ echosystem sucks ass though. It’s like at first wow nice language, now how do you do this or that basic stuff and it’s just crap.
I want a Map. map map; ? Oh no ; Map map=new(); ???
Where are the destructors?
Etc.
I get the feeling it’s too steered by the corporate and not enough open source.
I think it probably could be, in Lisp. Like the one they used in early MIT computer labs (Scheme).
Many of the best ever known programmers came out of MIT computer labs, and for good reason.
Lisp on the web is a fascinating alt history scenario
Yes. And I want academics online like Matt Parker to discuss it with me.
B-b-b-but you can’t do that!!1! What if my customer wants to calculate
5+“three”*[]
???thanks to wasm any language is a browser running language. JS is relegated to some token binding boilerplate as part of any framework and with things like servo/tauri rendering html will be pure rust
Theoretically yes, practically you may have to deliver a whole runtime depending on the languagey making websites even bigger and slower to load initially. And unless it’s a webapp with data processing on the client the perceived performance benefits may be negligible.
correct
good languages like rust have tiny bundles and initialize in microseconds, of course :)
Noob question here. What’s DOM manipulation?
Document ObjectModel. Think using code to add a JavaScript to make a drodown menu appear like for a navigation bar. That would be manipulation. And I think there’s so much more Angular and React do with DOM that I don’t know enough to explain it.
wonder when Rust will saturate it’s niche as a C/C++ replacement, I’d guess 3-6 years would be when we might start to see some stabilization.
What exactly do you mean with stabilization? Rust itself is pretty stable already.
In this context, stabilization refers to the adoption growth curve flattening out.
I think it will take much longer than that. There is so much legacy C++ code. Maybe 10-15 years.