Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"Two News Items"

2 Comments -

1 – 2 of 2
Blogger Jörn Engel said...

> I've worked at a number of companies where they disable asserts in debug builds because they've gotten too slow. I of course try turning on asserts, and a thousand of them fire because nobody else is testing with asserts on. The solution should have been to fix the speed of the debug build to something usable, not to avoid important programming tools.

Not sure if I disagree with you on this one or agree 100%. I no longer want to run debug builds at all.

The fundamental problem with debug builds is that you have some extra checks that are so slow that you wouldn't dare run them in production. So now you have a release build and a debug build. Your testing is split between the two or even heavily weighted to the build you don't run in production. As a result, you test the wrong thing.

Then there are heisenbugs. You see a problem in production, it may even be a common problem, and you can never reproduce it with debug builds. Or those rare bugs that take 1000 machine-years to reproduce. You will never hit 1000 machine-years with debug builds, but depending on your scale you can hit those daily in production.


My answer is to optimize the debug code, then ship it in production. The easy answers like "more logging" and "assert everything" are out. You will quickly need more logging than the system can take. And while the assertions might be cheap, the conditions inside the assertions are often expensive. So you have to think a bit, coming up with debug tools that are both cheap and effective isn't easy. But it is absolutely worth it.

December 27, 2020 at 12:12 PM

Blogger cbloom said...

I'm a big fan of asserts in debug builds, but I agree on your general sentiment that developers should be running the same build that you ship.

One thing I think we can agree on is that having a separate "developer" and "ship" release build is a HUGE mistake and is far far too common in the industry. Whatever benefit you think you get from it is massively outweighed by the potential for bugs and other anomalies that only happen in the shipping build.

The best software is stuff that the developers actually use for their own computing on a daily basis.

(eg. I would hope that cloud/net developers run on real servers on the other side of the world during dev, not just doing local test servers).

January 5, 2021 at 9:45 AM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.