4 ms·
> I want my code to be clever. I like to push at the limits of expressibility in a language. For the types of work I do, small, tight, fast code is better than
by senko 5y ago
> I want my code to be clever. I like to push at the limits of expressibility in a language. For the types of work I do, small, tight, fast code is better than simple, verbose code that any tom, dick or Harry could comfortably maintain.
> Does this distinction have a name?
Yeah. Write-only code.
- josephg 5y agoCode written this way is often smaller and tighter. But that doesn’t make it unmaintainable. Is Haskell unmaintainable because of its dense, clever use of the type system? No way. But I’d personally struggle to maintain something like that because I don’t have enough familiarity with Haskell to do so. Likewise I wouldn’t trust most programmers to maintain the rust code I’ve been writing lately - not because it’s bad rust, but because I’m making heavy use of the language’s features. That raises the skill floor. In comparison, if you gave me some crashing Go code I could probably debug it even though I don’t know much go. I find most Java code bases awful to maintain because there’s always so much code. Simple changes take a long time to make because there’s so much code to understand and modify. Give me the tight rust any day.
- mplanchard 5y agoThe rust compiler is a great friend for the kind of code I imagine you’re talking about. Expressing ideas in the type system makes the code easier to maintain, because you can’t compile code that deviates from your invariants. I’ve been reviewing rust code at work for over a year now, much more recently having switched to a job where the main language is rust. Knowing in code review that the code compiled successfully is a huge benefit for readability and review, IMO, because you don’t need to go around checking any of the invariants the type system can catch.
- chartpath 5y agoThere are also use cases for dynamically generating code, or having higher kinded types that Go just can't touch. Anything that resembles data engineering is unnecessarily tedious. One of my favourite tools for teams these days is Hasura, which is written in Haskell. I could not imagine a product like this being written in Go.
- fnord123 5y ago> Is Haskell unmaintainable because of its dense, clever use of the type system? yes.