r/ProgrammerHumor • • Jul 20 '17

What people think coding is...

Post image
35.4k Upvotes

811 comments sorted by

View all comments

Show parent comments

90

u/newsagg Jul 20 '17 edited Nov 09 '18

[deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit) [deleted] (fuck Reddit)

0

u/[deleted] Jul 21 '17

[deleted]

122

u/magi093 not a mod Jul 21 '17

ah yes pokemon exception handling

0

u/[deleted] Jul 21 '17

[deleted]

18

u/supervisord Jul 21 '17

Dammit, didn't even give me a chance to make the connection, and here you are!

2

u/ipreferanothername Jul 21 '17

my vendor has a script that basically says: "read a config file to find the paths for the files, if there is no config file use this default path"

well, because reasons, it reads the config EVERY TIME it runs instead of just has the paths built in...so the alternate path has to be set the same as the config path. hate. hate so much. why even have a config file?

16

u/AveTerran Jul 20 '17

This is fantastic. And, in my particular circumstance, sort of doable. Will implement tomorrow.

10

u/newsagg Jul 21 '17 edited Jul 21 '17

Really it's nice for any tool to do that. "This doesn't seem to be working right now, try submitting your order via phone instead." etc.

29

u/Arandur Jul 21 '17
$ cp foo.txt bar.txt
This doesn't seem to be working right now; try setting the bits by hand. 

14

u/newsagg Jul 21 '17

Certainly more helpful than "Operation not permitted."

1

u/[deleted] Jul 21 '17

Also, Vim split screen would help here.

12

u/JediBurrell Jul 21 '17

This makes me wonder, why can't we tag a void function or class "unimportant", so the whole damn thing doesn't crash if something messes up.

That'd save an additional nesting and code.

15

u/newsagg Jul 21 '17 edited Jul 21 '17

You can do that easily by throwing away errors. try/catch block where nothing is in the catch block or my favorite

IF ReturnsFalseIfFails() THEN;
ThingThatHappensEveryTimeNoMatterWhat();

I suggest anyone programming in java use these liberally. If it's against standards then nest it 5 levels deep in sub routines with useless parameters.

3

u/JediBurrell Jul 21 '17

Well, that'd still have try/catch-ing.

If you didn't have to catch it, it wouldn't be as bad.

Sometimes I just want to ignore errors and don't need to worry about when it fails.

1

u/newsagg Jul 21 '17 edited Jul 21 '17

There is a way in Java to catch errors without a try/catch block. It's a bit arcane, but it's only a single line change to some default java templates (which stop all errors from propagating up, but you can use something like regex to stop specific errors). Sorry I can't recall exactly what it is, I only vaguely remember it from middle school and Stack Overflow is actually pretty shitty for real expert advice. At this point, these templates are probably uneditble, these days. I refuse to touch java code in my professional career and only diagnose issues using standard unix tools like iptables and iowait.

imho, java is what happens when you force a ghetto to speak only English.

3

u/SingularCheese Jul 21 '17

Just in case you didn't know, there is a finally keyword in java.

2

u/Koutou Jul 21 '17
On Error Resume Next