Click here to Skip to main content
15,892,059 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Style and form in generated code Pin
honey the codewitch27-Nov-19 2:51
mvahoney the codewitch27-Nov-19 2:51 
GeneralRe: Style and form in generated code Pin
Gary Wheeler27-Nov-19 1:58
Gary Wheeler27-Nov-19 1:58 
GeneralRe: Style and form in generated code Pin
honey the codewitch27-Nov-19 2:02
mvahoney the codewitch27-Nov-19 2:02 
GeneralRe: Style and form in generated code Pin
MSBassSinger27-Nov-19 4:47
professionalMSBassSinger27-Nov-19 4:47 
GeneralRe: Style and form in generated code Pin
honey the codewitch27-Nov-19 4:51
mvahoney the codewitch27-Nov-19 4:51 
GeneralRe: Style and form in generated code Pin
Bruce Patin27-Nov-19 6:22
Bruce Patin27-Nov-19 6:22 
GeneralRe: Style and form in generated code Pin
honey the codewitch27-Nov-19 6:24
mvahoney the codewitch27-Nov-19 6:24 
GeneralRe: Style and form in generated code Pin
Member 1181677627-Nov-19 22:05
Member 1181677627-Nov-19 22:05 
I do the opposite when I generate code. When emitting code, I automatically indent (really, fairly trivial) and even emit occasional comments.

The reason is very simple -- I do not do so, so that users can maintain or modify the code, I do it so that I can maintain and modify the code generator. Just like any other code you write, code that you write automatically may need to be corrected for errors, large and small. Just because you do not directly maintain the generated code, does not mean that the code generator does not need to be maintained. Clean, formatted generated code helps substantially with that.

And, if one or eleven years, your code generator is not still in use (or possibly not even available), but the generated code is still running. Then it DOES need to be maintained directly.

Bottom line, treat generated code exactly like any other code that you write.

BTW, GOTO statements are fine regardless -- just use them to replacing missing control structures. Every language has them, including C and C++. For example, break and continue only apply to the inner level. I quite frequently need to break from two or (more rarely) three levels. Using a GOTO is the only choice, when the language is insufficient.
GeneralRe: Style and form in generated code Pin
honey the codewitch27-Nov-19 22:08
mvahoney the codewitch27-Nov-19 22:08 
GeneralHow do you deal with impromptu design meetings with conflicting approaches? Pin
Marc Clifton26-Nov-19 3:28
mvaMarc Clifton26-Nov-19 3:28 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Chris Maunder26-Nov-19 3:45
cofounderChris Maunder26-Nov-19 3:45 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Marc Clifton26-Nov-19 3:58
mvaMarc Clifton26-Nov-19 3:58 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Chris Maunder26-Nov-19 7:53
cofounderChris Maunder26-Nov-19 7:53 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Jörgen Andersson26-Nov-19 4:09
professionalJörgen Andersson26-Nov-19 4:09 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
raddevus26-Nov-19 4:20
mvaraddevus26-Nov-19 4:20 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
F-ES Sitecore26-Nov-19 3:53
professionalF-ES Sitecore26-Nov-19 3:53 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Eddy Vluggen26-Nov-19 3:58
professionalEddy Vluggen26-Nov-19 3:58 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
F-ES Sitecore26-Nov-19 4:03
professionalF-ES Sitecore26-Nov-19 4:03 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Eddy Vluggen26-Nov-19 4:04
professionalEddy Vluggen26-Nov-19 4:04 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Marc Clifton26-Nov-19 4:01
mvaMarc Clifton26-Nov-19 4:01 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Daniel Pfeffer26-Nov-19 4:00
professionalDaniel Pfeffer26-Nov-19 4:00 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Marc Clifton26-Nov-19 4:02
mvaMarc Clifton26-Nov-19 4:02 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Jörgen Andersson26-Nov-19 4:11
professionalJörgen Andersson26-Nov-19 4:11 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
Amarnath S26-Nov-19 4:20
professionalAmarnath S26-Nov-19 4:20 
GeneralRe: How do you deal with impromptu design meetings with conflicting approaches? Pin
PIEBALDconsult26-Nov-19 4:34
mvePIEBALDconsult26-Nov-19 4:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.