I'd say code for a class has different requirements for comments than business code.
The prof needs to know you understand what you wrote (or copied) and explaining semantics behind the syntax is enough. In a business setting it's more important to know the why instead - you know what the code does, but why is it done like that?
No, it's fine. This is just relying on another process to modify its memory concurrently. Unfortunately, there is a data race in which you can become successful, exit the loop, and then become unsuccessful.
They haven't defined any of the variables, and why is main inside algorithm class? algorithm.main() huh? And if the function tryAgain is static how does it have access to success? (hint: it doesn't) This wouldn't even compile let alone run.
17
u/[deleted] Nov 05 '18
302
u/PerfectionismTech Nov 05 '18
Surprisingly accurate documentation.
116
u/mydoglixu Nov 05 '18
the most annoying part of this is the apparently arbitrary extra blank lines.
111
u/peetvk Nov 05 '18
They haven't defined success
72
u/lamvn123456 Nov 05 '18
Wow success is a static variable ? No wonder everyone can achieve it and I have starvation problem.
50
u/twistdafterdark Nov 05 '18
Where do confidence and hardWork come from? Are they undefined or am I missing something?
The code doesn't seem to be working for me.
39
u/NoodleThe3rd Nov 05 '18
Is dead protected? Or could i just "dead = true;"?
16
u/ThaiJohnnyDepp Nov 05 '18
I really hate the "spaces inside parentheses, no space before the open curly brace" style
4
u/StaleTheBread Nov 05 '18
So confidence and hard work lead to success, but whether you succeed or die, nothing happens
4
u/[deleted] Nov 06 '18
asking for web devs, showing java instead of html/js and stuff
1
u/brimstone1x Nov 06 '18
Paid internships...like a job?
3
u/Nevik34 Nov 05 '18
My Monday morning was actually going okay until now. This hurt me.
3
u/DizzySkin Nov 05 '18
Simulation considered incomplete. Customer rejected the simulation because it lacked expected features: Sleeping, Eating, Love, Humanity.
3
u/GoldfishBowlHead Nov 05 '18
tryAgain()?
Why is this not a recursive function?
1
u/guy_who_says_stuff Nov 05 '18
do you even code review?
1
u/Jodohr Nov 06 '18
They could at least use the syntax color to make it LOOK like their shit was declared elsewhere...
-2
u/soundman10000 Nov 05 '18
They haven't defined any of the variables, and why is main inside algorithm class? algorithm.main() huh? And if the function tryAgain is static how does it have access to success? (hint: it doesn't) This wouldn't even compile let alone run.
-2
u/Famous1107 Nov 05 '18
That uppercase string in the main parameter list makes me want to puke.
Please don't start your methods with a lower case.
0
u/[deleted] Nov 05 '18
[deleted] — view deleted comment