diff --git a/content/books/things-i-learnt/_index.md b/content/books/things-i-learnt/_index.md index f431c6b..74f4084 100644 --- a/content/books/things-i-learnt/_index.md +++ b/content/books/things-i-learnt/_index.md @@ -18,6 +18,7 @@ template = "section-contentless.html" * [Cognitive Cost Is The Readability Killer](cognitive-cost) * [Learn The Basics of Functional Programming](functional-programming) * [Shortcuts Are Nice, But Only In The Short Run](understand-shortcuts) + * [Debuggers Are Overrated](debuggers) * Testing Software * [Unit Tests Are Good, Integration Tests Are Gooder](integration-tests) * [Testing Every Function Creates Dead Code](tests-dead-code) diff --git a/content/books/things-i-learnt/debuggers/index.md b/content/books/things-i-learnt/debuggers/index.md new file mode 100644 index 0000000..5acb618 --- /dev/null +++ b/content/books/things-i-learnt/debuggers/index.md @@ -0,0 +1,40 @@ ++++ +title = "Things I Learnt The Hard Way - Debuggers Are Overrated" +date = 2019-07-08 + +[taxonomies] +tags = ["en-au", "books", "things i learnt", "debuggers", "debugging"] ++++ + +I heard a lot of people complaining that code editors are bad 'cause it's hard +to attach a debugger. I'd claim that this vision is wrong. + + + +But let's take a thing out of the way beforehand: I'm not saying debuggers are +_bad_ you should never use them. Debuggers have their use, but every time I +had to use one, it was because there was something missing. + +Most recently, using a framework in Java, I had problems with my code. I'd +expect it [to crash](/books/things-i-learnt/crash-it) 'cause I didn't handle +things. What actually happened is that the framework silently hid the error +and restarted the processing. To find out what was happening, I had to attach +a debugger and see what was wrong with the data; otherwise, I'd have no idea +about what's wrong. + +Was a debugger necessary there? I don't think so. If the framework actually +displayed the error (crashed, put a wall of text on the logs, whatever), I +wouldn't need to use a debugger. But, because something was missing, I did, +in fact, was _forced_ to use a debugger. + +Besides this, in the long run, you'd end up with problems in locations that +you can't attach a debugger -- for example, your production environment. You +_could_ but you _shouldn't_ do this. On the other hand, if you [log +events](/books/things-i-learnt/log-events), then you can see what was going +on, without a debugger. + +Again, I'm not taking the merits of debuggers, but in the long run, they are +mostly useless and actually point missing surrounding support to actually +understand what's going on. + +{{ chapters(prev_chapter_link="/books/things-i-learnt/understand-shortcuts", prev_chapter_title="Shortcuts Are Nice, But Only In The Short Run", next_chapter_link="/books/things-i-learnt/integration-tests", next_chapter_title="Unit Tests Are Good, Integration Tests Are Gooder") }} diff --git a/content/books/things-i-learnt/integration-tests/index.md b/content/books/things-i-learnt/integration-tests/index.md index b5759df..9e0e6ef 100644 --- a/content/books/things-i-learnt/integration-tests/index.md +++ b/content/books/things-i-learnt/integration-tests/index.md @@ -72,4 +72,4 @@ of moving parts. [^2]: Again, it's pure feeling from my experience. I have no data to back that affirmation up, so take it with a grain of salt. -{{ chapters(prev_chapter_link="/books/things-i-learnt/understand-shortcuts", prev_chapter_title="Shortcuts Are Nice, But Only In The Short Run", next_chapter_title="Testing Every Function Creates Dead Code", next_chapter_link="/books/things-i-learnt/tests-dead-code") }} +{{ chapters(prev_chapter_link="/books/things-i-learnt/debuggers", prev_chapter_title="Debuggers Are Overrated", next_chapter_title="Testing Every Function Creates Dead Code", next_chapter_link="/books/things-i-learnt/tests-dead-code") }} diff --git a/content/books/things-i-learnt/understand-shortcuts/index.md b/content/books/things-i-learnt/understand-shortcuts/index.md index 4813c5f..baf704f 100644 --- a/content/books/things-i-learnt/understand-shortcuts/index.md +++ b/content/books/things-i-learnt/understand-shortcuts/index.md @@ -37,4 +37,4 @@ me awhile to actually get _what_ I needed to do different from the shortcut to solve my problem: I had no idea what the shortcut did and, thus, I had no idea what I needed differently from the shortcut to solve my problem. -{{ chapters(prev_chapter_link="/books/things-i-learnt/functional-programming", prev_chapter_title="Learn The Basics of Functional Programming", next_chapter_link="/books/things-i-learnt/integration-tests", next_chapter_title="Unit Tests Are Good, Integration Tests Are Gooder") }} +{{ chapters(prev_chapter_link="/books/things-i-learnt/functional-programming", prev_chapter_title="Learn The Basics of Functional Programming", next_chapter_link="/books/things-i-learnt/debuggers", next_chapter_title="Debuggers Are Overrated") }}