News for hackers. Stuff that matters.
Re:Does C++ still deserve a bad rap? by pmoriarty on Friday October 16, 2020 @08:32PM (#24806426)
"Most people will say foo and bar are functions and that's a reasonable guess. Unless you are talking about C++. In C++ foo and bar could be functions but could also lots of other things."

Same as in Lisp, one of the most beloved of languages on HN.

Were Lisp's macros a mistake? Some will say yes, but overall the language is more praised for them than damned.

So highly regarded are Lisp macros that many languages will eagerly proclaim that they have macros too -- even if they're not homoiconic and so harder to work with than in Lisp. Few if any are the languages that proudly proclaim that they don't have macros because they thought Lisp macros were a big mistake.

C++ fans themselves often point out that C++ templates can be as powerful as Lisp macros.

So which is it? Is giving users the power to radically transform their language a bug or a feature?

Re:Does C++ still deserve a bad rap? by jnxx on Saturday October 17, 2020 @06:46AM (#24809054)
This is perhaps a misunderstanding. Lisp macros are a part of the language. Of course you can use them to make your code unreadable. But what they are used for is to evolve and add definitions for things such as iteration, which in other languages, like Python or C++ is not possible without a language change.

For example:

https://lispcookbook.github.io/cl-cookbook/iteration.html

https://docs.racket-lang.org/reference/for.html

Re:Does C++ still deserve a bad rap? by ajkjk on Friday October 16, 2020 @09:01PM (#24806613)
I don't think lisp is that beloved here. It's just that the few people who love it love to bring it up.
Re:Does C++ still deserve a bad rap? by saagarjha on Saturday October 17, 2020 @05:07AM (#24808660)
Hacker News is written in a Lisp, started by people deeply interested in the language, and frequented in a large part by people who feel similarly.
Re:Does C++ still deserve a bad rap? by ajkjk on Saturday October 17, 2020 @10:07PM (#24815023)
I think that last clause is incorrect. It might have once been correct but I suspect most people on here have never used Lisp at all.