Hacker News new | past | comments | ask | show | jobs | submit | ehaliewicz2's comments login

Sometimes "just thinking harder" works, but often not. A debugger helps you understand what your code is actually doing, while your brain is flawed and makes flawed assumptions. Regardless of who you are, it's unlikely you will be manually evaluating code in your head as accurately as gdb (or whatever debugger you use).

I think a lot of linux/mac folks tend to printf debug, while windows folks tend to use a debugger, and I suspect it is a culture based choice that is justified post hoc.

However, few things have been better for my code than stepping through anything complex at least once before I move on (I used to almost exclusively use printf debugging).


printf isn't faster if you want to single step through code to find math precision errors.

I've had to do that on a embedded system that didn't support debugging. It was hell.


I’ve always wondered why embedded devs make less than “JavaScript-FOTM” devs.


Those were the 90s. Modern rasterizers* all use barycentric coordinate based algorithms for a few reasons.

Easier to implement with proper fill conventions and multisampling, and much easier to parallelize in hardware and software.

* Hardware even back in the 90s used this type of approach :)


We use barycentric (both in high performance software rasterizers and in hardware) because attribute interpolation is significantly more costly than in-bounds checking (both due to the total number of interpolates, and the precision). The in-bounds check is going to be just a few instructions (a few fmas and some sign checking) for two dimensions (x, y); whereas attribute interpolation could be needed for 30–128 'dimensions'. It's easier to push the interpolation to the use-site in the fragment shader, and let the compiler do its magic.


Until the array no longer fits in your cache :)


My guess is 'A Philosophy of Software Design'.


"I don't get to get away with dealing illegal substances just because I give it away for free."

Good to see you want virtual machines to be illegal.


I'm willing to bet 99.99% of the time you hear music from outside a car it's not due to someone being hard of hearing, unless they caused that issue themselves by listening to music too loud.

However, if you are hard of hearing to the point where you are actually disturbing others, I would recommend headphones.


It is not generally legal to drive while wearing headphones. In some US states it is specifically banned, and in many others you will get pulled over for distracted driving. (The thinking is partly because it makes it more difficult to hear emergency vehicle sirens).


If your headphones are blocking sound, yeah it can be hazardous.


Realizing that you enjoyed being forced to listen to music you didn't decide to listen to doesn't mean you might be an asshole for not enjoying it at other times. That's ridiculous.


Yeah, for example, movs between registers are generally effectively no-ops and handled by the register renaming hardware.


I'm guessing, just guessing, that most of the people who don't think slow execution is bad are probably not that interested in what the machine actually has to do to execute their code, and hence, are not actually well educated in making those tradeoffs.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: