logoalt Hacker News

cozzyd11/03/20252 repliesview on HN

The C preprocessor allows you to define a limited DSL on top of C. This is... sometimes a good thing, and often convenient, even if it makes it hard to understand.


Replies

gitonthescene11/03/2025

I think _all_ programming is about finding an appropriate DSL for the problem at hand. First you need to understand the “language” of the problem then you develop a “lingo”.

show 1 reply
jacquesm11/03/2025

For extremely small values of 'sometimes' where sometimes is constrained by the following expressions evaluating to 'true':

- you have no interest in maintaining your code

- your code will never be maintained by someone else

- you know your C preprocessor better than you know your C compiler

- your favorite language isn't available for this particular target

- you don't mind object level debugging

- your idea of a fun time is to spend a few hours per day memorizing code

- you really are smarter than everybody else

show 1 reply