Live data from Hacker News

Testing is better than data structures and algorithms

nedbatchelder.com

101–110 of 178 posts

Re: Testing is better than data structures and algorithms

#102
post #99

Earlier quoted context omitted.

Did you Google “concurrency testing” and send me the top 5 results?

Maybe you should have googled 'concurrency testing' before telling me a story about how you worked at every tech company for 76000 years and never saw any concurrency testing lmao.

They said twenty, not 76000. What a crock.

Re: Testing is better than data structures and algorithms

#103
> I see new learners asking about “DSA” a lot.

I've noticed this "DSA" acronym appearing overnight. I can't recall people using it this much (at all actually) even six months ago. Where did it come from? Why do we suddenly need a term to talk about the concept?

Re: Testing is better than data structures and algorithms

#104
post #66

Always gonna have to side with Peter Norvig on this one: https://pindancing.blogspot.com/2009/09/sudoku-in-coders-at-... > They said, “Look at the contrast—here’s Norvig’s Sudoku thing and then there’s this other guy, whose name I’ve forgotten, one of these test-driven design gurus. He starts off and he says, “Well, I’m going to do Sudoku and I’m going to have this class and first thing I’m going to do is write a bun…

> “Well, I’m going to do Sudoku and I’m going to have this class and first thing I’m going to do is write a bunch of tests.” But then he never got anywhere

There's a blog post I read once and that I've since been unable to locate anywhere, even with AI deep research. It was a blow-by-blow record of an attempt to build a simple game --- checkers, maybe? I can't recall --- using pure and dogmatic test driven development. No changes at all without tests first. It was a disaster, and a hilarious one at that.

Ring a bell for anyone?

Re: Testing is better than data structures and algorithms

#105

ignore this advice. spend plenty of time studying data structures and algorithms as well as computer architecture. these are actually difficult things that take a long time to understand and will have a positive impact on your career. study the underlying disciplines of your preferred domain. in general, focus on more fundamental things and limit the amount of time you spend on stupid shit like frameworks, build syst…

I'll ignore your advice. It's one-sided and misleading, lacking the nuances the OP had.

feel free to. it's your career and your own precious time.

Re: Testing is better than data structures and algorithms

#107

> I see new learners asking about “DSA” a lot. I've noticed this "DSA" acronym appearing overnight. I can't recall people using it this much (at all actually) even six months ago. Where did it come from? Why do we suddenly need a term to talk about the concept?

That is the standard acronym for the course in American universities and has been for many decades.

Re: Testing is better than data structures and algorithms

#108

Earlier quoted context omitted.

What algorithm ? The whole idea is that algorithms are useless, and you should just write a bunch of tests and go with it Yes, if I write stuff with locks, I shall ensure that my code acquires and releases locks correctly This is completely off-topic with the original post; Also, you cannot prove something by tests; Just because you found 100000 cases where your code works does not mean there is not a case where is d…

> Also, you cannot prove something by tests; Just because you found 100000 cases where your code works does not mean there is not a case where is does not (just as you cannot prove that unicorn does not exist) :) That’s exactly it. For any non trivial program, there exists an infinite number of ways your program can be wrong and still pass all your tests. Unless you can literally test every possible input and every b…

And yet, (1) testing finds bugs in any nontrivial program that hasn't been tested, and (2) test long enough and with enough variety and you can make programs significantly more reliable.

Perfect is the enemy of good, and absent academic fantasies of verified software testing is essential (even then, it's still essential, since you are unlikely to have verified every component of your system.)

Re: Testing is better than data structures and algorithms

#109

Pure bullshit and incompetence. > esoteric things like Bloom filters, so you can find them later in the unlikely case you need them. They are not esoteric, they are trivial and extremely useful in many cases. > Less DSA, more testing. Testing can't cover all the cases by definition, why not property testing? Why not formal proofs? Plus, in our days, it's easy to delegate testcase writing to LLMs, while they literally…

> extremely useful in many cases. I've not ran into a case where I can apply a bloom filter. I keep looking because it always seems like it'd be useful. The problem I have is bloom filter has practically reverse characteristics from what I want. It gives false positives and true negatives. I most often want true positives and false negatives.

Its entire purpose is an optimization. You have an expensive operation. A bloom filter can tell you that you definitely don’t need to do that operation. So rather than wasting a lot of time unnecessarily doing that operation, you get the cheap Bloom filter Che most of the time and only occasionally have the false positive where you do the expensive thing when it turns out you didn’t need to. That as far as I am aware of is the only use case for a bloom filter. That said, I have used it for that purpose effectively several times in my career.
Post reply on HN