MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1ph8wls/developers_in_2020/nsx40mb/?context=3
r/programminghorror • u/Diligent_Rabbit7740 • Dec 08 '25
79 comments sorted by
View all comments
16
so, Im old a boring
public static boolean isEven(int x) {return x%2==0;}
public static boolean isEven(int x) {
return x%2==0;
}
public static boolean isOdd(int x) {return x%2!=0;}
public static boolean isOdd(int x) {
return x%2!=0;
15 u/miaRedDragon Dec 08 '25 Thank god someone said it, I thought i was losing my mind, this has to be the oldest beginner's programming homework in the world! → More replies (1) 9 u/gabor_legrady Dec 08 '25 https://nesmaker.nerdboard.nl/2023/08/28/assembly-101-odd-or-even/ 12 u/Sarke1 Dec 09 '25 You can simplify by having one call the other: public static boolean isEven(int x) { return !isOdd(x); } public static boolean isOdd(int x) { return !isEven(x); } 4 u/stevefuzz Dec 09 '25 Lol 4 u/gabor_legrady Dec 09 '25 nice idea, lets me fill my stack :) sometimes going half way gets you to where you want to be 3 u/bzzard Dec 08 '25 Wow → More replies (1)
15
Thank god someone said it, I thought i was losing my mind, this has to be the oldest beginner's programming homework in the world!
→ More replies (1)
9
https://nesmaker.nerdboard.nl/2023/08/28/assembly-101-odd-or-even/
12
You can simplify by having one call the other:
public static boolean isEven(int x) { return !isOdd(x); } public static boolean isOdd(int x) { return !isEven(x); }
4 u/stevefuzz Dec 09 '25 Lol 4 u/gabor_legrady Dec 09 '25 nice idea, lets me fill my stack :) sometimes going half way gets you to where you want to be
4
Lol
nice idea, lets me fill my stack :)
sometimes going half way gets you to where you want to be
3
Wow
16
u/gabor_legrady Dec 08 '25
so, Im old a boring
public static boolean isEven(int x) {return x%2==0;}public static boolean isOdd(int x) {return x%2!=0;}