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
Search - "coercion"
-
Shamelessly borrowing this from /r/ProgrammerHumor/ because.. 1+'1'-1 ¯\_(ツ)_/¯
On a serious note, this will help with JS coercions: https://medium.freecodecamp.org/js-...1 -
You know what really grinds my gears? When people criticize a programming language but uses edge cases and stuff that can be avoided by using the tried and true "don't be an idiot". Take for instance JavaScript, a language I like and a language that has a lot you can criticize. But I feel like a lot of peoples criticism isn't warranted.
What's that? No ints? Use parseInt or Math.floor.
What are you saying? == works in strange ways? Yes, that's what we have === for.
Type coercion is wonky? Think it's weird how string + int works differently than string - int? Wanna string with number + - + - - + - - etc? Don't! Don't add strings and ints, don't subtract strings and ints. You can't in statically typed languages and you aren't supposed to in dynamically typed
Adding arrays and objects, arrays and arrays, objects and objects etc. is inconsistent? Why are you trying to do that?
Adding floats together gives odd results? Now we're getting somewhere! And Mozilla responded to that with a method called toFixed.
Declaring variables with var doesn't always work that well? Use let and const
Then there's this weird attitude that some people I've met have, where they will complain about the module system and how "well you rely on the community for those packages" as if it's a bad thing. And then coming with the "well you don't know what the (open source) packages do internally" as if I (for the most part) give a shit. Then they'll swear by companies like Zend or Microsoft as if they can't just stop supporting the languages they use. Maybe it's just because I like community content more because of video game mods.
Wanna criticize JS, then there's plenty to talk about. Like the built in date object is basically shit. Or how in NodeJS you can have node_modules in your node_modules. Or how classes don't really have the best syntax. Left-Pad. And so on (it's too late for me to be able to remember much more).1 -
This is the most wtf thing that happened me with Javascript, I had a regular expression and it caused bugs only with 4 digits long words, then I just noticed this:
/^.{3}$/.test(null) // false
/^.{4}$/.test(null) // true
What the fuck, I can't believe that who designed the .test method didn't think to avoid null coercion2 -
God I fucking hate Javascript.
- unknown operator
- type coercion
- sorting always works alphabetically (lmao)
- literally started as a joke
why can't it be normal and predictable, or at least mildly comfortable to use?19 -
1. Fix climate change and the environment in general
2. End corporate coercion and social inequality
3. Cure all mental illnesses
Is that too much to ask for?29 -
Fear.
Fear rules the world.
Why coercion? Because control. Why control? Because it gives better chances of survival. Why survival? Because fear of death is hardwired into us.
Why greed? Because money. Why money? Because wen day is dark, you need money to pay your way out. If you lose your job, you’ll still have money. It’s fear yet again.10 -
i have figured out the PTSD from my job is just fear and evidently I've never had fear so I was confused
was always an angry kid so I guess I never felt fear before then...
... also apparently all fear is caused by thinking you'll lose freedoms
my job was like a prison... except then I figured out how prisons are, and a prison would be a utopia
so now I literally just can't even bring myself to reply to interview emails cuz I just feel "fear" at them... which I thought was PTSD
and fear always seems big and functions irrationally... and not having experienced it I didn't know that obvious tidbit -.-
all I knew is I was "broken" somehow by that whole experience, even though at the time it didn't seem like such a big deal
people think if you're unemployed you'll just "get off your ass and stop being lazy" when they starve you to death, but starving you to death is just another fear. the first fear and the second breed and power each other up like a reverberating resonance. I rather starve to death than go back to prison so that was never helpful "advice" to me
I've generally been an angry person. I've been fearless quite literally and pretty chill, but when people push on me I get angry though don't necessarily show it. while working I was angry all the time. the interesting thing I noticed about anger is the resonance -- the angry CEO potentially being angry at me didn't scare me, and one time he was finally angry at me. the interesting result was that instead I couldn't keep a lid on my own anger. I got angry at him back. this made me realize you can't suppress an emotion if someone else is throwing the same emotion at you -- it just powers them both up
anger is about territory. either you want something or you're protecting something. it's important to you. anger also seems to dispel fear. ran into something recently and it said "fear is dispelled if you have something more important". just "surviving" is not more important than being free to me, so "starving to death until you get off your lazy ass" was the most annoying bullshit
I've noticed if I'm mad at a job-related person I feel no fear. the anger dispels it. because I was mad at that job all the time, I don't think I noticed my fear. they were frequently using coercion as a "motivational" strategy on everyone... and even though I didn't react to it or was motivated by it, they didn't adapt and try different motivations. I figured I agreed to be doing this, so there's no point in threatening me, and just ignored it. but they never stopped. and things got shittier and shittier. the price they paid me to tank my freedom for purely arbitrary means was just too low, and I couldn't feel any of it because I was angry all the time
I interviewed at companies fine before I left. now that I left I actually can't. because there's no anger. I'm happy. so there's nothing to dispel the fear. therefore I'm cursed, broken, and non-functional... from some mystery I could never figure out before
and I know, this, also. because any time I was harmed socially in these years since, suddenly I could function again, because I was angry, and suddenly I could do so much. but who wants to live life purely angry just to function? it didn't feel right to me. I was so confused5 -
In my opinion people hate JavaScript just because it's different from other languages.
Why people hate coercion? It's useful if you know how to use it. Or dynamic typing.
What's your opinion about?5 -
I was initially hating on JS for the weak typing and type coercion, but after taking a look at the underlying algorithm it actually somehow makes me think the whole thing is sort of sweet and endearing. Not sure if this makes me a bad person or not4
-
Four years have I been a JS developer, only today I realized that negative numbers are truthy :facepalm:2
-
The reason there aren't independent web browsers anymore is that the web standards include a lot of concepts that should never have been standardised and their presence in the browser as opposed to compilers and interpreters targeting the web has no benefit whatsoever.9
-
Most of the few whiners complain about monopolies in capitalism! I say monopoly only happen due to government involvement.
Want to talk about real monopolies? Look at the few pharmaceutical vaccine companies (pfizer, moderna), government are only allowing to be used via coercion against some of their citizens' choice. All taxpayer funded, whether you like it or not.
That is pure statism and coerced monopoly. Not other BS monopoly examples you present because you are incompetent. Get ready for booster shots while pfizer CEO's laugh all the way to the bank.13 -
I have decided that massive natural selection events are a thing with humans. When resources appear to be getting low a group of people will prepare and wipe out a large portion of consumers. The most straight forward way is to create a crisis and then offer the "only" solution. Make that solution a weapon and you are done. The masses gladly accept the solution. At all times appear benevolent. Silence dissenting voices swiftly. Make the dissenters look like nutters and publicly humiliate them and apply labels to them. Labels are effective because it creates pariahs. People like to not be singled out and called names.
What do you end up with? People who distrust government and the institutions. I don't know how this benefits the orchestrators (how to spell) of the genocide. Perhaps if the numbers are small enough they can just be rounded up and killed by force rather than coercion.
I get the feeling this approach has been used in the past. Like it has been at least tested on smaller scales. Maybe even on past civilizations. Did we learn to do this from space visitors? I wonder.
2021 has certainly been an interesting year. I used to think people were just stupid. This year has confirmed that for me. But I am not sure stupid is the right word. They are certainly book smart. Maybe naive is a better word. I pray and hope 2022 turns out better for people. Maybe they start seeing signs they have been lied to by people they trust. Maybe not. When you are in the matrix it is hard to see through the facade. The matrix feels very real, until it doesn't.
Dev Goal?: To not be murdered by the matrix.6 -
Type coercion in JavaScript. I appreciate it's trying to help me out, but it'd be cool if it just told me I made a mistake.1