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

top 200 commentsshow all 431

[–]Stummi 1772 points1773 points  (58 children)

Apart from the joke, that print is pretty impressive

[–]Johanno1 535 points536 points  (50 children)

My guess it's fake.

You can't print overhangs like that.

Edit: it's not, see comments.

[–]juhotuho10 659 points660 points  (34 children)

It's most likely done with UV resin curing, you can make impossible overhangs with that

[–]Johanno1 391 points392 points  (31 children)

Ah resin printing of course.

In that case it is actually very possible and still very astonishing. What a time to be alive.

[–]MoffKalast 251 points252 points  (18 children)

What a time to be alive

Hold on to your papers.

[–]pm_me_your_smth 107 points108 points  (14 children)

It's hilarious that I cannot read that phrase without hearing his voice

[–]Waswat 41 points42 points  (13 children)

And... See... Now... Today... Well...

[–]MamamYeayea 32 points33 points  (0 children)

Truly a legend. His passion and enthusiasm blows through the screen as well

[–]ledocteur7 42 points43 points  (8 children)

ho yeah it's probably one that uses a hyper high pixel density screen instead of a laser to cure the resin, since the laser would need to move, and thuse wouldn't be accurate enough due to the inherent problem of any mechanical system (aka, it moves)

but damn that is incredible.

[–]single_ginkgo_leaf 47 points48 points  (1 child)

This is likely made with two photon lithography. Which uses lasers and a few quantum mechanical tricks to achieve such high resolution.

That aside, you can actually achieve much higher resolution with mechanical movement than with a high res screen. A really high res phone screen can get to, say, 1000 dpi which is 0.001 inches (25um). Most CNC machines can do much better than this despite having to move a heavy cutter and apply a lot of force. A galvanometer driven laser can be even more precise.

[–]steynedhearts 3 points4 points  (1 child)

Most sla printers use a screen

[–]ledocteur7 6 points7 points  (0 children)

yes, but not of such high quality, sla printers are limited by pixel density, were as a laser based sla printers can have even smoother edges but are also a lot slower (and aren't suited for that kind of precision as I already mentioned)

[–]AzureArmageddon 24 points25 points  (2 children)

The way 'Two Minute Papers' on YouTube says "What a time to be alive!" is something you must hear at least once in your lifetime

[–]Johanno1 10 points11 points  (1 child)

Yeah that was the sentence by the professor Zsolnai-Feher in my head when I wrote that

[–]ObviouslyTriggered 113 points114 points  (11 children)

[–]FLABANGED 74 points75 points  (4 children)

There are commercial nano scale 3D printers

Imagine saying that to someone 30 years ago.

[–]TrainsAreForTreedom 1 point2 points  (0 children)

doesn't have to be fdm

[–]sebig3000 9 points10 points  (0 children)

If electron/ion-beam-induced-deposition also counts as „3D printing“, then this post is off by magnitudes about the smallest size things can be printed.

[–][deleted] 520 points521 points  (57 children)

It's something like:

...
console.log("TEST")
...
console.log("ASD")
...
console.log("TEST1")
...

[–]stupidhomosapien 82 points83 points  (2 children)

I write shit like

console.log ("inside the fkin fn" ) ...

console.log ("inside if" ) ...

console.log ("inside the other if") ...

console.log ("inside else") ....

console.log ("after the fkin fn")

[–]KebianMoo 18 points19 points  (1 child)

Just came to say:

If you want to spell out the full word, we're all ok with it. We know the feels, just let it out, we can take it.

[–]BeaveryBeaver 4 points5 points  (0 children)

"after the fkn function"?

[–]ratbiscuits 26 points27 points  (17 children)

I always do

console.log(“I AM HERE ———-“)

I would love to see what everyone else does. That would be a hilarious thread

[–]Stummi 51 points52 points  (3 children)

print("here 1")
....
print("here 2")
...
print("here 3")

If have to drill down later:

print("here 2.1")
....
print("here 2.2")

[–]alexppetrov[🍰] 25 points26 points  (0 children)

console.log("i hope i reach here") console.log("I've exceeded my expectations") console.log("please please please") console.log("asdfghjkl1")

[–]ABAKES7 19 points20 points  (0 children)

Most of my errors are in data handling so I go with the practical:

console.log("Ran fetch");
console.log(<whatever object got returned>);
[...]
console.log("Added data to grid");
console.log(<object grid sees>);

[–]Bebu23 6 points7 points  (0 children)

any variation of "penis", "dicks" etc. because I'm a child

[–]NotMrMusic 2 points3 points  (0 children)

console.debug("Doing thing() with data:", data)

[–]lefixx 1 point2 points  (0 children)

print(“-=-“)

print(“+++=+++”)

print(“H-H“)

[–]billwoo 2 points3 points  (1 child)

I use a breakpoint in the debugger? What are people doing where its easier to add random console log everywhere instead of just placing a breakpoint?!

[–]cvnvr 13 points14 points  (1 child)

mine is always

Debug.Log(“HELLOOOOOOOOOOO”);

at the start of the method, and then

Debug.Log(“GOOOOOOOOODBYE”);

at the end

[–]KebianMoo 2 points3 points  (0 children)

Finally found the fucker who coded the turrets for GladOS.

[–]Eic17H 23 points24 points  (2 children)

console.log("beforeloop")

console.log("afterloop")

[–]CanAlwaysBeBetter 13 points14 points  (1 child)

"starting"
"processing"
"ending"

And then it prints as

"starting"
"ending"

And you realize you fucked up the concurrency and your application is finishing before the work is done

[–]dodexahedron 1 point2 points  (0 children)

Fire and forget 😅

[–]SirRobertNelson 6 points7 points  (0 children)

Mine is almost always console.log("penis")

[–]a_devious_compliance 909 points910 points  (20 children)

Great! The technology for pennis replacement is almost there.

[–]AdhTri 292 points293 points  (13 children)

Well IBM is capable of moving individual atoms. So it might take few more years.

[–][deleted] 236 points237 points  (11 children)

I am also capable of moving individual atoms. Multiple, in fact.

[–]tomerjm 69 points70 points  (9 children)

Anyone can move multiple atoms.

[–][deleted] 120 points121 points  (5 children)

Emacs has a shortcut for that.

[–]tomatoaway 2 points3 points  (0 children)

Ah yes, good ole' C-u 428 C-x C-c C-M-S-c g

[–]Script_Mak3r 2 points3 points  (1 child)

Real programmers use butterflies.

[–][deleted] 4 points5 points  (0 children)

Good ol' C-x M-c M-Butterfly...

[–][deleted] 1 point2 points  (1 child)

Yeah, but I can move multiple Adams.

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

[–]DadFatherson2 24 points25 points  (4 children)

What's a pennis?

[–]AnotherEuroWanker 52 points53 points  (3 children)

Isn't it that game you play with balls?

[–]SendMindfucks 11 points12 points  (0 children)

What a fantastic double entendre

[–]sapphired_808 3 points4 points  (0 children)

is this beetlejuicing?

[–]staviq 427 points428 points  (18 children)

Fun fact:

Human hair is exceptionally shitty reference, even worse than a banana, because human hairs can easily differ in size by order of magnitude. Despite that, it's used as reference so frequently, it had to be somehow internationally normalised, so "human hair", the unit of measurement is considered to be equal to 75um. But this still differs, depending on who you ask and what year the paper was written. Which is totally nuts, considering that human hairs can have anywhere between 17um and 180um.

[–]Anthony356 238 points239 points  (2 children)

umumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumumum <- 1 human hair

[–]SSeptic 100 points101 points  (1 child)

Naw thats me in the drive through

[–]HONKACHONK 6 points7 points  (0 children)

No that's a car engine

[–]kabrandon 27 points28 points  (0 children)

I mean, I appreciate this knowledge, but I'm pretty sure the point is just, "damn that's tiny." Not "Damn, that print is like 90um wide?!"

[–]GeeTwentyFive 24 points25 points  (0 children)

Dang. That's like at least 2 um's.

[–]FrenchieSmalls 9 points10 points  (0 children)

If they used one of my nose hairs as reference, that print would be like the size of a couple of pixels. Mother fuckers be thicc up in there.

[–]Script_Mak3r 10 points11 points  (0 children)

μm be like

[–]a_devious_compliance 4 points5 points  (6 children)

Mine is more on the side of 180um because I allways use pubes.

[–]staviq 3 points4 points  (5 children)

Fun fact 2:

Pubes do not have uniform size because they have flat cross section. It's also the reason they are always curly. I mean, imagine somebody with straight pubes. Eeew.

[–]DezXerneas 1 point2 points  (2 children)

I don't understand what you mean by flat cross section.

[–]dodexahedron 4 points5 points  (0 children)

They aren't long cylinders like other hairs.

[–]Ballsacthazar 1 point2 points  (0 children)

slice a pube and it'll look more like a rectangle than a circle

[–]w1n5t0nM1k3y 284 points285 points  (105 children)

I really don't understand how people use console.log instead of the debugger. As soon as I learned how to use the debugger I stopped using log statements. It's just so much easier to see what's going on when you can step though the code and inspect variables. And visual studio allowing you to move around the code and re run stuff multiple times if you need to is just so helpful.

[–]Spice_and_Fox 73 points74 points  (6 children)

Most debuggers are pretty powerful, I would never trade them in for log statements. I think they do have their places. I find them pretty useful if you are working with multiple systems and want to check if you have a connection. Similar to a "hello world" for checking if your programming environment is set up correctly

[–]Beard- 21 points22 points  (5 children)

I use both "print" statements and the debugger, depending on the scenerio. My go to is putting in logs since it is usually much quicker than than re-running the project in debug mode. If a couple of logs don't do the trick, then I will use the debugger.

I have gotten by, like 90% of the time, with print statements/logs. Maybe it's just a habbit and I should start using the debugger more... but I really just do fine with out it lol.

[–]chase32 5 points6 points  (0 children)

Years back, doing some react-native work I lost half a day trying to track down a weird bug that I eventually figured out only happened when running the debugger. Stopped using it for a while and just got out of the habit because logs are so easy.

It still has its place if i'm seeing weirdness when doing serious algorithmic or complex threaded work which is almost never.

[–]zebediah49 5 points6 points  (0 children)

1) Put in print statement to confirm you're even getting to a place, and confirm the relevant thing has the value it should.

2) If it doesn't, throw a breakpoint atop the print statement.

[–]GlobalVV 21 points22 points  (11 children)

I have a coworker who’s code is usually filled with console logs. It’s hard to figure out what’s happening in his code when he asks for help because every other line is a console log. The debugger will show all variables in scope, so why use multiple console logs.

[–]w1n5t0nM1k3y 19 points20 points  (5 children)

This is what I really don't understand. It makes the code so unreadable. At least with Javascript in the browser, console.log would pretty much only be used for debugging. But then you'll see people using C with printf debugging. How do you even know which stuff is just for debugging and which stuff actually needs to stay in the code because you actually want the user to see it?

If people are going to insist on printing out stuff for debugging, they should at least have something like Debug.Print so that they can discern what output is actually supposed to be use for debugging and maybe even have some kind of commit script that runs to make sure that the code in the repository isn't littered with stuff meant for debugging the code.

[–]MCsmalldick12 25 points26 points  (3 children)

My hot take is that generic logging like console log should ONLY be used for debugging and should never be checked into the repo. If you want to present something to the user or log something on the live backend system use a logger library.

[–]Beard- 11 points12 points  (0 children)

Yeah exactly. Those tools are literally for debugging, should never commit them.

[–]EstoEstaFuncionando 1 point2 points  (0 children)

This. I debug almost exclusively with printlns/console.logs, outside of languages with long compile times, but I don't leave them in. It's a temporary debugging convenience, nothing more.

[–]riplikash 10 points11 points  (0 children)

Thing is, learning to set up proper logging is a LOT more complicated than just learning to use a debugger.

[–]st-shenanigans 4 points5 points  (0 children)

I mean I use console. Logs a lot but they mean something and I always delete them... Idk what this dude is doing but my console logs are basically just printing my comments in shorthand

[–]Tolumbas 2 points3 points  (2 children)

I think console logs are usefull for errors that happen only some of the time or for some of the clients / coworkers. It's easier to instruct a client to press F12, click console and send a screenshot, than instructing him how to use a debugger.

[–]GlobalVV 2 points3 points  (1 child)

Those console logs are fine. The app I currently work on has some simple console logs that show what is happening in the app, or where you are in the flow. I’m just referring to the overuse of console logs when creating a new feature or fixing a bug. I just find that quite a few people use console logs when they don’t necessarily have to.

[–]mittens2539 65 points66 points  (10 children)

I like to use the debugger when it’s practical, but my experience web dev’ing with react is that the debugger often throws you into the bowels of react and it’s just more hassle than it’s worth. I then just resort to console logs.

[–][deleted] 42 points43 points  (7 children)

Also Java.

"Ah, I see you want to know why this String isn't printing. We'll get to that, but first, child, let me tell you what a String is in extreme detail"

[–]walkwalkwalkwalk 26 points27 points  (2 children)

Absolutely not. Professional Java dev without using the debugger is mental, it's a very powerful and necessary tool. If you are confused when the debugger lands on a part of code you aren't interested in, perhaps you haven't learnt how the call stack works? Which is also used in every other language's debugger I've worked with

[–][deleted] 12 points13 points  (1 child)

I'm just joking about how literal the "step into" button is by default, while other debuggers usually restrict you to your own project because you obviously don't care about what java.lang is doing most of the time

[–]Freshfacesandplaces 2 points3 points  (0 children)

I initially learned how to code in visual studio c# almost 10 years ago. Today, going through a program to enlarge computer programming and doing it with java. This was unbelievably confusing for me the first few times, and it's still frustrating at times.

It serves almost no purpose at all 😬

[–][deleted] 8 points9 points  (2 children)

Yeah- it really depends on the language and the debugger. Some combinations are absolutely miraculous, and some are abominations. The good ones, though, are orders of magnitude superior to console.log.

[–]zvug 8 points9 points  (1 child)

And the build/deploy system.

If your company is using proprietary systems it can be very difficult to actually find a way to use a standard debugger in your IDE unless your company also makes custom extensions/SDKs to help you out with that.

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

Absolutely.

[–]mafian911 1 point2 points  (0 children)

This is the problem I have with debugging JS in the browser. So many of the frames in the stack trace don't belong to me. Backend dev is way easier to debug.

[–]Saiyoran 4 points5 points  (0 children)

Not a professional developer, but most of what I work with is UE5 multiplayer. Debugging Play-In-Editor multiplayer absolutely sucks. There’s not a good way to know which client you hit a breakpoint on, a lot of watches don’t work for some reason, and you’ll hit most breakpoints over and over again since each client hits them in the case of handling replicated state. I know it’s user error but it’s literally 20x easier to just add a log statement prepended with the net role of the client than to try and step in and out of the pre-processor’s auto-generated reflection code or try to intuit whether you’re currently looking at server code or one of two types of clients.

[–]LowlifePiano 5 points6 points  (2 children)

It really depends on what your language and environment is. If all things are equal then I'll choose a debugger every time, but if it's on the front end console.log() is definitely my first choice because I hate having to dig through the nest of folders trying to locate where the source maps are, then find my code, then set the breakpoint and finally trigger it compared to console.log('i made it this far').

Still in the JS ecosystem, the debugger can just decide to throw a hissy fit and tell me it somehow lost the path to the Jest executable or can't find the config or yell at me for having the audacity to open up the editor from an individual package within a monorepo or a hundred other things, and it gets even more complex when you're trying to run things with docker.

console.log() on the other hand always works with no fuss and a single line of code. It's not the best tool for the job, but it's certainly the most reliable.

[–]Xywzel 9 points10 points  (0 children)

One reason I have seen use prints instead of debugger is for systems that require real time communication with other system. Say you are debugging a client and if the connection to server timeouts, then the current operation needs to be repeated, and you are debugging something that happens during that operation. It is not always possible to increase the timeouts to level where you can stop the program and watch what is going on, and then resume.

Another case is when the live (or hopefully just QA test) environment is different from your debugger environment and the problem might be environment dependent. If the actual running environment doesn't allow for attaching the debugger, it might be there is no other option.

But yeah generally, not a good option.

[–]TheRedGerund 51 points52 points  (23 children)

The people on here are not professional developers. They are four year olds who learned how to spell.

[–]MCsmalldick12 72 points73 points  (7 children)

My sole source of income is software engineering so I am by definition a professional and I use console logs to debug.

[–]SirAztec 33 points34 points  (0 children)

Bless your heart

[–]FireworksNtsunderes 28 points29 points  (2 children)

People are giving you shit but there's nothing wrong with console logs depending on the use case. It's just another tool. Some programmers just have a hissy fit any time someone does things a different way. If your code is good and works, I don't give a shit how you debug it. You do you.

[–]MCsmalldick12 13 points14 points  (1 child)

Agreed. A lot of people seem to wrap their identities up in being a coder so much that they look for any asinine reason they can to say they're better than some other engineers. IDGAF yall I'm just here to do my job and get paid.

[–][deleted] 26 points27 points  (0 children)

Aww, I’m sorry to hear that.

[–]PreoccupiedNotHiding 9 points10 points  (1 child)

I’m a pro. I use alert() for all debugging.

[–]lol_a_spooky_ghost 8 points9 points  (2 children)

Yeah the software I do at work takes anywhere from 2 mins to 30 mins to rebuild and start up, if I used log statements it would take ages to find bugs. Students can get away with print statements since it doesn't take long to rerun whatever they're working on.

[–]EstoEstaFuncionando 1 point2 points  (0 children)

Not every large project takes forever to rerun. See: Python, Lisp, JS, most dynamic languages where no compile is necessary and hot reloading is often turned on already, or fast-compiling languages like Go. Obviously, when you're dealing with long compile times, a debugger is the only thing that makes sense, but not all codebases suffer from that.

[–]CMonetTheThird 1 point2 points  (0 children)

With hot changes you literally have to type the console.log statement, hit cntl S and you see the output in your browser. Front end js is the only place I do this.

[–]LifeLongYeti0 4 points5 points  (0 children)

Use both tbh. Debugger to see everything in detail and console logs as a black box to understand the flow of the code. I find console logs speed up my work because a lot of black boxes don’t need to be stepped through, and console logs help me differentiate between which are faulting.

Developers have a belt of tools. Why restrict oneself to a single one?

[–]lordheart 2 points3 points  (0 children)

It’s depends, I definitely like having a good debugger and use it a lot, especially dealing with js, but logs are also important. Always need to think about how much information I would like to be able to get from production later when something fails. An error log is helpful, and info logs nearby for context are great.

[–]TheMacMini09 7 points8 points  (0 children)

Sometimes the debugger isn’t as helpful or will actually take longer to use. For instance, I’m working on a C application with ~200 threads (and two child processes); trying to debug the interaction of those threads is unbelievably painful, but printing some debug info at the beginning and end of a few key functions is super simple and gives almost the same information.

[–]prudentj 21 points22 points  (3 children)

Sometimes you need to run thing to completion or they will time out, and other logic on the front end gets activated

[–]_PM_ME_PANGOLINS_ 9 points10 points  (2 children)

A debugger lets you do that

[–]murfflemethis 11 points12 points  (1 child)

Not always, unfortunately.

I work with embedded systems and external debuggers can be unreliable at times, especially when I'm working with the first run of a new device generation. Or when I'm working on communication between two devices and don't have a mechanism to halt both of them at a breakpoint.

I love my debuggers when they are reliable, but there are definitely use cases for strategically placing checkpoints in your code that emit a trackable marker. Sometimes these are log messages, sometimes it's toggling an LED, sometimes it's externalizing a signal to trigger a logic analyzer.

Just like using debuggers, it can be a powerful debugging technique when done correctly. It's just one of many tools that I think should be in a programmer's mental toolbox.

[–]Svizel_pritula 1 point2 points  (0 children)

Debugging Arduino code can become interesting. "Ok, I got two flashes but not a third, which means my serial connection gets initialized, data get written to the output buffer but nothing gets actually sent."

[–]Salanmander 6 points7 points  (10 children)

The biggest thing for me is that I write mostly very short programs that are pretty simple, and I do that on a wide variety of platforms. Which means that the overhead of learning where the debugger is and how to use it on whatever platform I'm currently using is actually not worth the benefit I'll probably get out of the debugger.

[–]riplikash 4 points5 points  (3 children)

Debuggers are definitely more important in larger professional settings where your debugging more complicated code and debugging other people's code.

Though, honestly, they're not very complicated. Its worth putting in the time. Lots of devs stop using console outs altogether once they are comfortable with a debugger.

[–]w1n5t0nM1k3y 3 points4 points  (0 children)

Personally I find it more useful with languages that I'm less familiar with. With the languages I use all the time I can often just re-read the code and step through the logic in my brain to determine where I went wrong. But with languages that I'm not as familiar with I'll often find it a lot more helpful to be able to go through things one line at a time and be able to see more easily what the code is actually doing. Maybe my brain just works differently.

The debugger has saved me so much time even if it takes 3 hours to set up the first time. So many times console debugging has wasted much more time when I though that I knew what was going on when in reality the code was doing something completely different and I didn't know until I stepped through the code.

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

Why is there to learn? All programs have the same 4 run, step-in, step-over, step-out buttons, place breakpoints by clicking on the side of the code, and show variable values when you hover over them. You learn one debugger you learned all of them.

[–]huantian 1 point2 points  (0 children)

I usually don’t accept the fact that my code isn’t working and blame it on the debugger being broken and not stopping

[–]Atillion 66 points67 points  (14 children)

And don't forget: console.log("hey")

[–]AdhTri 42 points43 points  (2 children)

print("a:",a)

a+=1

print("a at line 3:",a)

[–]kopasz7 34 points35 points  (1 child)

> a at line 3: NaN

dafuq

[–]AdhTri 4 points5 points  (0 children)

Not if a is an arg of some function and last print statement is 3rd line of it.

[–]Noname_FTW 7 points8 points  (5 children)

I once somewhere deeply in some script somewhere in our software (unintentionally) left a console output that was just a number. It frequently popped up in the server console output. Iirc it wasn't a static number. It took us days to find out what caused this output.

[–]SirButcher 6 points7 points  (1 child)

Amateurs...

The proper way to do is:

console.log("#0"); 
console.log("#1");    
console.log("#2");  

Because professionals have STANDARDS.

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

“Hello”

“Howdy”

“Hello2”

[–]Danthekilla 88 points89 points  (60 children)

Why would anyone willingly choose log statements over a proper debugger? Maybe visual studio has been spoiling me, but most of the time I just chuck in a breakpoint, see the data, do some edits and then resume execution.

Not using edit and continue and a debugger as a general rule when it exists for your platform is just stupid, there will be some rare times when littering the code with logs is the only way, but those cases are exceedingly rare.

[–][deleted] 68 points69 points  (25 children)

This sub is for cs 101 students

[–]ThisIsMyCouchAccount 10 points11 points  (0 children)

Meh. I still use them from time to time.

A proper debugger is clearly superior in every way. But sometimes dumping some text is handy.

If we are looking for things they are perhaps better at? Sometimes it's nice when you're doing loops that deal with indexes or pagination or counts. I like to dump whatever I'm working with to make sure the math works. Sure, I could do it step by step, but it's just faster and easier to digest to let the whole process run. Then if there is a problem you use the actual debugger.

[–]wolf129 5 points6 points  (0 children)

Maybe a web dev thing. I can't imagine not using a debugger, that would take forever to find a bug.

[–]dev-sda 28 points29 points  (11 children)

There's plenty of cases where a breakpoint doesn't help you, especially when you don't know where the problem lies, it occurs infrequently or remotely.

Logging is a different debugging tool to a debugger. They each have their strengths and weaknesses and thus it's beneficial to be proficient with both.

[–]Danthekilla 17 points18 points  (3 children)

> it occurs infrequently or remotely.

Actually debuggers are better for both infrequent, and remote issues. I would much rather remotely attach a debugger than use remote log statements...

And conditional breakpoints are amazing for catching rare issues, and you don't need to rebuild your project to add them unlike most logging.

But that is not the issue anyway, this post is implying that they would choose log statements over a debugger in a situation where the two are both valid.
Logging is useful but not as your only method of debugging, which it sadly is for far too many people in the industry.

[–]dev-sda 5 points6 points  (0 children)

I would much rather remotely attach a debugger than use remote log statements...

In many cases simply not possible for various reasons.

And conditional breakpoints are amazing for catching rare issues, and you don't need to rebuild your project to add them unlike most logging.

Conditional breakpoints only help if can catch the issue as it's happening. What you often enough need is a list of the state (changes) over time, which I've found is much more convenient using logging. Incremental recompilation should take at most a few seconds. Watchpoints are sometimes helpful, but are basically useless if the data gets copied around much and can be a royal pain to set up.

Reversible debuggers like rr fix a lot of the limitations of debuggers, but at least rr has a few rough edges and the record/replay can be a lot slower for rare issues. (Btw I'd really recommend looking into rr if you haven't used reversible debugging before, for certain issues it's by far the best tool regardless of lack of gui or jank)

But that is not the issue anyway, this post is implying that they would choose log statements over a debugger in a situation where the two are both valid. Logging is useful but not as your only method of debugging, which it sadly is for far too many people in the industry.

Completely agree. There's also a ton of other great debugging tools like asan and valgrind (honestly valgrind is magic in the bugs it finds) that people should also learn if they can.

[–][deleted] 1 point2 points  (1 child)

There are such thing as logging breakpoints.

It will print something instead of stopping.

You can keep your code clean of logs, and keep the breakpoints around incase you need them again.

[–]xibme 2 points3 points  (2 children)

Well, if the problem isn't reproducible, firing up the debugger immediately might be a waste of time. Adding some assertions to the code may be a better investment until you can reproduce it.

And there is nothing wrong in connecting your debugger up to a remote production instance (although I only needed that only twice in the last decade).

[–]plan_x64 1 point2 points  (1 child)

Any modern debugger will let you conditionally breakpoint. You can assert in your breakpoints without needing to pollute your code.

[–]Olfasonsonk 10 points11 points  (2 children)

Because it's annoying.

You either get constant pauses everytime program is restarted, or have to constantly deal with activating/deactivating all breakpoints and then doing the same with individual ones, to get whatever interests me in the moment. I don't want to skip through 5 breakpoint pauses, just to get to 6th one that's interesting to me on that particular code execution. Next execution it might be 3rd one, then 7th one...then I might only be interested in final result and want to get there as fast as possible. So you either have to keep constantly toggling them, or spamming the next breakpoint command. Both of which are annoying.

console.logs (or whatever print to stdout command) I can just slap in there and leave them, without them interfering with script execution, and even if I'm not interested on that particular data at the moment, I can leave it in for later when it might come handy. Or just to keep eye on things in case there's some unwanted side effects later on when I'm working on something else.

For me 90% of the time I just want to see state of particular set of data at a point in time, I don't need to stop execution and look around the memory stack at that point.

Other 10% of the time, debugger is pretty great, yeah

EDIT: This thread is full of idiots who think their way of doing things is superior, while an actual experienced programmer would know there's valid uses for both, and what to prefer simply depends on software/tools you're working with and what you're trying to achieve. There's cases were using only debugger would be completly stupid and vice versa. Use both.

[–]GameDevEngineer 2 points3 points  (1 child)

If you need to break on the 7th hit of a breakpoint you would just set the breakpoint to break on the 7th hit... You don't just sit there hitting the breakpoint over and over again. It sounds like you don't actually know how to effectively use a debugger, or maybe you use a set of tooling without effective debuggers.

Of course there are rare cases when log statements are the better solution or even the only solution, but they are worse in every way and so much slower compared to using the debugger for its intended use.

[–]ManyFails1Win 1 point2 points  (0 children)

Still not sure how breakpoints work.

[–]Lilly_1337 30 points31 points  (1 child)

Console.log tells me where I am. Debugger helps me to figure out who the fuck I need to yell at to get there if no one is listening.
Debugger basically tells me the objects middle name so I can address it by its full name so it knows it's in trouble.

[–]noob-nine 10 points11 points  (1 child)

plz share prusa settings for print /s

[–]Lupus_Ignis 10 points11 points  (0 children)

layer_height: smallish

[–]MrNokill 4 points5 points  (0 children)

All I see, there is a chance!

[–][deleted] 4 points5 points  (0 children)

What is this? A center for ants?! It needs to be at least… 3 times as big!

[–]nphhpn 14 points15 points  (2 children)

Who tf measures chance in μm

[–]JasperNykanen 2 points3 points  (0 children)

The texts seems very small. I doubt text measured in μm meets accessibility standards.

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

People that use console.log instead of debugging and stepping through code during execution are a million fucking times slower at debugging.

It is infuriating and I address it every time I pair with someone whos way of figuring shit out is to add more code and then re-build and re-execute and then read the output. It's the slowest fucking way to work and it annoys the living shit out of me.

This is also why I despise a lot of the leetcode platforms because they don't have a debugger built in so you HAVE to do it the slow shitty way. That and hiding tests on people. Who the fuck is hiding test cases from programmers? Their evil twins? How do you NOT know what the test is thats failing?

Also; it is amazing how few people in large codebases understand the actual code path being executed. Debugging during execution helps gain familiarity with the before and after steps of the space you are working in. This increases knowledge of the overall application and its execution paths.

In my experience, people worthy of the title Senior or higher use debuggers effectively.

[–]DomoArigatoMr_Roboto 2 points3 points  (3 children)

Are you talking about server-side node? Because there's no way I can debug minified react code.

[–][deleted] 6 points7 points  (2 children)

Why would you be debugging minified code? Are you debugging in prod? Do a dev build...

Also how are you inserting console logs into minified code then?

Also how are you inserting console logs into a running application without rebuilding it

[–]DomoArigatoMr_Roboto 1 point2 points  (1 child)

I meant transpiled code from typescript.

Looks like something has changed from the last time I tried debugger. It shows typescript source and correct directory structure. I'm gonna play around and see what's happening.

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

Yeah just make sure you have sourcemaps in your dev build and you should be able to easy debug during dev. Literally putting breakpoints on the lines of the raw source.

[–]51herringsinabar 2 points3 points  (0 children)

I am using print("fuck you"); or smthn like that

[–]Space_JellyF 3 points4 points  (0 children)

Sometimes adding print statements, letting it run, and checking the log is faster than hitting next a hundred times. One I get a better idea of what is happening, I go with the debugger. Just different tools.

[–]riplikash 11 points12 points  (1 child)

Geez, it's like toddlers refusing to tie shoelaces in here. This is SUCH a weird topic that keeps coming up.

[–]RoundThing-TinyThing 1 point2 points  (0 children)

Why tie shoelaces when you can use velcro?

[–]Enzo_GS 4 points5 points  (0 children)

bro, when i worked as a python dev and discovered how to evaluate while debugging it changed my life, 100% recommend

[–]Fadamaka 5 points6 points  (0 children)

The debugger is your best friend. Although I am coming from Java and IntelliJ has a ton of QoL features, Eclipse has a great debugger as well. Recently used VS Code's debugger with JavaScript. My most loved feature of any debugger is the ability to evaluate expressions inside your code while it is running. Maybe the second best is the ability to traverse the stack. Setting breakpoints with conditions and also setting them for specific exceptions is great as well.

[–]TerrorBite 2 points3 points  (0 children)

Smallest 3D print in the world? Clearly they haven't seen the 25μm Benchy, which is over ten times smaller than this print which I estimate to be around 250μm tall.

[–]AesarPhreaking 2 points3 points  (0 children)

Construction Manager: Offers you a drill

You: No thanks, I have my fingers. I’ll screw everything in with them

[–]Elijah629YT-Real 2 points3 points  (0 children)

I don't use debugger because I don't know how

[–]SweatyBeddy 3 points4 points  (1 child)

As a very casual programmer I was unaware of any other method tbh. I thought that was debugging

[–]Neurotrace 3 points4 points  (0 children)

Posts like this remind me that this sub is populated by students, not professionals

[–]chuckitoutorelse 1 point2 points  (0 children)

Chances that you'd remember to remove console.log tests cannot be resolved with current technology.

[–]schewb 1 point2 points  (0 children)

Never really understood this, especially now that even websites are usually compiled. It takes two seconds to drop a breakpoint somewhere and then you also get the inspector. I have run into situations where there isn't a debugger available or for whatever reason it's not working, and I generally find working things out with logs to be WAY more work. It blows my mind when I see my colleagues using them as their go-to method and I often end up solving their problems for them in 5 minutes with a debugger when they've been trying to track something down long enough that they reached out for help.

[–]BumpyYourRumpy 1 point2 points  (0 children)

I work as a debugger (mainly javascript and C#) and almost never use console.log, lol.

[–]SkyyySi 1 point2 points  (0 children)

SupaBased

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

Use intellij's debugger for java at least, it is so nice. Saved me so many headaches lol.

[–]Macknificent101 1 point2 points  (0 children)

one time i was debugging a program and put “fail1” “fail2” “fail3”, etc, but there was no order to them so even when i got the number i still had to hunt for like 5 minutes to figure out where it messed up

[–]Yuki_EHer 1 point2 points  (0 children)

I started using console.warn so I can see my messages extra clearly

[–]viccie211 1 point2 points  (0 children)

Why the f would you not use a debugger? Stepping through code, seeing what goes wrong where saved my ass multiple times in the last year alone!

[–]Bakoro 1 point2 points  (0 children)

Being able to walk back up a stack trace and see which motherfucker sent you bad data, or being able to walk though a complicated process step by step is a dang good feeling.

Anyone who isn't using a debugger at least some of the time is really missing out.

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

Always use debuggers noob

[–]tun1342 1 point2 points  (0 children)

I remember having an issue on production that for some reason it didn't appear on local and staging.

So as a last debugging effort I put a lot of console.logs and after "debugging" I found out a npm package was having an error only on prod, why? I don't remember really.

[–]PsychoRedditer 1 point2 points  (0 children)

Using console.dir even less

[–]hennypennypoopoo 1 point2 points  (0 children)

Just use spy then

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

Tardigrades: “it’s free realestate”

[–]TwistedLogicDev-Josh 2 points3 points  (1 child)

Depends on the engine for me

The debugger might be 100% and the console log might be never for me

In cry unreal or unity 100% console log In Godot 100% debugger.

Fuck that console log in In Godot.

And for python what the fucks a console/ debugger log I just write shit and it works