KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Reverse engineering code and I'm kind of appalled at the style, but I wanted to make sure there's no good reason for doing these things.... Is it just me or is this a horrible coding style if ( pwbuf ) sprintf(username,"%s",pwbuf->pw_name); else sprintf(username,"%d",user_id); And why wrap code not intended for compilation in an #if 0 .... #endif Instead of comments? EDIT: So as some explained below, this is due to the possibility to flummox /* */ which I didn't realize. But I still don't understand, why not just use your programming environment tools or favorite text editor's macro's to block comment it out using "//" wouldn't this be MUCH more straightforward and easy to know to visually skip? Am I just inexperienced in C and missing why these things might be a good idea -- or is there no excuse, and I'm justified in feeling irritated at how ugly this code is?
Tags (comma-separated)
Save Edits
Cancel