You are viewing a single thread.
View all comments
-4 points

If you use your type system to make invalid states impossible to represent & your functions are pure, there less—maybe nothing—to test, which will save you from this scenario.

permalink
report
reply
26 points

You can’t have any bugs if you don’t write any code.

permalink
report
parent
reply
15 points

Nothing to test? Lol what.

def add(a: int, b: int) -> int: return a * b

All types are correct. No side effects. Does the wrong thing.

permalink
report
parent
reply
5 points

Maybe it’s doing the right thing but is badly named

permalink
report
parent
reply
6 points

Maybe the it’s the English language that is wrong?

permalink
report
parent
reply
12 points

It must be nice to work only with toy cases where this is feasible.

permalink
report
parent
reply
0 points

Nothing toy-like about using ADTs to eliminate certain cases. When all cases are handled, your tests can move from a micro state to a macro state. Contraint types or linear types can be used to only allow certain sizes of inputs or require all file handles be closed when opened.

Naturally if your language’s type system is bad you can’t make these compile-time guarantees tho. Heck, a lot of developers are still using piss-poor languages with null or the infernce sucks with any.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 5.3K

    Monthly active users

  • 1.5K

    Posts

  • 33K

    Comments