5 ms·
I also like that it exists. It's interesting if nothing else. > Imperative programming is the most natural thing for people. "Do this, then that, then that, in
by hnick 7y ago
I also like that it exists. It's interesting if nothing else.
> Imperative programming is the most natural thing for people. "Do this, then that, then that, in that order."
I think back to the sandwich example most of us had in CS class. Step by step, how do you make a sandwich? And then the teacher will always trip us up with a step we forgot.
The problem is that with current computer programming, you can't just say "Make me a sandwich" you have to specify it in excruciating detail. Naturally, an imperative form suits this.
But if we could in fact get sandwich making right, roll it out via code-reuse, and collapse that into one command, a more functional style might suit. Say what you want to achieve, instead of how to achieve it, and suddenly the order matters a bit less. Let the computer care about that.
Maybe that's not possible with current architectures or programming languages, I don't know. It would be nice though.
- felixyz 7y agoLogic programming comes the closest. (Not that the goal is fully achieved yet.)
- benibela 7y agoOr you have a library and then just write new Sandwich
- andrekandre 7y ago> But if we could in fact get sandwich making right, roll it out via code-reuse, and collapse that into one command, a more functional style might suit. Say what you want to achieve, instead of how to achieve it, and suddenly the order matters a bit less. Let the computer care about that. Maybe that's not possible with current architectures or programming languages... the problem is business/marketing imo once you've made your sandwich making declaritive, safe, and predictable, business will always ask for a sandwich with some crazy requirement like "also dispenses ketchup at 2am" or "can also be used as a substitute for morning coffee"... things it was never intended to do i feel the world of programming will never find a "one true way" and will always be a mess because our assumptions are always changing and never static (at least as long as we are chasing the next dollar at least)
- hnick 7y agoYes I've basically reached the same conclusion, unless we have a major shift in how programming itself works (AI assisted or more declarative like I said or whatever). It goes further than business/marketing though, even programmers do it to themselves. Many languages have a package repository like CPAN for Perl, but you'll still find multiple modules trying to do the same thing but slightly differently, and even when there's a clear winner there's often a lot of complexity in using it. Some things like sending an email are relatively well handled while others like XML parsing have a lot of warts. Then you get that urge to rewrite because there's no possible reason it has to be this complicated, and you become what you hate and add to the mess :)
- andrekandre 7y ago> It goes further than business/marketing though, even programmers do it to themselves that is true as well... something of a blind-spot since it happens right under our nose (or maybe said better, right behind out eyes where we cant see it)