Isolating complexity is the essence of successful abstractions

chriskrycho | 96 points

I don’t think I agree that either typescript nor rust successfully hide the complexity in their type systems.

By the nature of type systems, they are tightly coupled with the code written around them.

Rust has rich features to handle this coupling (traits and derives), but typescript does not.

dartos | 5 hours ago

Python showed what relaxed types could do. And we could go a long way as it turns out without types. But there are use cases for types, and even python admitted such when they added type annotations.

However, when I was a kid a would put a firecracker next to an object. I didn't bother running the scenario through a compiler to see if the object was of type Explodable() and had an explode() method that would be called.

bb88 | 5 hours ago

Does complexity mean a long block of code with many levels of nested conditionals which are messed with cross-block mutable variables ?

revskill | 10 minutes ago

I think "types" is the solution of two completely different problems:

1. how to specify memory layout for faster execution

2. how to give hint when I press . in IDEs

if you use typing outside these two scopes you'd probably find many troubles.

est | 2 hours ago

> Complexity has to live somewhere. If you are lucky, it lives in well-defined places.

This whole section makes me think of construction which has similar abstraction and hidden complexity problems. It strikes me that they solve it by having design be entirely separate from implementation. Which is usually the corner where all our luck as software developers inevitably runs out.

Our methods are still rather "cowboy." We have cool "modernized cowboy" languages that make it hard to shoot your foot off, but at the end of the day, we're still just riding old horses and hoping for the best.

timewizard | 2 hours ago

>The question is first of all whether we have written them down anywhere

The only hard thing in software: papers please (easily accessible documentation)

gsf_emergency | 7 hours ago

"Parameterizing complexity" is probably a better way to say it. There's no isolation when it comes to software.

PittleyDunkin | 4 hours ago

I have always felt that it's better to "concentrate" complexity into one key component and make the rest of the codebase simple than to distribute complexity evenly everywhere in some kind of open-coded swamp.

quotemstr | 3 hours ago

complexity has to live somewhere, code anxiety was a real thing for me

picografix | 7 hours ago

[flagged]

drewcoo | 7 hours ago