Arc Forumnew | comments | leaders | submitlogin
2 points by wfarr 6146 days ago | link | parent

Projects have a way of sorting themselves. Give it time.


2 points by almkglor 6146 days ago | link

Unless it's Lisp, in which case each programmer has his or her own personal version with his or her own personal macros.

-----

9 points by kennytilton 6146 days ago | link

No, it does not work that way, although people who do not understand macros (such as Guido) live in fear of that hobgoblin.

Macros are not used to create unrecognizable languages. They are used when an API has grown to the point where writing the code to use it can be automated. That is probably hard to parse if you fear macros, because you can only fear macros if you do not know how they are used. But the idea is simple.

This little call tends to require this little call before it and this little call after it, or something like that. And this pattern appears often enough, or the Lisp developer recognizes it as the sort of thing that will appear again and again, and they just say, macro time!

They then give the macro a totally comprehensible name derived from the bits of the API being hit and, golly, no confusion.

The other time you see macros is in things like aif. There will only be so many of these, and they will confuse people not at all.

It seems to me some people want macros to be a problem. They never are.

-----

3 points by almkglor 6146 days ago | link

Yes, well. In the office no one wants to touch my code, because it's built from bunches of macros, and no one else here knows how macros work. Oh well. Could be just me, I suppose.

Edit: gets even worse when I use C macros in C code ^^, they even instated a rule that loops should use for(i=0;i<limit;++i) and not my otherwise shorter repeat(i,limit) macro

-----

4 points by kennytilton 6146 days ago | link

"no one else here knows how macros work"

We almost agree. :) I don't know, when they look at your functions do they know what they do? When they see a class name do they understand the class hierarchy? Or do they start browsing? As for repeat(i, limit) being banned, I presume because no one could guess what it does, well, I am looking at bartender's school. The more I learn about software the harder it is to work with some people. :) But I don't blame Dilbert on the C preprocessor.

-----

2 points by almkglor 6146 days ago | link

LOL. I think the problem, partly, is the fact that we're attached to a Japanese company and the Japanese might not have that good a grasp of what "repeat" means (they tend to have a sneering attitude to anything non-Japanese, which means they suffer in the english-language department). I did manage to talk some guys into using repeat, but they got ordered by the Japanese to change it to "for", presumably because the Japanese knew "for", didn't know what "repeat" meant, and couldn't figure out how #define worked.

Edit: Too bad I'm a teetotaler, I'd have gone to bartender school too.

-----