While hopefully it is satire, it would also make a good college level exercise.
There's suffient nuance and opportunity to be creative, while at the same time requiring some basic skills to set up (server, dns, https,and so on.)
Then for those more advanced there are creative extensions to implement - support any base, support text, in multiple languages, support formulas (is result odd or even) and so on.
Back in my university days we'd take trivial problems like this and "extend" them in creative ways faaar beyond the assignment. It both stretched or skills, and also taught us something about feature creep.
As in, sometimes it's OK not to build the perfectly generic, useful in all cases, megolith when a simple x % 2 == 1 will do.
Truly not the kind of algorithm you'd want to write yourself. Do you really want to be scouring your own code usages when the CVE inevitably comes? Will you even notice if you get exploited? And the off-by-1 errors??! Plus, you know IEEE is just going to go and increase the width of integers again soon. Moving targets everywhere. What a mess. I'd easily put $5 per month per seat towards this. Maybe more. Brilliant project.
This is just some random dev though. Soon an equivalent service will be bundled with your office 365 subscription, backed with five nines of reliability and a corporate support plan.
I actually wish Amazon came and standardized oddness, like with S3. Currently there’s a lot of providers, we had to switch to another for gdpr reasons (our old provider collected our users’ shoe sizes with each request, long story). But then they weren’t api compatible so we are now using a service adapter service.
Oh, and remember to always wrap your isOdd requests in a retry loop with exponential backoff.
Modulo is security critical. It is the basis of all number theory (and by proxy, cryptography). We should have a self hosted version that can run behind the firewall.
It's great that the author built this as an api-first service for maximum compatability, but what would really help adoption and make it a lot easier to use is per-language libraries. Why write all the request sending and parsing yourself, when you could instead simply write:
try {
const isOdd = require('isOdd')({ apiKey: 'xxx', ...options });
}
catch (e) {
if (typeof e === 'IsOddAuthenticationException') {
console.log('Could not connect to issOdd service. Is your API key correct?');
}
else {
console.log(e);
}
}
try {
const is43Odd = await isOdd(43);
}
catch (e) {
console.log(e);
}
console.log(is43Odd ? '43 is odd!' : 'Sorry, 43 is not odd.
Pedantic quibble: the is43Odd variable is out of scope for the final log statement. Let's push it into the PR queue and circle back to this after we clear our outstanding merges.
> Pedantic quibble: the is43Odd variable is out of scope for the final log statement. Let's push it into the PR queue and circle back to this after we clear our outstanding merges.
The const should have been a var. Get off my lawn!
I love you preface an actual legitimate bug with "pedantic quibble." What do you do when you see an actual pedantic quibble like about whitespace? Tip? =)
Haha. Oh, you know...it's part of the satire. Something like: pointing out an actual bug in pseudo code in a joke is type of pedantic quibble HN comment threads are known throughout all the lands to espouse.
Hmm, if I saw an actual outside-joke pedantic quibble? I'd probably lose my mind and go on an hours long rant about the declining state of HN comment threads. Hahah. Or maybe...Shrug sigh and move on? Or maybe...I probably wouldn't even see it...it's such a part of the background noise here. Or maybe...I'd laugh and try to engage humorously with the poor soul.
Wait...was this a pedantic quibble, was that what you just did? o.O hahah
In the not to distant past this was a meme on /r/shittyprogramming. Everyone contributed one. There was deep learned iseven, number theoretic iseven, recursive iseven, enterprise iseven etc. My personal contribution:
def isEven(x):
'''returns true if even''
return True
Feature suggestion: add an endpoint powered by ChatGPT that can determine whether a program will terminate. Finance needs to track server expenses for ESG metrics.
At first I was worried the overhead of a service call would slow things down, but my worries were put at rest when I saw it was implemented in a low level, high performance language such as Rust.
Also, Elixir and the actor model is such an obvious match for this problem space!
Definitely happy to put this tool in my tool belt.
Lately I’ve been relying on AI to write IsOdd classes for me when the need arises. I tell it what I need, and it works out all the messy details. No more third-party libraries!
This service is lacking a major feature and too complicated!
Almost half of the time, I need to know if a number is even. Why doesn't it provide an end point for that?! Don't even tell me about the 409 status code. Am I suppose to know it's an even number when it returns an odd number to me? I only recognize status code 200, all other are errors, don't make this so complicated!
63 comments
[ 3.9 ms ] story [ 131 ms ] threadThere's suffient nuance and opportunity to be creative, while at the same time requiring some basic skills to set up (server, dns, https,and so on.)
Then for those more advanced there are creative extensions to implement - support any base, support text, in multiple languages, support formulas (is result odd or even) and so on.
Back in my university days we'd take trivial problems like this and "extend" them in creative ways faaar beyond the assignment. It both stretched or skills, and also taught us something about feature creep.
As in, sometimes it's OK not to build the perfectly generic, useful in all cases, megolith when a simple x % 2 == 1 will do.
(no wait %2 is slow, let's just &1 instead...)
https://isodd.dev/isodd.dev
it is instead, in fact, not a number
Perhaps the next version will have ChatGPT enhancements?
[0] - https://github.com/avinassh/gg-flip
[1] - https://avi.im/gg-flip/
Oh, and remember to always wrap your isOdd requests in a retry loop with exponential backoff.
I read ??! as a trigram
The const should have been a var. Get off my lawn!
Hmm, if I saw an actual outside-joke pedantic quibble? I'd probably lose my mind and go on an hours long rant about the declining state of HN comment threads. Hahah. Or maybe...Shrug sigh and move on? Or maybe...I probably wouldn't even see it...it's such a part of the background noise here. Or maybe...I'd laugh and try to engage humorously with the poor soul.
Wait...was this a pedantic quibble, was that what you just did? o.O hahah
Also, Elixir and the actor model is such an obvious match for this problem space!
Definitely happy to put this tool in my tool belt.
IMHO it's missing a ChatGPT (or other LLM) integration
https://devnull-as-a-service.com/
Almost half of the time, I need to know if a number is even. Why doesn't it provide an end point for that?! Don't even tell me about the 409 status code. Am I suppose to know it's an even number when it returns an odd number to me? I only recognize status code 200, all other are errors, don't make this so complicated!
FizzBuzz Enterprise Edition is a no-nonsense implementation of FizzBuzz made by serious businessmen for serious business purposes.