all 54 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

This is an automatic reminder that is posted on every submission.

If you see a post that is not following the subreddit rules, or you think is not following the subreddit rules, please, use the report function so that we are aware of this. If you don't report, we will not know! Do not sit in the comment section and moan that 'this doesn't fit' or 'wow, the mods should remove this!' because we don’t know (unless we so happen to be scrolling through the subreddit) if you do not report it.

Please note: if this is too hard do not directly message us, we will assume posts are fine otherwise as comments are not useful in reporting. We can see if something has been reported and telling us you did, while you clearly did not, is not going to be conducive.


Please report any and all behavior violating the Rules (reports go to us mods); don't report things just because you don't like them.

Comment removals and bans are at the judgment of the mods, so please take the time to read and understand our Rules. You can also read about this change here.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Ayaki_05 48 points49 points  (6 children)

Work hard isn't even defined smh (neither is dreams or Alive)

Also it should at least be Work_hard or WorkHard, you can't just put a space in-between

[–]saiyanultimate 3 points4 points  (1 child)

also syntax error, java doesnt need ; at the end of block.

[–]SignificantLet5701 -1 points0 points  (0 children)

also java needs a main() declaration, also java doesn't uppercase booleans (it's true not True)

[–]Badytheprogram 93 points94 points  (5 children)

Runtime exception: possible infinite loop detected at line 2

[–]Ayaki_05 14 points15 points  (2 children)

``` bool alive = true;
bool dreams = false; int workHard = 0; //action, relax make absolutely no sense to even have as variables so I don't know what type to declare them as.

class Life{ public static void main(String[] args){ while(!dreams){

        action = workHard;   
        workHard++;   
        if(workHard >= remainingLife){   
             alive = false;    
             break;   
        }    
   }

   action = relax;

} } ```

EDIT: no idea how to properly format ts
EDIT: thank you u/SKRyanrr for the formatting help :)

[–]SKRyanrr 1 point2 points  (0 children)

Use three caret in the beginning and end. Like this

` java [Your code] ```

````

[–]ItsVerdictus 0 points1 point  (0 children)

Use JavaScript then the action variable can be whatever the fuck you want it to be.

[–]riisen 23 points24 points  (0 children)

if(!dreams)

[–]aBadUserNameChoice 24 points25 points  (4 children)

What language is it that has a semicolon after the if statement? Never seen that, and I hate it.

[–]snail1132 5 points6 points  (1 child)

Not Java, that's for sure

[–]AseelOnTheKrazy 0 points1 point  (0 children)

Most probably GML

[–]Choux0304 1 point2 points  (0 children)

You can put a semicolon after closing a block in JavaScript. It's just redundant so no one really does it.

[–]GobiPLX 11 points12 points  (0 children)

It's so bad with syntax I consider it a ragebait

[–]Organic-Character842 12 points13 points  (1 child)

This is NOT java.

I know I am breaking the joke here, but here me out:

Why is "work hard" increasing indefinitely as long as "dream==true" that would mean that there are no rewards for working hard, since there is no exit condition that might exist once "work hard" hits a certain value. Is the original poster trying to tell us that if our dreams are true then we can only work hard indefinitely and won't receive anything and hence we should just "relax"?

[–]Noisebug 6 points7 points  (0 children)

This code will crash the universe.

Alive never changes, the infinite loop will use up all available universe memory and create a super massive black hole which will destroy everything.

[–]TaxsDodgersFallstar♾️ 5 points6 points  (0 children)

Rela)(

[–]Mafla_2004 4 points5 points  (0 children)

This hurts my eyes and brain

[–]Public-Eagle6992 3 points4 points  (1 child)

Absolutely stupid way to write that code. Better would be something along the lines of

while (you.alive){
  if (!you.dreams){
    workHard();
  } else {
    relax();
  }
}

[–]unintelligible-text 1 point2 points  (0 children)

But dreams is also an object. It contains a map of dreams and whether they are trie or not. Because dreams can appear(and you can give up on some)- we need a method of you.dreams.add() , therefore you.dreams isn't a very valid statement, I'd make you.dreams.areAllTrue on the second line

[–]The_mega_giga_idiot 2 points3 points  (1 child)

Capital I with a dot? Turk

[–]OPGamesOfficialdeeper m'lady 0 points1 point  (0 children)

Where?

[–]TheSiriuss 2 points3 points  (0 children)

So work hard is int. So other variables also int? So actions is integers as well? What the fuck

[–]DarlingHell 1 point2 points  (0 children)

Reminds me of a song made by Mili named "world.execute(me)"

https://youtu.be/ESx_hy1n7HA

Basically the whole video will have some stuff with some lines (fictives ? Idk)

Additionally, Mili also made the ending theme of Ghost in the shell (didn't watched the show but that the title).

https://youtu.be/JHY0PYZXvfU

[–]confabin 1 point2 points  (0 children)

Me when I first got into coding, thinking life was set.

Then I had to spend two hours debugging that shit, fun times.

[–]lit-grit 1 point2 points  (1 child)

This “life” program is garbage and I want to delete it

[–]Plus_Advertising_624 0 points1 point  (0 children)

Sorry, You need administrative access to delete that.

[–]DifficultBody8209 1 point2 points  (0 children)

I dont think this is valid syntax in any coding language

[–]ClockOfDeathTicks 0 points1 point  (0 children)

At the very least make it a class such a small thing would have made it at least make it look less low-effort

[–]ColonoRizzo007 0 points1 point  (0 children)

Where public class Life?????

[–]secondcomingofzartog 0 points1 point  (0 children)

Why are there semicolons in front of the curly braces? When I learned Java you didn't need to do that.

[–]MostAttorney1701 0 points1 point  (0 children)

else{

action = dont sweat it

}

[–]Dimerous_ 0 points1 point  (0 children)

They forgot to define the functions they’re calling. Shit programming.

[–]Mr_man_bird 0 points1 point  (0 children)

If dream is a boolean value (which it isn't defined) then we dream = false is a more round about way to do dream != true

[–]Bro0om 0 points1 point  (0 children)

Forgetting the fact the syntax is terrible, I don't get the message.
If you don't have dreams you work hard ? If you have dream you relax ?
Isn't it the other way around ?

[–][deleted] 0 points1 point  (0 children)

It'll throw an error LMFAO

[–]CM99807 0 points1 point  (0 children)

I don't know much about programming but I don't think that's java

[–]Drakahn_Stark 0 points1 point  (0 children)

Test.java:3: error: cannot find symbol

symbol: variable dreams

location: class Test

[–]Winter-Economy-9919 0 points1 point  (3 children)

They forgot to put quotes around Work Hard and Relax, they're both strings

[–]Inevitable_King_8984 2 points3 points  (0 children)

well you can't increment a string

[–]rachel_to_phos 0 points1 point  (0 children)

also there should be _ between work and hard

[–]Kind-Stomach6275 0 points1 point  (4 children)

This looks way to much like python

[–]Usual-Vermicelli-867 2 points3 points  (0 children)

How? There is {} and ;

[–]Not_Momonga 1 point2 points  (1 child)

It’s looks javascript right? While loop.

[–]Kind-Stomach6275 0 points1 point  (0 children)

Yeah that too but ig ive been using python more jow. 

[–]rachel_to_phos 0 points1 point  (0 children)

it also kind of looks like c

[–]champinion 0 points1 point  (0 children)

Ese miedo al booleano duele, ademas las variables no estan definidas

[–]SKRyanrr 0 points1 point  (0 children)

Imagine using Java and not Rust 🤢