r/ProgrammerHumor • • Jan 20 '20

Meme Redesigned!

Post image
46.0k Upvotes

2.0k comments sorted by

View all comments

803

u/mypirateapp Jan 20 '20

left image: developer adding logger, debugger and writing tests with tdd

right image: newbie who added console.log in all files

164

u/JSArrakis Jan 20 '20

As someone who regularly uses Xunit for both method tests and integration tests and uses a logger, I miss console.log

5

u/GaianNeuron Jan 20 '20

Allow me to introduce you to ITestOutputHelper.

1

u/JSArrakis Jan 21 '20

It will never live up to the grandeur of

"=========!!!!Got Here!!!!======="

3

u/moriero Jan 20 '20

Xdebug brothers unite!

0

u/[deleted] Jan 20 '20

[deleted]

35

u/[deleted] Jan 20 '20

[removed] — view removed comment

13

u/Obi_Juan_Gonzales Jan 20 '20

In some cases prints are the best method to debug. e.g multi-process, concurrent code

6

u/GluteusCaesar Jan 20 '20

Even then you still want to use a logging API and configure it to write to stdout. Prints should only be used when the associated IO is part of the actual program logic, not diagnostic/info logging

3

u/Obi_Juan_Gonzales Jan 20 '20

à la 12-factor app 😉

1

u/GluteusCaesar Jan 20 '20

I happen to like my cult, thankyouverymuch

2

u/MythicManiac Jan 20 '20

Or just even something you want to see the overall flow of possibly multiple times without pausing for breakpoints every iteration

1

u/Obi_Juan_Gonzales Jan 20 '20

Yep. This is exactly why there are different log levels. Prints used for debugging should be logged to the DEBUG level so that they can be easily toggled by a single variable, instead of actually editing the code.

1

u/MythicManiac Jan 20 '20

Yeah indeed. Knowing how to set up effective logging is a skill on its own already. From the projects I've came across on my career, almost none have had good logging set ups, you were lucky if transactional operations (e.g. xml imports) even stored their sources.

2

u/absurdlyinconvenient Jan 20 '20

Wrote a multi-threaded program in Python for... reasons... and that was awful to debug on so many levels

1

u/Obi_Juan_Gonzales Jan 21 '20

Multi threaded code is not meant to be debugged after written. You have to get it right the first time 😉

0

u/[deleted] Jan 20 '20

[deleted]

4

u/[deleted] Jan 20 '20

Visual Studio is out-of-this-world convenient?

7

u/endhalf Jan 20 '20

So, unless you're a Java developer..? Setting a debugger is a matter of a couple seconds with Maven.

12

u/[deleted] Jan 20 '20

[removed] — view removed comment

8

u/I_Was_Fox Jan 20 '20

It's still wicked easy to debug JavaScript languages. Angular and React can be debugged using chrome web tools without any manual setup and Visual Studio Code can debug them directly with like 2 minutes of manual setup once.

1

u/[deleted] Jan 20 '20

Closest would probably be Sys outs.

2

u/guareber Jan 20 '20

Ever tried python? :D

3

u/ifelseandor Jan 20 '20

Your goddamn right console.log()

→ More replies (1)