Java in GTA5

I found this in GTA5. I enjoyed it.

http://prod.cloud.rockstargames.com/ugc/gta5photo/2528/AXHj9RIoT0GLhi6XX4-PmQ/0_0.jpg

Here’s the source code. Be sure to ask Rockstar before using it commercially:

package java.cappuccino;
import java.shot.milk.foam;

public class Breakfast extends Meal {
    private double espresso;
    private int bread;
    private int bacon;

    public void sandwich() {
        bread = 2;
        bacon = 2;
        return bread + bacon;
    }
}

Haha oh that’s amazing! Those variables in the sandwich method though… it’s bothering me because they dont use the this keyword :confused: I know it’s not needed, it’s just one of my weird coding practices to make things more readable in my eyes…

“return bread + bacon” in a void method? Hahahahaha

Damn, didn’t even notice that!
I’m turning in my programmer card now. Can’t take the shame.

well if you always use it, then at some point like 30% of your code will be “this” - you may stop at some point too =P

Meh, I just like how it looks. Being able to scan through my code and see all my class variables vs my shared variables from other classes easily is nice.

I too use “this.” whenever possible (Except for constructors, not sure why). It makes my code bulkier, but I’m fine with it.

EDIT: Nevermind, stupid RequestPolicy hid the image.

Funny, but why make that method void? ??? Pretty much any Java expert (Or newbie, for that matter) would’ve corrected that.

I think there is some really clever joke we’re all missing in the code. Not sure what it is and I’m too lazy to try and work it out. It might’ve been some artist’s terrible attempt at making a programming joke.

Maybe some developer didn’t get their meal or something.

Then again, it might just be there for the fun of it.

The actual code in the game is missing the last two closing brackets. I couldn’t bring myself to post it that way, though.

At least we can say Rockstar used Java in GTA5… obviously, they are still learning.

Est. 2004? Coffee shops all came around in 1994.

Well…it’s not like 1994 was the only year allowed to found a coffee shop…

That’s the quality of code you get when you ask artists to program :wink:

Hahaha good find. I could tell these guys were actual programmers after that LifeInvader mission…

Any idea where this is located on the map?

I think this should work: Link

Click the little pin icon next to the thumbs up. Should show the location. You’ll probably have to log into socialclub.

It’s funny b/c I probably wouldn’t have laughed at this if I weren’t a programmer ;D