Live data from Hacker News

Algorithms we develop software by

grantslatton.com

31–40 of 108 posts

Re: Algorithms we develop software by

#31
post #20

Earlier quoted context omitted.

Assertions?

But assertions only tell you you broke someone after the fact (and only if they're enabled)? They don't do anything to help prevent you from breaking them in the first place.

Of course they don't, how could they? How could anything, for that matter? (Apart from guarantees you could ensure statically, natch.)

Re: Algorithms we develop software by

#32

> "gun to your head, you have to finish in 24 hours, what do you do?" PSA: if you are a project manager / owner or some other similar position you do not get to ask this. This is a personal educational excercise not a way to get stuff done faster.

So glad someone’s here saying it. I am absolutely dreading tomorrow morning now with the thought our manager has also read this article.

Sounds like you need a different manager.

Re: Algorithms we develop software by

#33
post #11

Earlier quoted context omitted.

Unit tests are a waste of time. Design by Contract + system tests are a far superior technique that take less time and find more bugs.

How do you know the contracts are being followed?

Either through assertions, through fuzz testing, or by formal verification.

Re: Algorithms we develop software by

#34
post #31

Earlier quoted context omitted.

But assertions only tell you you broke someone after the fact (and only if they're enabled)? They don't do anything to help prevent you from breaking them in the first place.

Of course they don't, how could they? How could anything, for that matter? (Apart from guarantees you could ensure statically, natch.)

> Of course they don't, how could they? How could anything, for that matter?

Uh, that's literally what unit tests do? They tell you if you broke any of the cases they test for, before you release your implementation to other people...

Re: Algorithms we develop software by

#35
post #31

Earlier quoted context omitted.

But assertions only tell you you broke someone after the fact (and only if they're enabled)? They don't do anything to help prevent you from breaking them in the first place.

Of course they don't, how could they? How could anything, for that matter? (Apart from guarantees you could ensure statically, natch.)

Assertions triggering in integration tests are different from unit tests. They don't involve writing mocks. They are generally closer to the code, especially with design by contract, so they are more likely to be fixed during a refactor. They encode what you believe your code should do more directly. And they can be used as a basis for formal verification.

Re: Algorithms we develop software by

#36
post #20

Earlier quoted context omitted.

Assertions?

But assertions only tell you you broke someone after the fact (and only if they're enabled)? They don't do anything to help prevent you from breaking them in the first place.

Tests have the same effect right?

Re: Algorithms we develop software by

#38
post #35
post #31

Earlier quoted context omitted.

Of course they don't, how could they? How could anything, for that matter? (Apart from guarantees you could ensure statically, natch.)

Assertions triggering in integration tests are different from unit tests. They don't involve writing mocks. They are generally closer to the code, especially with design by contract, so they are more likely to be fixed during a refactor. They encode what you believe your code should do more directly. And they can be used as a basis for formal verification.

Hey, I'm arguing in favour of contracts and assertions here... XD

I even considered formal verification, if under another name.

Ed.

I think I hit a posting limit. After reading dataflow's answer to gp I think I interpreted ggp differently from both of you.

I meant quite literally neither assertions nor unit tests prevent you from breaking things. Of course they'll help you to catch those mistakes before release. I didn't think that counts as prevention.

Re: Algorithms we develop software by

#39
> start over each day This reminds me of "spaced repetition" in learning theory. Drilling the same problem from scratch is a great way to get better at iterating through your rolodex of mental models, but so many people prioritize breadth because they think it is the only way to generalize to new problems.

Re: Algorithms we develop software by

#40

Earlier quoted context omitted.

> it doesn't sit well with bizdev or project managers To be fair, it makes everything twice as expensive. Managers are always going to reflexively push back against that, even if the new feature covers that cost and more.

The second time doesn't cost as much as the first.

And the first is cheaper than a ‘regular single version’ bc you build it with the thought that you will throw it away.
Post reply on HN