Hacker News new | past | comments | ask | show | jobs | submit login

And part of that context is your personal preference. Zig purposely chooses to prevent hidden control flow [1]. If operator overloading is a preference of yours, the language will get in your way. And that's fine. But it doesn't mean you can't build the "right abstraction" with it. These tradeoffs force you, for instance, to add an allocator to every type that needs dynamic allocation. For me that's great because it's evident which components need memory and I can make a conscious decision on what strategy to use with each one (or to avoid them entirely). For someone else, that might be a PITA. There is no "right" abstraction here.

1. https://ziglang.org/learn/overview/#small-simple-language




No, your personal preference is not part of the context. Unfortunately, too many programmers think that way.

If you don't like using abstractions, but if you like instead to make everything explicit, that is of course your prerogative. But denying that there is a right abstraction will just keep you from finding it. It doesn't change the fact that there often is one.

Going after the right abstraction takes time, and it might be just too expensive in your context, or your context may actually make abstraction infeasible. So in my opinion, it is all about trying to get into a position where experimenting with abstractions becomes cheap and economical. In principle, we should be in a much better position today in that respect than, say, 30 years ago.


But what makes an abstraction 'right'? I would say it's if it makes the program easier to make correct, or easier to write, or easier to understand, or easier to maintain, or ideally some combination of all of those. But easier for whom? Some programmers may have an easier time with more abstractions to provide guardrails and reduce redundancy; others may find it more effective to have everything laid out explicitly. And of course it's not just a question of more versus less abstraction; individual programmers often have specific abstractions and design patterns that they like to reuse in many contexts.

That's not quite the same thing as 'personal preference', where the right answer is by definition whatever I think is right. It's possible for me to think that XYZ abstraction or lack-of-abstraction works well for me, when in fact there's some other approach would that work better if I took the time to learn how it worked. Maybe I just haven't heard of that approach, or maybe I'm lazy or inexperienced or don't have the time to learn. People always think they're more unique than they really are; compare to the concept of "learning styles" which keeps being debunked.

But surely there is some legitimate variation.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: