Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
tosensei8375304dnow imagine having 100s or ways to choose from and none working - that's js..
c# IS better than JS, because everything is better than js ;) -
Lensflare17101304dI partly agree, but probably for different reasons.
C# has an absurdly high number of collection types which all do practically the same but have little subtle differences.
Most of the problems come from the fact that all collections are reference types so you need at least two copies to have mutable and immutable ones. This multiplies with all the other variants such as thread safety, async, etc.
JS has kind of the opposite issue: it has practically only one collection type (actually two: array and dictionary/object) but that one has reference semantics as well and it lacks the flexibility of all the other stuff such as the ability to make it immutable or thread safe.
What’s the solution then?
Make collections value types like Swift does.
This allows to declare variables of collection types as constants (immutable) and the collection becomes immutable as well, naturally without the need for extra types. -
tosensei8375304d@Lensflare clarification: the differences between the collection types is how they're implemented internally, reflecting how they behave and how they perform in different scenarios.
and when in doubt, you can just use a list and be done with it ;) -
Lensflare17101304d@tosensei true, but it only works in a small isolated context like when you implement a function or something.
As soon as you need to use some sdks, libraries or even other parts of your own code, you will need to deal with those types as they appear in the interfaces and method signatures.
For example there is no need to have Array, List and ArrayList. I know all the details and differences about them but as a dev, you shouldn’t be bothered to decide which one to use. In practice it won’t ever make a difference unless you have huge amount of elements. -
Lensflare17101304d@tosensei
Prior to being a Swift dev, I thought that it’s important to have the choice and that it’s what makes a good dev to know the difference.
This opinion has changed as I realized that a single collection type like Swift’s Array can be implemented to have all of the convenience apis that you need and is also highly optimized and does the right and performant thing on search/insertion/whatever.
And that is true even before we evaluate the advantages if it being a value type. -
iceb1175303d@fullstackcircus I don't get it. that's like declaring
constants in c#? I don't see how this makes JS better? -
kiki35296303dc# market share is merely a statistical error compared to js market share. there is a reason for that — js is a superior language. if it wasn't, it would've been replaced by things like dart long ago already.
-
tosensei8375303d@kiki i thought you were cool, but it seems you're infected with stockholmJS as well.
-
kiki35296303d@tosensei @iceb can’t handle facts. You simply cannot force the whole dev world of people talented enough to create rust, zig, other gems, to use “crap” language for 27 years straight, actively developing it, introducing new features every year. That’s flat earth level shit
-
Lensflare17101303d@kiki that’s the classic bandwagon fallacy.
Do you really believe that the quality and validity of something depends on its popularity? -
Lensflare17101303d@kiki the only reason why js is so popular is because it’s very accessible and is the monopoly language for the browser.
-
kiki35296303d@Lensflare in general, no. in certain areas, definitely yes. forcing queerwashed marvel/hollywood bs down lazy consumers' throats is one thing. having the entire vibrant field of really really talented people that CAN change things if they want to (we've seen it already) STILL using js and IMPROVING it means something. It's just a better language. deal with it.
-
kiki35296303d@iceb perl is not developed as rapidly as js. it has less funding and less interest from the community. there are less perl devs than js devs out there.
-
saucyatom2552303d@kiki Another reasonable explanation for the huge market share of would be that it is THE browser scripting language. This leads to many people getting exposed to it - and since they most likely already have a browser and text editor installed, it is also very easy to get started.
-
kiki35296303dI mean mighty GOOGLE that HAS browser monopoly tried to replace js with dart and failed. it's really hard to fundamentally improve js, but it's easy to mess it up — look no further than es4.
-
Lensflare17101303d@kiki the only thing that I agree with is that in certain cases, popularity and quality do correlate. Not in the case of JS though.
It’s not the better language, it’s the only language. Wasm may change that. -
PaperTrail10743303d@Lensflare > "C# has an absurdly high number of collection types"
Amen.
And the pissing contests I've seen between devs.
"You should be using IEnumerable!!" "No! You should be using KeyValuePair!!!" "Tuples! Tuples everywhere!!!"
Dare to speak up "Guys, users don't care and it doesn't really matter.", then bombarded with contrived "benchmarks" proving X is better than Y. -
kiki35296303d@Lensflare wasm doesn't have DOM access. without it, accessibility on the web is out of the window, and with the general leftist sentiment in the EU, you can't ignore web a11y.
-
iceb1175303dWell. everyone has their own measuring sticks.
I like c# and I look up to Jon Skeet. And that's enough for me.
Still interested in the discussion though -
Lensflare17101303d@kiki the reason why google failed is not because js is the better language but because it is an established monopoly with huge momentum which is insanely hard to dethrone.
-
kiki35296303dalso, guys, you do realize I was a C# teacher? do you?
I'm getting old. I'm not as attracted by shiny promises as I once was. being stupid and gullible, I chose react and wasted several precious years of my YOUTH, not just my life, on this crap. it's over now.
js is a nuclear resistant cockroach that will outlive whatever you're using rn, except for c (definitely) and php (maybe). this is not touching declarative things like sql.
I'm willing to listen to C guys, sql guys, even php guys — people whose skills and experience will be valid 30 years from now. C# people? I don't give a flying fuck what you think and what you believe in. You might be interesting as a person, and I'm willing to talk about something personal, but not about programming. with all due respect. -
Lensflare17101303d@kiki wasm not having dom access is also exaclty the reason why it struggles to replace js. And js having dom access doesn’t make it the better language.
-
kiki35296303d@Lensflare what you say is valid. yet, I never said js was better BECAUSE it had dom access.
-
Lensflare17101303d@kiki I kind of get your opinion about C#. And that is why you definitely should take a look at Rust and Swift. It’s like all advantages from JS, C++ and Haskell combined.
-
MaNaNa16303dTypescript is one hell of a thing.
C# is an awesome OOP language too.
Just write in whatever you need/makes you happy
Why the drama? -
Lensflare17101303d@MaNaNa not necessarily drama. As professionals we can surely discuss pros and cons of different languages without being insulted and fighting each other?
-
huskut49303dI think all languages have their upsides and their downsides. Even though I hated working with C# at my work (Mostly because all the codebases tended to be either legacy quickly hacked together code, or tended to be extremely overengineered for no reason), but somehow I do kind of miss it. Its very clear and if used right, can definetly be very strong. I'm now fulltime working with JS/TS and they have their own quirks, just like C#. All languages are different, yet somehow they are also the same ;)
-
@iceb dude. you literally asked how to do this in JS and i answered how. then you say you don't understand. what are you even talking about bro
-
for what seems like a long while, i find myself agreeing with @kiki in this thread... strange...
-
iceb1175303d@fullstackcircus I mean I don't understand your point.
You are complaining about c# and it's complicated when there's built in methods in JS then you showed an example that isn't any different from c# code (at least from what I understood)
I don't get your point. -
jestdotty5234303d@Lensflare the language itself is very accessible to use
It's easy to start hard to expert video game, the perfect difficulty slope
Though big codebases maybe shouldn't. And all the libraries get outdated too fast. And the js people changing require/imports annoyed me and that's kind of a mess now... I think just modern developers kind of suck. Es6 was pretty perfect though
Been so long since I used any other language indepth though, so I don't even know if the large codebase problem is necessarily going to be fixed leaving js but I hope it will -
saucyatom2552303d@Lensflare Regarding collection types in C#: They do have quite different behaviour and which to pick depends in the use case. However this is mostly about internal behaviour and libraries should usually expose them through an appropriate interface.
For example IEnumerable and IList have very different guarantees and distinguishing between them can be very useful. I work with datasets that can get quite large and writing them to a list instead of directly iterating through them is just not a great idea.
Using the right tool for the job and all that.. Which applies here towards the choice of collection type but also the language ;) -
Lensflare17101302d@Slow-Yep you can build anything with js, just like you can build anything with brainfuck. That’s not a miracle. It’s called turing completeness.
Real devs will never accept js as a good programming language.
You can whine about it or you can adapt. -
Lensflare17101302d@Slow-Yep I didn’t call myself a real dev. But you are right, "real dev" is not the correct term. "self-respecting dev" or "dev with dignity" might have been fitting better.
See? This is how you take advice. -
Lensflare17101301d@Slow-Yep nah, you misunderstand again. I’m not talking about me but about devs in general. I’m not special, you are.
-
Lensflare17101300d@Slow-Yep dude you changed my text in your quote to literally have the opposite meaning. I said that I’m talking about devs in general. Read it again and learn how to quote.
Also I don’t and never did tell you how to do your job. All I ever did is pointing out how incredibly stupid you are, purely based on what you write, now what your job is or how you do your job. -
Lensflare17101300d@Slow-Yep I clarified that so many times before but I’m sure that you’ll forget it again, or won’t understand it and will complain again a few days later. It’s sad.
Related Rants
"C# is better than JavaScript"
I only see ruminations of people who are so far gone mentally they can't even see the forest from the trees anymore:
https://stackoverflow.com/questions...
Imagine having 100s of garbage ways to choose from for something that should have trivial built-in functionality.
🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡
oh and don't give me the shit "enums are bad pattern" grow up and learn to code
rant
javascript
lol
🤡
c#
what
enums