4 ms·
Yes, this is why macros have been abandoned in most entreprise languages (C#, Java)
by d--b 8y ago
Yes, this is why macros have been abandoned in most entreprise languages (C#, Java)
- coldtea 8y agoAs if they've tried them and then abandoned them? Java, fone one, didn't even have generics and closures when it came out. It didn't have macros because it was intended for the ho-hum enterprise programmer of the time, who, the thought was, would not know what to do with them. Instead, they re-invented all those things badly (e.g. through gobs of XML and ugly reflection based metaprogramming).
- kamaal 8y agoNobody still uses them, even if they are available. In fact anything that doesn't looks enterprisey enough never goes past code reviews. The adoption cycle for even the simplest of Syntactical features when it comes to Java enterprise is >10+ years. In some companies its never. The saddest part isn't even that. The sad part is a whole generation of programmers have been raised, and turned to be architect astronauts without ever using something like a lambda or a closure. The only hope for programming as a craft now is hoping Oracle kills Java(even if by mistake), and then some thing like Perl 6 comes along to replace it.
- AnimalMuppet 8y agoI'm not sure that will help. I see a kind of "family resemblance" between COBOL and enterprise Java. I wonder if any language that is going to play in this space is destined to become a monstrosity - destined by the nature of the problem space rather than the nature of the language. I am aware that when I say this, I am basing my opinion on a sample size of two...
- d--b 8y agoNonsense, the enterprise programmer of the time was programming in C or C++ and was making heavy use of macros. Macros, unlike generics are super easy to implement, so there is no reason not implement them, unless you specifically don't want to implement them. Java didn't have macros because no one wanted the kind of dialect that macros allow, ie. re-learning a language every time you change company.
- kbp 8y ago> Nonsense, the enterprise programmer of the time was programming in C or C++ and was making heavy use of macros. C macros are entirely different in use from Lisp macros. C macros are written in a text substitution language that knows virtually nothing about C, whereas Lisp macros are written in Lisp and operate on regular Lisp data structures. Even trivial things are very difficult to get right with C macros, whereas very complicated things are often elegant and simple with Lisp macros. It's an entirely different experience. They're not at all comparable. C programmers learn to fear macros because C macros have a lot of problems. Few of those carry over to Lisp macros.
- Barrin92 8y agothen again enterprise software and languages are also full of sdls, plugins, frameworks, libraries and other pieces and parts that enable the same kind of power that lisp has. People haven't really given up on the idea of building out functionality for specific portions of their codebase (and we really shouldn't) we've just seemingly exchanged one very powerful solution for a sea of different tools.
- pjmlp 8y agoActually C# and Java do have macros, they just aren't on the syntax level. Attributes/annotations, compiler plugins, expression trees and aspects take the role of macros.