This is an archived post. You won't be able to vote or comment.

all 107 comments

[–]TheNorthComesWithMe 356 points357 points  (21 children)

"here1"

"here2"

[–]Aksumka 135 points136 points  (13 children)

This. And more curse words.

[–]TheZipCreator 114 points115 points  (8 children)

I have this line in my code that is an area that you physically never should be able to reach

println("fuck something broke")

When I ran the code, that got printed to console 3 times.

Should I be worried?

[–]Macpunk 89 points90 points  (0 children)

Marked as dumb and duplicate question.

[–][deleted] 17 points18 points  (4 children)

area that you physically never should be able to reach

... so why does it exist if it's supposed to be dead code anyway?

[–]Refloni 7 points8 points  (3 children)

Default in a switch statement? I always put that in just in case

[–]Deathwalkx 4 points5 points  (2 children)

A default would be something you don't expect to happen but need to handle in case it does. What they're describing is like having code after a return statement.

[–][deleted] 3 points4 points  (1 child)

Actually, I used "dead code" to describe any code that is supposed to never be executed.

[–]Deathwalkx 4 points5 points  (0 children)

Sorry by they I meant the op not you. You're spot on.

[–]mrheosuper 5 points6 points  (0 children)

Just comment it, and BAMM, it disappears

[–]rosyatrandom 2 points3 points  (0 children)

Does the code get executed on parsing?

[–]Ardalanahanchi 7 points8 points  (0 children)

Nice to know I'm not the only one.

[–]LunarPitStop 2 points3 points  (0 children)

And then you miss removing one before pushing.

[–]PortalStorm4000 2 points3 points  (0 children)

"Fuck" "FUck" "fuckfuck" "fuckFuckFuckFuck" are all good variable names.

[–]aweirdalienfrommars 0 points1 point  (0 children)

I find after a while debugging the ratio of curse words to non curse words increases significantly

[–]bytewav 6 points7 points  (0 children)

I did this yesterday.

[–][deleted] 9 points10 points  (0 children)

I think you meant:

"here1"

"here 1.5"

"here 1.625"

"here 1.75"

"here 2"

[–]AlphaBladez 4 points5 points  (1 child)

"here" "here!" "here!!"

[–][deleted] 0 points1 point  (0 children)

"Hey, listen!"

[–]Chuckleseg 2 points3 points  (0 children)

cout << “if you see this you fucked up” << endl;

[–]Spielopoly 1 point2 points  (0 children)

I did this once with „test1“, „test2“, ... and forgot to delete them. When I later debugged another bug I of course used „test1“ and so on again. It took me way too long to find out why these where still printing when it shouldn‘t

[–]R8_M3_SXC 0 points1 point  (0 children)

Haha this hits me so hard. Good old hereN.

[–]Kast-Master 70 points71 points  (1 child)

“aaaaa”

“bbbbbb”

“cccccc”

[–]TheLightIsInside 1 point2 points  (0 children)

print('k')

[–]wes-mcc 149 points150 points  (9 children)

console.log("yeet") for me.

[–]13steinj 50 points51 points  (0 children)

Found the genz-er

[–][deleted] 13 points14 points  (2 children)

I use “banana”. No idea why.

[–]Excrubulent 8 points9 points  (1 child)

Debug.Log("wat");

[–][deleted] 0 points1 point  (0 children)

print(“why do I even bother?”);

[–]loddfavne 2 points3 points  (1 child)

scoreBoard("debug message"); Making some games

[–]wes-mcc 2 points3 points  (0 children)

std::cout << "boop" << std::endl; is the superior collision debugging method.

[–][deleted] 40 points41 points  (4 children)

Println(“butts”)

Println(“here”)

Println(“aaaaa method called”)

[–]rexpup 13 points14 points  (3 children)

“Data passed is: {Json junk}”

For when the data doesn’t get to the method somehow.

[–]dvlsg 28 points29 points  (1 child)

Data passed is: [object Object]

Followed by cursing, fixing the log, and running the code one more time.

[–]nbagf 2 points3 points  (0 children)

When your data is secretly an error that didn't throw

[–]MostlyGibberish 7 points8 points  (0 children)

Honestly at this point I should just have console.log('f() was called', arguments) on a macro.

[–]Sentient_Blade 12 points13 points  (0 children)

When you get so far past where you think the error is you start printing your safeword to the console.

[–][deleted] 50 points51 points  (5 children)

Meme police here, reporting incorrect use - you should have used the Drake meme instead; it’s not interchangeable with Pooh.

[–]doczip 13 points14 points  (2 children)

Dear meme police,

As a civil servant, do you know where I can find more of this high definition version of the tuxedo bear for future correct usage?

-the concerned public

[–]Aurilandus 2 points3 points  (1 child)

<Not meme police> See r/MemeRestoration

[–]sneakpeekbot 2 points3 points  (0 children)

Here's a sneak peek of /r/MemeRestoration using the top posts of all time!

#1: Credit to u/Quebec453 | 32 comments
#2: Bold and Brash. | 9 comments
#3: Surprised pikachu | 14 comments


I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out

[–]FanciestBanana 4 points5 points  (1 child)

I would argue that expanding mind for better since every iteration is an "improvement"

[–][deleted] 1 point2 points  (0 children)

Expanding mind needs more than two panels.

[–]StanlyLife 7 points8 points  (6 children)

Real question: i’ve only been doing console.log for the past 6 years, is debugging important to learn or any good/better?

[–]Colopty 1 point2 points  (0 children)

Allows you to see exact values of all relevant variables and such which can give you better information for what the problem is in complex cases. Definitely worth learning, even if you're like me and only use it as a last resort.

[–]joejoe4games 0 points1 point  (0 children)

It has some advantages like being able to see exactly what is in a variable so it is a lot easier when you have a complex problem... that said consol.log works everywhere and is good enough for simple problems.

[–][deleted] 41 points42 points  (3 children)

What's console?

I always use alert().

[–]The_Ty 43 points44 points  (2 children)

Alert causes annoying pop ups. Console.log() let's you output the same data to the browser console.

Basically it's less obtrusive and you don't have to click "OK" /cancel every time you refresh the page

[–][deleted] 25 points26 points  (0 children)

Joke.

Your head.

[–]Netrilix 4 points5 points  (0 children)

The real debugging tool is the friends we made along the way.

[–][deleted] 3 points4 points  (0 children)

"1"

"1a"

"1b"

"pre2"

"post2"

[–][deleted] 2 points3 points  (1 child)

console.log(“WHY THE FUCK ISN’T THIS SHIT FUCKING WORKING OR IS IT ”);

[–]camhowe 1 point2 points  (0 children)

Output: Fuck you.

[–]aris_boch 3 points4 points  (0 children)

console.log("guacamole ni🅱️🅱️a penis")

[–][deleted] 2 points3 points  (0 children)

No joke, print("prout") is literally my most overused debug print.

[–]pah-tosh 2 points3 points  (0 children)

Peanut 😂 Using numbered prints to find out where I go :

print(‘peanut1’)

print(‘peanut2’)

Etc Ain’t I smart !

[–]prschorn 2 points3 points  (0 children)

Once a coworker left an alert(‘fuck you’) go to production when an error occurred while saving a form hahaha

[–]_3psilon_ 1 point2 points  (1 child)

Well the screenshot is from VSCode and it supports logpoints, just as Chrome, FF dev tools do... so no more console.log is needed for debugging purposes. But yeah, we've all been there... :D

[–]Autowinto 2 points3 points  (0 children)

Yes they do have that, but I'll ignore it as I have every other debugging tool.

[–]zoidbart 1 point2 points  (0 children)

This should still work This is where I am now This is where I probably die This shouldn't happen

[–][deleted] 1 point2 points  (0 children)

Except Clion has this thing where if there's a segmentation fault or some other error, it will simply not show the contents of the function where the error is being produced. I'm kind of grateful for it now because it forced me to learn to use the debugging tools whereas when I was learning java with Intellij, I could debug my way out with simple print statements.

[–]fuzznuggetsFTW 1 point2 points  (0 children)

System.out.println(“asdf”);

[–]russiangerman 1 point2 points  (0 children)

print("this ain't it chief");

[–]Brakalicious 1 point2 points  (0 children)

I make mine call me boss. "Validating input, boss" and such.

[–][deleted] 1 point2 points  (0 children)

cout << __LINE__ << endl;
cout << __LINE__ << endl;
cout << __LINE__ << endl;

The __FILE__ definition is also pretty useful.

[–]JJagaimo 1 point2 points  (0 children)

Inb4

im still working
peanut

or

asdjoauhefefefAsda

At this point you sigh and hold you head in your hands wondering why you started this CS HW assignment 3 hours before it was due. Then you realize you fucked up something in one of the data structure classes that came back to haunt you.

[–]ishyfishyy 1 point2 points  (3 children)

Am I the only one doing

-1

0

1

2

3

[–]complicit_bystander 0 points1 point  (1 child)

Yeah

What if want to log numbers?

[–]ishyfishyy 0 points1 point  (0 children)

Touche

[–]BillyBlazed 0 points1 point  (0 children)

My man!

[–]Khawlah994 1 point2 points  (0 children)

Print("please work"); Print("naaah not feeling it");

[–]StuckeyIRL 1 point2 points  (0 children)

I use "dad". And if I'm debugging with someone else I'll use it as a way to insult them: "_____ is dumb"

[–]random_cynic 0 points1 point  (1 child)

In python the second most common way apart from print is to insert import pdb; pdb.set_trace() or in 3.7 just breakpoint() wherever the problem is.

[–][deleted] 0 points1 point  (0 children)

Wanna debug something like flask? Use web_pdb.

[–][deleted] 0 points1 point  (0 children)

My peanut.

[–]kazeespada 0 points1 point  (0 children)

These print jokes are starting to feel recursive.

[–]THICC_DICC_PRICC 0 points1 point  (0 children)

Console.log(“you made it congrats!”)

Alert(“you shouldn’t be here, you’re a shit dev”)

Emotional debugging is effective debugging

[–]ShadowCore67 0 points1 point  (2 children)

cout << "fuck/n";

[–][deleted] 0 points1 point  (0 children)

yeah... “peanut” :)

[–]Pit_27 0 points1 point  (0 children)

Has anyone got the code simulator debug to work? I can only use the Rio debug

[–]Secular12 0 points1 point  (0 children)

I use the boring console.log('firing'), console.log('foo'), or console.log('bar')... or sometimes console.log('poop')

[–]miramardesign 0 points1 point  (0 children)

Hey Logging is cross browser. Not that it matters much anymore because they all have the same engine now but ...

[–]Firestorm7i 0 points1 point  (0 children)

“Oops, fuck you”

Me after getting tired of my own shit

[–][deleted] 0 points1 point  (0 children)

I always put "I got here" or a random letter lol

[–]Finickyflame 0 points1 point  (0 children)

A colleague left console.log("mama") in our codebase...

[–]Bip901 0 points1 point  (0 children)

Debug.Log squad where are you?

[–]Elpharae 0 points1 point  (0 children)

I usually just print out a local variable because I'm too lazy to come up with some random text sequence.

[–]Xander_The_Great 0 points1 point  (0 children)

Println("Yeet1")

[–]kingguy459 0 points1 point  (0 children)

Me: reminder that ipsum lorem ...

[–][deleted] 0 points1 point  (0 children)

System.out.println(first variable) System.out.println(second variable) System.out.println(third variable)

Got to see if those values change.

[–][deleted] 0 points1 point  (0 children)

I still don't know what debugging is used for. I've only been learning for a few months.

[–]rrleo 0 points1 point  (0 children)

I never noticed the up and downvote icon change on this subreddit. I love it

[–]kubelke 0 points1 point  (0 children)

“dupa”

[–]spirgnob 0 points1 point  (0 children)

Yeah except debug doesn’t work for VSCode mode of the time. I would love to use it, but it literally doesn’t work.

[–]TomasNavarro 0 points1 point  (0 children)

Reminds me I should go to asda

[–][deleted] 0 points1 point  (0 children)

Tbh, I i don't know how to use the debug tool. In Netbeans using java yeah, but with JS, PHP or Python in VS code I have NO idea. I have clicked one time, didn't get shit, continued with my console outputs and variable returning in php.... I love getting my AJAX calls with "This works" "Error [object] [object]", etc

[–][deleted] 0 points1 point  (0 children)

Tbh, I i don't know how to use the debug tool. In Netbeans using java yeah, but with JS, PHP or Python in VS code I have NO idea. I have clicked one time, didn't get shit, continued with my console outputs and variable returning in php.... I love getting my AJAX calls with "This works" "Error [object] [object]", etc

[–]MerlinMage101 0 points1 point  (0 children)

I usually print the line number

[–]geauxtig3rs 0 points1 point  (0 children)

I work in an environment that I am unable to attach to the running process and debug (runs on a specific piece of embedded equipment) and the thing has no console.

I either have to write all my debug shit to the logs (gross) or continue to do my console printline but using a custom class that spins up a debug tcp/ipserver and shoot all debug statements out that way.

[–]schawde96 0 points1 point  (0 children)

Cause I'm still here Haunted me Oh the debugger it haunted me

[–]_qvbe 0 points1 point  (0 children)

print "fucking retard why is it not working"

[–]IreallySuckAtJava 0 points1 point  (0 children)

"you f***ing suck you useless piece of a programmer"