Unable to load image

Rust sisters? What is we doing? :polish:

https://github.com/nukeop/is-odd

:#polish:

:#marseyflagpoland:

>4 contributors

>10 commits

>17 lines

>fix return value in readme

https://i.rdrama.net/images/16853791371759603.webp https://i.rdrama.net/images/1685379137256767.webp

51
Jump in the discussion.

No email address required.

https://i.rdrama.net/images/16853805312459183.webp

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

:#marseyyikes:

Jump in the discussion.

No email address required.

:#marseyxd:

Jump in the discussion.

No email address required.

https://old.reddit.com/r/programming/comments/886zji/comment/dwith6b?sort=controversial I learned how to program in 2014. I created is-odd after I had only been programming for a few months, after I noticed that there were hundreds of thousands of views on the http://stackoverflow.com question asking how to check for an odd number. I was learning... not only about programming but also about how publishing packages worked.

In any case, since this entire thread is resting on the concept of is-odd being a useless library, I'll just focus on the code instead of the comments being made. Here is what you will get with the popular suggestion of using "i % 2".

console.log('is-odd', !!(1.9999999999999998 % 2)) // false

console.log('is-odd', !!(1.9999999999999999 % 2)) // true

I guess that's good enough for your code. :marseyclueless:

edit: to bobcat, that's exactly what I was saying. Thanks for the upvote, and thanks for nerd raging why it's not as simple as "i % 2", specifically because ofJavaScript's floating point error. Let me say it another way. In JavaScript, you might think you're testing an integer, when in fact you're testing a float.

edit 2: this is conveniently being overlooked, but you wouldn't know my module existed if you weren't depending on code someone else wrote. You're complaining about small modules, but at the end of the day, developers need to decide for themselves where the balance is between relying on their own code or someone else's. You clearly don't write all of your own code or you wouldn't be complaining about dependencies right now. You want your dependency tree to be small, but you're still complaining about work that someone else did for free to create the libraries you're using. Webpack wouldn't exist if there wasn't anything to pack. So wtf? You're going to hate on a fellow developer because they created a library? Then all of a sudden I have an evil scheme of world dominance, and it's all rooted in is-odd? Mwwaaahaaahaha! It's working!

edit 3: to the geniuses who are making comments about webpack and how "OMG THIS IS ADDING SO MUCH CODE!!!!". Let me explain how node.js and webpack work. Whether your code is in node_modules/foo/index.js, or lib/utils.js makes no difference. Both the require system, and webpack will treat them the same. Whether you inline the code or use a module, approximately the same number of bytes will be used. Specifically, you would save literally 14 bytes by re-writing the code locally, rather than using a module in this case. If you have to re-write the code multiple times, then your package might save 14 bytes, but you personally will write more code.

Both packages, is-number and is-odd, add up to a total of 371 bytes in a webpack build. You can cut this down to 357 bytes locally. You can get rid of the type and error checking if you don't need them, but we're still talking about a few bytes. !codecels

Jump in the discussion.

No email address required.

Webshits aren't human

Jump in the discussion.

No email address required.

This is true, but JavaScript was designed by deranged arcanists.

Jump in the discussion.

No email address required.

That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.

Jump in the discussion.

No email address required.

This is a parody of the equivalent javascript NPM package which is actually heavily used

Jump in the discussion.

No email address required.

is-even actually depends on is-odd, which does all the hard work

https://www.npmjs.com/package/is-even?activeTab=dependencies

Jump in the discussion.

No email address required.

>it's a parody

:marseysal:

Jump in the discussion.

No email address required.

parodycode

:marseysurejan#:

Jump in the discussion.

No email address required.

Why does this even need to exist?

Jump in the discussion.

No email address required.

:#marseyautistattentionseeker:

Jump in the discussion.

No email address required.

publishing dumb basic shit is funny

Jump in the discussion.

No email address required.

The post and exposing this is funny. I just don't understand why such a programming 101 concept needs to be a module.

  1. How many times do you need to check if something is even or odd

  2. If dumb shit like this is a dependency then obviously other dumb shit in your code is going to be filled in by dependencies. You're now pretty much giving everyone single third party permission to frick with your code via an update.

  3. Write it your fricking self and if you can't then please keep yourself safe or find another job.

Jump in the discussion.

No email address required.

:#marseyautism:

Jump in the discussion.

No email address required.

python users BTFO

Jump in the discussion.

No email address required.

I just installed a plugin that calls that guy gay every time I run my code

https://i.rdrama.net/images/16854496120069616.webp

Jump in the discussion.

No email address required.

This

Jump in the discussion.

No email address required.

it took me a solid 5 minutes to comprehend what's going on here

Jump in the discussion.

No email address required.

Hahahahaha it took me two suck it

Jump in the discussion.

No email address required.

:marseyretard2:

Jump in the discussion.

No email address required.

You lost the game.

Jump in the discussion.

No email address required.

let _i : i32 = 1;

println!("{}", _i.is_odd()); // prints true

Are rustcels r-slurred?

Jump in the discussion.

No email address required.

Someone should commit “is_true()” and say it’s more trans inclusive or something.

Jump in the discussion.

No email address required.

Why doesn't this have a Code of Conduct? :marseyhmm:

Jump in the discussion.

No email address required.

you know how on supernatural they kill a shapeshifter and it starts flipping between a bunch of different forms before it dies, it's like that but for a civilization

Snapshots:

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.