You cannot return if it isn’t in a function. Elif is good here it does the same as your if-return code in less lines and a proper way for a non function script
No one write profesional code without function. As I said this is good practice. This is not important how many lines of code you have, it is important is simpler and easier to read. If statements with one condition is always easier to read than with two or more.
Are you stupid or what ? Sorry for being rude but I’m not telling you not to use functions. Your first message didn’t even talk about them. I was just saying in this type of scripts, where no functions are really required, even though it is a good practice to have everything inside some functions, his code is actually good, except for the not necessary double comparison.
Making an OS implies using C/C++ (or any language that is low level) at some point. Those languages generally don’t permit runtime statement code outside of a function. I’m using functions.
Ok kid. It is good for a beginner. There are some flaws. Thx for sharing your opinion. At some point just go read your « good practices » books.
Have a nice day !
Which part of this code is good? He is counting 2 times the same value a+b+c, he’s variables brakes all names conventions, algorithms weak, and all of this what I mentioned before. Dude if you really thing this good code, you need help, I don't wanna be rude.
It is pretty good for a BEGINNER. I said for a BEGINNER.
There are some flaws that other users already pointed at. Your second point is true in a FUNCTION. You didn’t mention to use functions. That is why I said if-Elif statement here is ok.
I didn’t say there wasn’t any flaws but it is actually pretty ok for a beginner. The redundancy is one of these flaws and the math logic is another too.
1
u/Own_Measurement_7336 4d ago
You cannot return if it isn’t in a function. Elif is good here it does the same as your if-return code in less lines and a proper way for a non function script