3 ms·
This doesn't feel like the author is trying to actually help Java programmers, but rather is just an excuse for him to patronizingly describe a language to thos
by arthurbrown 15y ago
This doesn't feel like the author is trying to actually help Java programmers, but rather is just an excuse for him to patronizingly describe a language to those he considers less fortunate.
I also don't understand the reason for writing the code in an intentionally non idiomatic style. If you want to convince someone why something is better; show them how it would be done properly. The way it has been presented instead insults the audiences intelligence by presupposing that they would be unable to understand this material, that the author has admittedly only recently picked up himself.
I don't think (reduce min list) is going to blow anyone's mind, and writing a function to iterate through the indexes of a list will do more to confuse than to enlighten.
not to mention; we've been here before haven't we - http://c2.com/cgi/wiki?SmugLispWeenie http://c2.com/cgi/wiki?SmugLispWeenie
- mck- 15y agoThe purpose of the author of the post was to introduce meta-programming to those ignorant of it. I see your point of insulting the audiences intelligence, but don't you think to throw in a tail-call optimized recursive function - or (reduce min list) for that matter - would be a moot comparison and distract the reader from the point? When you try to make a point by comparison, say the weather in Hong Kong versus Toronto, you wouldn't go gauge the weather in HK on a hot summer day at 4pm in the Central District, while in Toronto you go out in the burbs in the middle of a deserted, snowy night?
- batista 15y agoThe purpose of the author of the post was to introduce meta-programming to those ignorant of it. I'm not sure many Java programmers are ignorant about, say, the reflection APIs.
- arthurbrown 15y agoThe problem with "introducing" metaprogramming is that you first have to have a solid understanding of the language itself in order to manipulate it. From your examples in the article, I think that anyone who genuinely has no programming experience outside Java is going to have very serious problems understanding even the example you've given. Putting myself in those shoes, I have no idea what defun, let, do, when, setf, nth, length, and funcall are. I can assume they must be function names because they seem familar, but that still doesnt tell me how they should be called, how to give them arguments, what to expect they will return, or even how to know where they're defined. There's no way to teach someone how to programatically manipulate code if they can't mentally parse the code in the first place. Even if you were to completely teach Lisp as a language before introducing metaprogramming you still run into the experience issue. It takes personal experience to understand where and when to use macros. Like you said yourself in the article, most things can be expressed as a normal function. It takes the experience of writing a lot of code to be able to make the judgement of what actually belongs as a macro, and not just a function. I understand that metaprogramming is very exciting because it opens up so many doors, but it's easy to forget about everything that you had to already know to get to the point where it becomes useful. Lisp makes it very easy to repeat this problem because the language itself is so small and consistent. It doesn't take long to get to the point where you feel comfortable enough to try writing macros. It seems that you want to share how great metaprogramming can be and how much it simplifies the work you're doing. That's great, you and I can look at it and appreciate it. But framing it as though it's appropriate for Java programmers as an introduction to Lisp just serves to make Lisp programmers look arrogant, and builds even more resent amongst Java programmers.