Liste des Groupes | Revenir à col misc |
On 2025-03-01, Peter Flass <peter_flass@yahoo.com> wrote:Good advice sadly FEW are willing to take.
c186282 <c186282@nnada.net> wrote:If you're doing it for sport, though, there have been lots of
>On 2/28/25 7:39 AM, Bob Eager wrote:
>On Fri, 28 Feb 2025 02:34:52 +0000, rbowman wrote:
>Sadly, macros made their way into C. The basic idea was fine but we had>
one programmer who laid awake nights thinking up new perverted things to
do with macros. I forget if it was Kernighan or Ritchie who later said
if they had only known what people would do with them...
I probably do far too much with a standalone macro processor...
fun things done with macros. My favourite is an IBM 360 macro
that would solve the Towers of Hanoi problem, and use the MNOTE
directive to show the moves. It generated no executable code -
the expanded source code listing was the solution.
I've written a couple of macro processors, and the acid test
for each was to write a recursive Towers of Hanoi macro for them.
Again, if you're into it for sport, some amazing thingsIt's unfortunately NOT hard to make 'C' *totally
unreadable*, impossible to follow. Sometimes you
see the young hot-shots cram a dozen lines worth
of stuff into a single line with LOTS of punctuation
characters and bracket tricks. It's also possible to
obfuscate using too many, esp nested, macros.
>
Thing is, those ultra-compacted lines don't really
run any faster - the same functions and ops are
being run regardless.
have been done, culminating in the International Obfuscated
C Code Contest:
https://www.ioccc.org
I write C the same way. A wise person on one of these newsfroupsBeing kinda old-school my pgms always look like>
something from the K&R book, and with comments
after almost every line. THAT you can read a
day from now, or a year from now ....
Never can have enough comments. I usually use lots, but recently I was
looking over some of my old code and had a “what?” moment. It was obvious
when I wrote it.
once said that the comments aren't for someone else, they're for
you a year from now. The more tricky the code, the more detailed
the comments.
Les messages affichés proviennent d'usenet.