r/ProgrammerHumor • • Jul 20 '18

Every Time

Post image
52.2k Upvotes

749 comments sorted by

View all comments

2.0k

u/Daposto Jul 20 '18 edited Jul 20 '18

Let's remove some enters and spaces in the code to make it cleaner and run it again, did it often haha.

949

u/Docaroo Jul 20 '18

It's like the compiler doesn't approve of your shitty-ass looking code formatting and doesn't take you seriously.

Clean it up and make it pretty and it believes your code is more credible now!

509

u/WorstGabeNA Jul 20 '18

Some call it python.

0

u/[deleted] Jul 20 '18

[deleted]

128

u/mpa92643 Jul 20 '18

Python is wonderful, but the lack of static typing drives me crazy sometimes (which is why I fell in love with Kotlin: best of both worlds). It's almost never a problem, but when the IDE can't tell me, "yup, that's definitely a string, here are all the things you can do with it" and instead tells me "yup, that's definitely some kind of object. Here's a list of functions you've used on it before, including your typo-ed ones, just try something and you'll find out if it actually works at runtime."

0

u/[deleted] Jul 20 '18

[deleted]

58

u/mpa92643 Jul 20 '18

It's exploding in use now that it's officially supported by Google for Android programming. It also forces Java best practices by default, which leads to cleaner code. I don't ever want to go back to Java after becoming familiar with Kotlin.

0

u/[deleted] Jul 20 '18

[deleted]

49

u/strike01 Jul 20 '18

I almost thought that "No" is a programming language

0

u/[deleted] Jul 20 '18

[deleted]

→ More replies (0)

0

u/[deleted] Jul 20 '18

[deleted]

0

u/[deleted] Jul 20 '18

[deleted]

→ More replies (0)

7

u/mpa92643 Jul 20 '18

Yeah, Google's policy seems to be "throw everything at the wall and hope something sticks, and occasionally just throw stuff away that people like." Kotlin is developed by JetBrains though and has been around for 7 years already, and they have a strong interest in keeping it around now that it has first-class support on Android. It's even got coroutines now, which are extremely useful in reducing callback hell on Android.

There are a ton of major Android apps and developers that have been using Kotlin in their codebase for years (since they can safely mix Kotlin and Java without having to rewrite any of their codebase), and lots of major libraries are adding Kotlin extensions to their code since it makes writing code so much easier and more concise.

→ More replies (1)
→ More replies (3)
→ More replies (3)

4

u/profbalr Jul 20 '18

Is there something equivalent for Python like Typescript for JS? I had the same issue with JS but recently picked up Typescript and it really changes the language.

→ More replies (3)
→ More replies (15)

11

u/diamondflaw Jul 20 '18

You have not seen my Python code then.

→ More replies (2)

0

u/[deleted] Jul 20 '18

[deleted]

→ More replies (1)
→ More replies (1)

11

u/Glass_Veins Jul 20 '18

I just encountered a bug that caused a test to fail if I normalised the line endings in the test suite. This was VB. Somehow it caused a multi-line SQL string to be misinterpreted even though it looked identical (just CRLF to LF). I no longer trust these whitespace languages, lol

17

u/[deleted] Jul 20 '18

or, be lazy and (automatically) go fmt your code. especially if you're a spaces bastard.

→ More replies (4)

6

u/JamminJames921 Jul 20 '18

Lol, like my LaTeX-made essays. Shitty content but beautiful formatting, 20/20

→ More replies (4)

85

u/crono1224 Jul 20 '18

Or the reverse of it not running after you remove some white space. Turns out that was load bearing white space.

14

u/[deleted] Jul 20 '18

Load bearing white space - classic 😂

8

u/verascity Jul 20 '18

There are some quality puns happening in this thread.

→ More replies (1)

17

u/[deleted] Jul 20 '18

Is it still white space if you use a dark background? philosoraptor.png

6

u/[deleted] Jul 20 '18

Sometimes you find your problem doing this. Not the worst way to debug

→ More replies (1)

3

u/Fluffcake Jul 20 '18

You never know. At least in js there are a few cases where ASI will fuck you if your code is formatted silly.

→ More replies (9)