3 ms·
Correct me if I'm wrong but isn't the successful imitation of natural language an example of "means of abstraction" in practice?
by vectorpush 13y ago
Correct me if I'm wrong but isn't the successful imitation of natural language an example of "means of abstraction" in practice?
- stiff 13y agoYou can write 2.days().from_now() in almost any OO language which allows extending primitive types, so it isn't really very impressive. There are lots of example of languages with very powerful means of abstraction / composition and not syntax people commonly consider pretty or natural: Lisp, Erlang, Prolog. There are also programming languages which imitate natural languages to some degree and aren't very expressive, like COBOL.
- steveklabnik 13y ago> so it isn't really very impressive. You can say this about any programming language feature or concept.
- sunir 13y agoI think his declaring something as impressive or not in an objective way is fraught with peril since impression is always a subjective feeling. If it impressed you, it is impressive. However that being said 2.days.ago is not a particularly differentiating bit of magic because as has been stated elsewhere every object oriented language that allows extensions of primitive types will allow this. The main question here though is whether 2.days.ago is a good design and does it really demonstrate expressiveness, which as has also been stated above related more to the concept of "small pieces, loosely joined" 2.days.ago breaks encapsulation and abstraction and inverts the flow of control (parameter calls function).
- steveklabnik 13y agoIt's not the same as that, since it's scoped and must be implicitly imported.
- deleted 13y ago[deleted]