Live data from Hacker News

Testing is better than data structures and algorithms

nedbatchelder.com

31–40 of 178 posts

Re: Testing is better than data structures and algorithms

#31

This will annoy a lot of folks, but: 1 - If you work on large scale software systems, especially infrastructure software of most types then you need to know and understand DSA and feel it in your bones . 2 - Most people work on crud apps or similar and don't really need to know this stuff. Many people in this camp don't realize that people working on 1 really do need to know this stuff. What someone says on this topi…

I already know the answer to this, but did you read the article? Ned addresses your concerns.

No, he doesn't. He doesn't discuss the gigantic dividing line between the two different types of systems I categorize above. He also doesn't cover the "feel it in your bones" required in the type 1 systems. Spend a minute reading or listening to Jeff Dean talk, and you'll see what is required to build those types of systems. Spend some time somewhere working on those systems and you'll come across some folks who just have this ready to go and can apply it and the drop of a hat.

Re: Testing is better than data structures and algorithms

#32
> Of course some engineers need to implement hash tables, or sorting algorithms or whatever.

> We love those engineers: they write libraries we can use off the shelf so we don’t have to implement them ourselves.

The world needs to love "infrastructure developers" more. To me it seems only the killer app writing crowd is valued. Nobody really thinks about the work that goes into programming languages, libraries and tools. It's invisible work, taken for granted, often open source, not rarely unpaid.

> It wasn’t opening a textbook to find the famous algorithm that would solve my problem.

I had that exact experience. I'm working on my own programming language. After weeks of trying to figure something out by myself, someone told me to read Structure and Interpretation of Computer Programs. It literally had the exact algorithm I wanted.

Re: Testing is better than data structures and algorithms

#33

This will annoy a lot of folks, but: 1 - If you work on large scale software systems, especially infrastructure software of most types then you need to know and understand DSA and feel it in your bones . 2 - Most people work on crud apps or similar and don't really need to know this stuff. Many people in this camp don't realize that people working on 1 really do need to know this stuff. What someone says on this topi…

That's going to be true in all fields, people think their experiences are the only valid experiences and everyone else must think and work on what they think is important, otherwise they're wrong.

Re: Testing is better than data structures and algorithms

#34
post #16

The article fails to demonstrate how code-tests result in objectively better code. Many comp sci programs have courses on testing that cover TDD, unit testing and fuzzing, among other topics. Yet much of the safety critical code we rely on for critical infrastructure (nuclear reactors, aircraft, drones, etc) is not tested in-situ. It is tested via simulation, but there's minimal testing in the operating environment w…

I don't understand what the difference between a simulation and a test is?

Re: Testing is better than data structures and algorithms

#35

This will annoy a lot of folks, but: 1 - If you work on large scale software systems, especially infrastructure software of most types then you need to know and understand DSA and feel it in your bones . 2 - Most people work on crud apps or similar and don't really need to know this stuff. Many people in this camp don't realize that people working on 1 really do need to know this stuff. What someone says on this topi…

> What someone says on this topic says more about what things they have worked on in their life than anything else. This is the crux of the debate. If you work on CRUD apps, you basically need to know hash maps, and lists, but getting better at SQL and writing clean code is good. But there are many areas where writing the right code vs the wrong code really matters. I was writing something the other day where one sma…

This happens to me too it just happens roughly 100x less than me needing to know how to test properly.

It's never the other day it's 10x a day, every day.

So, OP is still correct.

Re: Testing is better than data structures and algorithms

#36

I agree with the article, but I'll bet a lot of others, don't. Discussions on Code Quality, don't fare well, here. Wouldn't surprise me, if the article already has flags. Of course, "testing," is in the eye of the beholder. Some folks are completely into TDD, and insist that you need to have 100% code coverage tests, before writing one line of application code, and some folks think that 100% code coverage unit tests,…

Testing, especially vstest.console.exe in Visual Studio has carried my business really far. I have accumulated thousands of tests on my codebase usually based on customer requirements or on past bugs which I have been trying to replicate.

I think that a lot of people dislike testing because a lot of tests can run for hours. In my case it is almost 6 hours from start to finish. However as a software developer I have accumulated a lot of computers which are kind of good and I don't want to throw them out yet but they are not really usable for current development - i.e. 8GB of RAM, 256GB SSD, i5 CPU from 2014 - That would be a punishment to use it with Visual Studio today. But it is a perfect machine for compiling in console i.e. dotnet build or msbuild and running tests via vstest glued together with PowerShell script. So this dedicated testing machine is running on changes over night and I will see if it passed or not and if not fix tests which did not passed.

This setup may feel clunky, but it allows me to make sweeping changes in a codebase and be confident enough, that if the tests pass, it will very likely work for the customer too. The most obvious example where tests were carrying me around has been moving to .NET8 from .NET Framework 4.8. I have went from 90% failure rate on tests to all tests clear in like 3-4 iterations.

Re: Testing is better than data structures and algorithms

#37

This will annoy a lot of folks, but: 1 - If you work on large scale software systems, especially infrastructure software of most types then you need to know and understand DSA and feel it in your bones . 2 - Most people work on crud apps or similar and don't really need to know this stuff. Many people in this camp don't realize that people working on 1 really do need to know this stuff. What someone says on this topi…

My work involves petabyte scale data, and the algorithms are very straightforward:

- What you want to do is probably trivially O(kn).

- There isn't a - Cache results when they are O(1), don't when they are O(n).

- If you want to do something >O(kn), don't.

- If you really need to so something >O(kn), do it in SQL and then go do something else while it's running.

None of that requires any DSA knowledge beyond what you learn in the first weeks of CS101. Instead, what's useful is knowing how to profile to optimize k, knowing how SQL works, and being able to write high quality maintainable code. Any smart algorithms that have a large time complexity improvement will probably be practically difficult to create and test even if you are very comfortable with the underlying theoretical algorithm. And the storage required for an My general impression is that for small-scale problems, a trustworthy and easy algorithm is fine, even if it's inefficient ($100 of compute < $1000 of labor). For large-scale problems, domain knowledge and data engineering trumps clever DSA skills. The space between small- and large-scale problems is generally either nonexistent or already has premade solutions. The only people who make those "premade solutions" obviously need to feel it in their bones the way you describe, but they're a very very small portion of the total software population, and are not the target audience of this article.

Re: Testing is better than data structures and algorithms

#38
post #34
post #16

The article fails to demonstrate how code-tests result in objectively better code. Many comp sci programs have courses on testing that cover TDD, unit testing and fuzzing, among other topics. Yet much of the safety critical code we rely on for critical infrastructure (nuclear reactors, aircraft, drones, etc) is not tested in-situ. It is tested via simulation, but there's minimal testing in the operating environment w…

I don't understand what the difference between a simulation and a test is?

There is none, and that's my point. Simulations themselves are contrived scenarios that are not representative of production environments.

Re: Testing is better than data structures and algorithms

#39
post #34
post #16

The article fails to demonstrate how code-tests result in objectively better code. Many comp sci programs have courses on testing that cover TDD, unit testing and fuzzing, among other topics. Yet much of the safety critical code we rely on for critical infrastructure (nuclear reactors, aircraft, drones, etc) is not tested in-situ. It is tested via simulation, but there's minimal testing in the operating environment w…

I don't understand what the difference between a simulation and a test is?

Mostly just semantics.

Re: Testing is better than data structures and algorithms

#40

This will annoy a lot of folks, but: 1 - If you work on large scale software systems, especially infrastructure software of most types then you need to know and understand DSA and feel it in your bones . 2 - Most people work on crud apps or similar and don't really need to know this stuff. Many people in this camp don't realize that people working on 1 really do need to know this stuff. What someone says on this topi…

I'm not sure the article disagrees on that point. As you say, for most people, testing is better than dsa.

(Alternatively you could just argue it's a false dichotomy)

Post reply on HN