A Python programmer attempting Java

Jul 27, 2017 7:37 PM

AsshatTheCat

Views

84092

Likes

1253

Dislikes

33

i saw the code and my first thought was "huh looks like someones trying to write in basic but with objects. then i saw the right column

8 years ago | Likes 1 Dislikes 0

Agreed. Don't fucking do this.

8 years ago | Likes 3 Dislikes 0

Everyday we stray further from God or so I'm told

8 years ago | Likes 4 Dislikes 1

Who gave the monkey a keyboard and taught it to type ?

8 years ago | Likes 2 Dislikes 0

Who in there right mind...

8 years ago | Likes 3 Dislikes 0

As a python dev, took me a min :)

8 years ago | Likes 2 Dislikes 0

This is surprisingly readable. It's been formatted to use white space to guide the reader. Very much like python

8 years ago | Likes 2 Dislikes 0

actually, I don't think it's that bad.

8 years ago | Likes 2 Dislikes 1

As someone who has to write in Python... fuck this shit, fuck it to hell

8 years ago | Likes 2 Dislikes 0

This makes me want to snort a line of powdered glass

8 years ago | Likes 10 Dislikes 0

*powdered bleach

8 years ago | Likes 3 Dislikes 0

8 years ago | Likes 2 Dislikes 0

While i would never code like that... i see the logic to it...

8 years ago | Likes 12 Dislikes 3

To be honest that's one way to never forget semicolon or brackets, but at what cost.

8 years ago | Likes 2 Dislikes 0

Some CSS HTML compilers let you write like this. This looks like a manual attempt.

8 years ago | Likes 2 Dislikes 0

This code is 100% correct, the brackets are just all clumped indented on the right.

8 years ago | Likes 4 Dislikes 0

The brackets being grouped like that is the problem. It's a pain to trouble shoot something like that in practice, regardless of function.

8 years ago | Likes 1 Dislikes 0

v

8 years ago | Likes 5 Dislikes 0

Don't indent the left side and make it two columns while you're at it, Satan.

8 years ago | Likes 47 Dislikes 0

But as you can see, he is using tabs.

8 years ago | Likes 3 Dislikes 0

Python. This is Python's fault. Someone learned Python and tried to "fix" Java to make it look like Python. For some reason.

8 years ago | Likes 16 Dislikes 1

Python is the "training wheels" of coding languages.

8 years ago | Likes 2 Dislikes 2

No and yes. It's not python's fault, but what we have here is clearly a java hating cunt who, in his mind, did this to "fix" java.

8 years ago | Likes 5 Dislikes 0

I was trying to figure why on earth someone would do this. Thank you for enlightening me.

8 years ago | Likes 3 Dislikes 0

Amatures. https://en.wikipedia.org/wiki/Brainfuck

8 years ago | Likes 9 Dislikes 0

My favorite is HQ9+ https://www.esolangs.org/wiki/HQ9%2B

8 years ago | Likes 1 Dislikes 0

Good lord, I forgot about this.

8 years ago | Likes 2 Dislikes 0

Fuuuuck that.

8 years ago | Likes 2 Dislikes 0

8 years ago | Likes 4 Dislikes 0

They probably use spaces instead of tabs also.

8 years ago | Likes 7 Dislikes 2

Ouch.

8 years ago | Likes 1 Dislikes 0

Well yeah, everyone does at least one thing right.

8 years ago | Likes 3 Dislikes 1

Someone needs to get his Github password revoked. Gotta quarantine these sickos.

8 years ago | Likes 5 Dislikes 0

*twitch* *twitch* *twitch*

8 years ago | Likes 5 Dislikes 0

I'll be honest, if you know how to program in Python, what's so hard to read in this code? Each indent indicates a sub-code, simple!

8 years ago | Likes 4 Dislikes 1

Yes it's easy to read, but it's also harder to change.

8 years ago | Likes 3 Dislikes 0

I mostly work in Python. I love Python. This is a disgusting abomination. Take a closer look at the right side.

8 years ago | Likes 3 Dislikes 0

So, basically, he just makes Java code *look* like Python code, hiding the useless brackets and semicolons on the right.

8 years ago | Likes 2 Dislikes 0

Except they aren't useless, because it isn't python. Information is obscured. If you misindent, nothing catches it for you.

8 years ago | Likes 3 Dislikes 0

Although I agree that misindentation is a good point, don't most IDEs automatically indent for you?

8 years ago | Likes 1 Dislikes 0

The first pass, sure, the IDE can read the brackets and guess indentation levels. When editing, though, this is a nightmare.

8 years ago | Likes 2 Dislikes 0

You youngins just don't know the pain. in RPG programming certain characters had to be in certain columns. Good Times!

8 years ago | Likes 24 Dislikes 1

D pScrewThis S 69a

8 years ago | Likes 1 Dislikes 0

I still work with code that has shit like that. Very annoying. "Why doesn't this shit work. Oh.. there's an extra tab. Got it"

8 years ago | Likes 3 Dislikes 1

I still work with rpg...

8 years ago | Likes 4 Dislikes 0

Same! Free form helps

8 years ago | Likes 1 Dislikes 0

That would make me want an rpg to be fired at me.

8 years ago | Likes 1 Dislikes 0

My condolences. But I'm sure you're getting paid well ;)

8 years ago | Likes 3 Dislikes 0

I like the green tint and my f4 is worn thin.

8 years ago | Likes 5 Dislikes 1

As someone who knows both, don't blame python, blame the dev for not using the style libraries. They exist for a reason.

8 years ago | Likes 8 Dislikes 0

That is actually... Pretty reasonable.

8 years ago | Likes 2 Dislikes 0

Please elaborate, preferably with a direct link to a great resource where the unenlightened ones could gain this insight.

8 years ago | Likes 1 Dislikes 0

Unfortunately the github links were removed. But Google "languageName style guide" and the Google goes will come up

8 years ago | Likes 1 Dislikes 0

I prefer Google's style guides for the most part, but will make minor changes where I feel appropriate, which isn't often.

8 years ago | Likes 1 Dislikes 0

as a programmer: ?fb

8 years ago | Likes 146 Dislikes 1

I find it clever and actually nice to look at. I wouldn't want to try to edit it, though, and it would be a nightmare to try to find errors.

8 years ago | Likes 5 Dislikes 3

So it's clever and amusing, but in a "don't ever do this or I will break you" kind of way.

8 years ago | Likes 7 Dislikes 0

I nearly vomited.

8 years ago | Likes 9 Dislikes 0

;}}}

8 years ago | Likes 3 Dislikes 0

as a system admin:

8 years ago | Likes 6 Dislikes 0

I almost didn't see it and then almost broke my toilet seat. But maybe it's easier to find missing brackets and semicolons?

8 years ago | Likes 6 Dislikes 0

With python, this is fine, and functional syntax. Everything else. No. Apologies for the late reply.

8 years ago | Likes 1 Dislikes 0

Hey I'm just starting code academy. Am I one the right path I want to make games but amazing games and I'm the person that fucking does.!

8 years ago | Likes 2 Dislikes 0

My advice is to get a computer science degree. It's going to be very tough to become a good programmer without one. Codecademy is good /1

8 years ago | Likes 2 Dislikes 0

This is for personal use only don't need degree.

8 years ago | Likes 1 Dislikes 0

Exposure, but there is a LOT more to learn

8 years ago | Likes 2 Dislikes 0

Thanks for advice!

8 years ago | Likes 1 Dislikes 0

MRW I checkout their code v

8 years ago | Likes 247 Dislikes 2

1. Water is too clean. 2. They know they can't do that in tech support. 3. Other stereotype

5 years ago | Likes 1 Dislikes 1

Sari, not sorry.

8 years ago | Likes 36 Dislikes 0

That slowly got worse and worse. What the hell is that even from?

8 years ago | Likes 14 Dislikes 0

Iirc its an indian movie about a country girl who marries a wealthy man. Shes genuinely trying to be a duitiful wife.

8 years ago | Likes 17 Dislikes 0

That was slow and painful.

8 years ago | Likes 2 Dislikes 0

I couldn't stop watching but I wanted it to stop so bad. I kept saying"Please stop, its not too late." But it kept going...she won't stop.

8 years ago | Likes 2 Dislikes 0

Well, you can't say it's not clean now!

8 years ago | Likes 1 Dislikes 0

That makes me feel uncomfortable...

8 years ago | Likes 2 Dislikes 0

Fanfreakingtastic, like watching a whole film

8 years ago | Likes 2 Dislikes 0

There it is. The longest GIF in history.

8 years ago | Likes 2 Dislikes 0

I remember telling someone that this gif was staged/setup, and them not believing me.

8 years ago | Likes 4 Dislikes 2

It's from a TV show - her character is supposed to be naïve. Though, >bad editing

8 years ago | Likes 3 Dislikes 0

After a visit to usersub...

8 years ago | Likes 11 Dislikes 0

*pornhub usersub

8 years ago | Likes 1 Dislikes 0

v

8 years ago | Likes 2 Dislikes 0

The gif that keeps on giving.

8 years ago | Likes 2 Dislikes 0

The gif that keeps on GIFFING.

8 years ago | Likes 1 Dislikes 0

Can someone explain this to my friend? He doesn't know anything about programming.

8 years ago | Likes 216 Dislikes 5

{} denote blocks of code. This person aligned them vertically making it hard to tell what is in "permute" block and what is in "swap" block.

8 years ago | Likes 1 Dislikes 0

Basically, if this code was a person, I'd shoot it. It is not right. A mercy kill.

8 years ago | Likes 99 Dislikes 0

Thank you for this.

8 years ago | Likes 1 Dislikes 0

So, different 'statements' of code (Check that, set X to 4, ect) sometimes have brackets around them to section them off. Putting the

8 years ago | Likes 15 Dislikes 0

I just started coding g with code academy am I doing this right or is there a better place I want to make dank 3d games like pubg size

8 years ago | Likes 2 Dislikes 0

I wish you well. I use W3 myself. That and actual college. But you can learn a lot from the net.

8 years ago | Likes 1 Dislikes 0

Or a book but I've self taught alot. no college for me. Thanks for advice

8 years ago | Likes 1 Dislikes 0

brackets near the code in question produces something a human could read. But humans don't NEED to, only the computer does, and it can

8 years ago | Likes 9 Dislikes 0

read some funky shit. It doesn't care that all the brackets are in one column. I, a human (I swear), can't read it, but the computer can. E

8 years ago | Likes 8 Dislikes 0

Typically either brackets or indentation are used to indicate the beginning and ending of inner and outer statements. Java uses brackets /1

8 years ago | Likes 3 Dislikes 0

Where brackets within brackets are inner statements. Like if you put quotes within quotes in a sentence. However, you also indent nicely /2

8 years ago | Likes 3 Dislikes 0

To make it more readable. Python expects ONLY indentation so a Python programmer might be annoyed by Java's requirement for brackets /3

8 years ago | Likes 3 Dislikes 0

And instead put them all the way to the right in an absolutely atrocious but technically correct way, so that the code resembles Python /4

8 years ago | Likes 3 Dislikes 0

Comically, doing this will make no difference to the computer running it, but will make any true Java developer's eyes bleed :)

8 years ago | Likes 3 Dislikes 0

Might as well write it all on the same line, the computer doesn't care and nobody is going to waste their life checking your crap.

8 years ago | Likes 2 Dislikes 0

this iteratrs through the char array and prints the char value. the permute function is recursive.

8 years ago | Likes 1 Dislikes 0

The brackets and semicolons on the right make it all fuckey. Usually they are embedded in the code

8 years ago | Likes 1 Dislikes 0

On the right hand side there is a collum of brackets which make the code very difficult to read and bug check.

8 years ago | Likes 202 Dislikes 1

I remember I learnt a little bit of C+ on DOS and it was kinda like that to find errors in code

8 years ago | Likes 1 Dislikes 0

Alright. I thank you on my friend's behalf.

8 years ago | Likes 25 Dislikes 1

I didn't even notice the brackets until my second or third glance. I was wondering how this code could even compile.

8 years ago | Likes 3 Dislikes 1

Column*

8 years ago | Likes 16 Dislikes 1

I think my subconscious tried to protect me from that monstrosity. v

8 years ago | Likes 1 Dislikes 0

The programmer made the code look like it is Python. Except it isn't Python, it's Java, which traditionally looks different. 1/

8 years ago | Likes 1 Dislikes 0

This horrifies Java developers. It's like seeing a famous painting reproduced badly. It's the Uncanny Valley of Java programs. 2/

8 years ago | Likes 2 Dislikes 0

It technically works, but hurts your eyes. And the amount of time it would take to keep it looking "wrong" like as you edit code...*shudder*

8 years ago | Likes 1 Dislikes 0

All these devs and not a single one can speak layman-ese. Brackets mark the start and end of a statement in code. It's best to be able to >>

8 years ago | Likes 10 Dislikes 0

>> easily see where a statement starts and ends to avoid overlapping, which would break shit. Putting them all next to each other is >>

8 years ago | Likes 9 Dislikes 0

>> basically illegible.

8 years ago | Likes 8 Dislikes 0

(1/?) Basically, a program is a set of steps for the machine to follow in a specific order. When coding, for more readable code a developer

8 years ago | Likes 2 Dislikes 0

(2/?) Can separate code into "blocks" these blocks are defined by these curly braces. Commonly they are put in the same columb so you know

8 years ago | Likes 2 Dislikes 0

(3/?) which braces belong to each other, and what code belings in each block. Commonly code is indented b/w two braces in the same column

8 years ago | Likes 2 Dislikes 0

Whats depicted here is basically making the code less readable. Its doing the exact opposite and you dont know what belongs to what

8 years ago | Likes 2 Dislikes 0

In python, instead of braces (which java uses)... they use indentation to see what belongs to what

8 years ago | Likes 2 Dislikes 0

Its kind of like a math problem, {a+b[c+d(e+f)]}{a+b[c+d(e+f)]}{a+b[c+d(e+f)]}. Except they wrote it like

8 years ago | Likes 150 Dislikes 1

GJ on that explanation.

8 years ago | Likes 1 Dislikes 0

I just had a seizure

8 years ago | Likes 2 Dislikes 1

You're good at explaining things. I like you. Bravo

8 years ago | Likes 25 Dislikes 0

I guess i am, because i have no idea what this actually does, i barely passed java in HS 15 years ago, i just know whats wrong with it.

8 years ago | Likes 4 Dislikes 0

8 years ago | Likes 22 Dislikes 0

Albert Einstein once said "If you can't explain it simply, you don't really know it." Nicely explained sir.

8 years ago | Likes 11 Dislikes 0

What does it mean when i can roughly explain quantum physics to my mother, but i could never hope to understand the math cuz i never went +

8 years ago | Likes 3 Dislikes 0

past trig. I barely passed java in high school 15 years ago, im terrible with languages computer and human, i have no idea what this does +

8 years ago | Likes 3 Dislikes 0

or how, but i know enough looking at it to get whats wrong with it well enough to explain it? How the fuck does my brain work?

8 years ago | Likes 3 Dislikes 0