Re: Quick Poll: what is the correct indentation for ifdef?

new topic     » goto parent     » topic index » view thread      » older message » newer message

I personally like to indent ifdef as any old if statement. The reason being is I treat it like a normal if statement. I don't care (when reading the logic of the code) that it's done in the pre-processing of the Euphoria source vs. runtime of the Euphoria source. All I care about is that:

if 1 then 
    ifdef WINDOWS then 
         alert("Hello") 
    end ifdef 
end if 

If 1 is true and we are running on Windows then a hello alert box will appear. To me, having ifdefs on the first column really breaks up the flow of the code and is very difficult for me to follow. I am sure that one will adapt to their coding style and be able to read the flow no matter how they indent it, but for me it's easier to treat them all the same for the purpose of readability.

Jeremy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu