RomeHein / ESPecial

ESP32 automation with web interface and telegram bot
GNU General Public License v3.0
111 stars 17 forks source link

#pragma once and #ifndef #22

Closed josef2600 closed 1 year ago

josef2600 commented 1 year ago

i think you shouldn't use both #pragma once and #ifndef together at once. not saying it doesnt work, but it is better to use one of them, not both. some say #pragma once is better, but i prefer #ifndef because it is more compatible with all compilers (specially for micro controllers). it works with old compilers too. and i couldnt fined any reason to not use #ifndef instead of #pragma once. there is some futures for #pragma once but i don't like them ether! less code, avoidance of name clashes in my opinion is bad. i am all for being lazy ! but that is just wrong! maybe i am just old-school !

RomeHein commented 1 year ago

Thanks for this, very interesting. Keep in ming that I have no knowledge at all in C/C++ 😅 At the beginning, I just coded ESPecial as an exercice, and then it became a bigger project. Please open a PR and feel free to correct any mistakes like this 👍

josef2600 commented 1 year ago

thank you. believe it or not, i have no idea what is PR !! that is why i haven't created a branch in my GitHub as you said. is it problem report? something else? i haven't been able to create a repository in GitHub. well, manly because i haven't had the time to search for it. i am bussy to complete this project. as for this issue, i like to direct anyone to this link for help: https://en.wikipedia.org/wiki/Pragma_once