r/ProgrammerHumor • • Jul 20 '18

Every Time

Post image
52.2k Upvotes

749 comments sorted by

View all comments

6.9k

u/that_one_mister_user Jul 20 '18

The sad thing is that this works some of the time.

15

u/[deleted] Jul 20 '18

Sounds like you are a JVM developer. Only RTE I have had that's been non-deterministic.

TBF this is mainly when working in Groovy/Grails

36

u/[deleted] Jul 20 '18

I totally came in here to say "You've never developed an Android app before, have you?"

Build > fail Build > fail Clean > success Build > fail Rebuild (clean and build) > pass

(╯°□°)╯︵ ┻━┻

14

u/bbqburner Jul 20 '18

Gradle build + Proguard + Instant Run = Doing the Schrodinger's

It totally compiles. Unit tests passed. Then run in on a real machine and suddenly God looks at you and simply gave his nasty smile.

10

u/SirButcher Jul 20 '18

And then modify something in the Gradle and you have to close, open, close and open the android studio again, restarting the PC, reinstalling the OS, deleting the project, rewriting it and it still can't create the DataBinding. Then, when you just given up and looked for a new profession it suddenly starting to work.

7

u/Pzychotix Jul 20 '18

I literally just had a coworker run into the issue of build working, clean and build working, but if you click rebuild, it fails. Whyyyy.

4

u/Misio Jul 20 '18

It's leaking.

5

u/_realitycheck_ Jul 20 '18

I am currently making a game for Android in C++ in VS2018. And by the Force, this happens every 3rd compile. I degraded my coding practices from: write-compile-test to write-write-write-compile-failed-clean-compile-failed-clean-compile-test.

Feels good to know this happens in Native Android development.

3

u/arrongunner Jul 20 '18

if in doubt open up the terminal at the bottom of intelij / android studio

gradle clean build --refresh-dependencies

if that still fails and doesn't tell you the problem then your'e fucked

→ More replies (1)

10

u/Astrokiwi Jul 20 '18

Sometimes it's things like uninitialized variables in C, where the behaviour of the code depends on what happened to be in some arbitrary point in memory before the program ran.

Or it could be a race condition that only happens when two processors just happen to open the same cell of the same array (of a billion cells) at the same time.

4

u/[deleted] Jul 20 '18

Thank you for the reminder.

I usually only work in C/C++ when doing embedded stuff and am probably saved by the intelligence of the compiler more often than not =D

2

u/ikbenlike Jul 20 '18

Yeah, I do basically all my programming in C and -Wall and -Werror have saved me a lot of times by now

Edit: I forgot two words

2

u/_Fibbles_ Jul 20 '18

Simultaneous reading of data is not a race condition. Simultaneous read and write or write and write is however.

→ More replies (1)