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
-
GarbageScript: Why javascript parseInt(0.0000005) prints out 5? https://stackoverflow.com/questions...
-
@fraktalisman
That kind of garbage is present in any language without strict types though, or at least any language with implicit duck typing.
Most language maintainers have realized by now that duck typing is stupid. Javascript, "because browsers", moves pretty slowly -- but you can get escape hell to some extent by using Typescript. -
@bittersweet I have done weird shit like that in C++. I mixed up variables and tried to convert something to a string. C++ found an object to convert something to a strange character. It made sense when I found it, but there was a bit of wtf going on.
-
@Demolishun
Yeah there are no strictly vs weakly typed languages. It's a spectrum.
Those which used to be called "weak scripting languages" still have many leftover ducktyping oddities.
Errors often result from concatenating where the dev tried to sum things, float handling, that sort of thing.
But in Java or C++, you can still mess up if you accidentally dereference/pass null around, divide by zero, take the square root of a negative, etc.
At the other extreme lives Haskell, where you define a type like "natural numbers" from scratch, to make sure your matrix multiplication functions are type-safe.
https://softwareengineering.stackexchange.com/...
Worth the effort? Possibly!
Safety is overhead.
So yeah, JavaScript is extremely garbage.
But it's popular garbage, because it's easy and works 95% of the time, without all that meaty academical overhead of a perfect type system.
Related Rants
-
boombodies15Manager: We need to setup the security in the Mexico server Dev: You mean that 3rd party firewall add on? Ma...
-
boombodies26Manager: Why aren’t you working? Dev: I am, I’m just not typing because I’m thinking an issue out. Man...
-
boombodies19Manager: How come the intern does way more tickets than you? Dev: Because you told me to only give him the ea...
Dev2: I don’t like the way that works
Dev: Me neither. But that’s javascript baby!
rant
garbage collection
javascriptshmavascript