4 ms·
Building a simple debugging tool to monitor your program for possible inconsistently reproducible bugs and having unit tests are not mutually exclusive concept.
by throwaway675309 3y ago
Building a simple debugging tool to monitor your program for possible inconsistently reproducible bugs and having unit tests are not mutually exclusive concept. You're getting downvoted because you're making condescending assumptions about the developer.
- latchkey 3y agoI'm not being intentionally condescending. it is a valid question to ask that. i come from a strongly tdd background. i can't tell you how many times i've seen people write simple debugging tools only to have the tool be the source of the bug. ever written a println and output the wrong variable, then scratch your head why the results are wrong? websockets themselves are well debugged, similar to http. years ago, i stopped spinning up a http server just to test my endpoints. now i just call the functions directly. thus, it would be an issue with the OPs code that is sending/receiving. take websockets out of the equation and everything would work fine with tests.
- jasonm23 3y ago> Come from a strongly tdd background Friend, we need to be damned careful about how we view others code when they don't have tests or embrace TDD. When we work with TDD or even a well tested codebase, we do benefit enormously. We also risk becoming evangelical, and that almost always comes across as condescending and off-putting. TDD Tests do not capture every possible point of faillure. There's clear use cases for things like Postman, Debugging Proxys, or OPs _debugging_ tool. PSA - avoid being a hype monger or evangelist of anything, it's about the worst way to support practices or tools you believe in. Trust me, I'm not only a practitioner of TDD but also a Lisp advocate and Emacs user... All these things are the best ever thing that happened /s No, the whole world won't ever be a place where everyone is "doing it right" by your estimation, or mine, or anyone else's. Quite the opposite, so settle in and mellow your jets.
- latchkey 3y agogood response. i'm not being evangelical by asking a question. i'm also not trying to start a sermon. my response was to explain where i was coming from because i was being called condescending. i don't care about doing it right. i can ask why someone would write a tool, instead of using one of the existing ones... or writing tests. my jets are plenty mellow.
- leptons 3y ago>no wonder we end up with such buggy junk software... people... write tests! absolutely condescending and holier than thou. I view TDD as a premature optimization when writing software that isn't simplistic or cut-and-dry CRUD. Trying to do something new doesn't always mean there's a known output before writing the actual code. Experimentation is a valid thing in software development and writing tests before writing the code would stifle some types of development. In a lot of cases it's bass-ackwards to write tests before the implementation is producing a useful result. I know this type of development might seem foreign to some, but you don't always know what you don't know before you start experimenting while writing code, and TDD doesn't really fit all types of development.
- latchkey 3y ago> absolutely condescending and holier than thou. That was an update after I was downvoted. You're right, there are reasons to not always do TDD. Writing a tool to inspect websockets, isn't one of them.
- kristiandupont 3y ago>Writing a tool to inspect websockets, isn't one of them. What kind of developer makes a blanket statement like that? There are all kinds of situations where debugging is more like detective work. When you discover the problem, then you have the knowledge necessaryto actually write the test that fails and which you can then make succeed.
- latchkey 3y ago