Click here to Skip to main content
15,892,927 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: Thought of the Day Pin
Herman<T>.Instance26-Nov-19 21:13
Herman<T>.Instance26-Nov-19 21:13 
GeneralRe: Thought of the Day Pin
Johnny YYZ27-Nov-19 0:40
professionalJohnny YYZ27-Nov-19 0:40 
GeneralAmazon knows it? Pin
Kornfeld Eliyahu Peter26-Nov-19 4:31
professionalKornfeld Eliyahu Peter26-Nov-19 4:31 
GeneralRe: Amazon knows it? Pin
W Balboos, GHB26-Nov-19 6:28
W Balboos, GHB26-Nov-19 6:28 
GeneralRe: Amazon knows it? Pin
Kschuler26-Nov-19 8:23
Kschuler26-Nov-19 8:23 
GeneralRe: Amazon knows it? Pin
Kornfeld Eliyahu Peter26-Nov-19 22:37
professionalKornfeld Eliyahu Peter26-Nov-19 22:37 
GeneralRe: Amazon knows it? Pin
GenJerDan26-Nov-19 20:44
GenJerDan26-Nov-19 20:44 
GeneralStyle and form in generated code Pin
honey the codewitch26-Nov-19 4:28
mvahoney the codewitch26-Nov-19 4:28 
I almost as a matter of course involve code generation in my larger projects.

So that means I'm dealing with a lot of generated code.

Typically, I don't design my generated code for manual modification. I design the tool that generates it to be customizable. Ergo, the tool will make the code do what you want. Change the tool parameters to change the code but leave the code alone.

The reason being is it's almost always stupid to try to support generated code that a user has modified and for extremely complicated code, like parse tables, dfa tables, or business rule tables that have a lot of conditionals and branching.

So the code is a black box.

And because of *that* I throw a lot of traditional design assumptions out the window, or go meta with them.

Comments are an example: Commenting the generated code is pointless. Commenting the code that generates the code is project-critical

Constants are another example. It doesn't matter if you use hard coded values in your generated code if the values are const in the code that generates *it*. Generating private constants just adds to code size with not much upside. The exception is long constant strings.

And gotos are totally acceptable, especially in state machine code, and in the absence of cross language CodeDom loop break statements. (CodeDom only supports for() and no while() nor do while(), no break, no continue.

How many of you hate me for this, and who agrees with me here? Cool | :cool:

I'm just curious.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

GeneralRe: Style and form in generated code Pin
PIEBALDconsult26-Nov-19 4:41
mvePIEBALDconsult26-Nov-19 4:41 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 4:42
mvahoney the codewitch26-Nov-19 4:42 
GeneralRe: Style and form in generated code Pin
Maximilien26-Nov-19 4:41
Maximilien26-Nov-19 4:41 
GeneralRe: Style and form in generated code Pin
CodeWraith26-Nov-19 4:44
CodeWraith26-Nov-19 4:44 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 4:49
mvahoney the codewitch26-Nov-19 4:49 
JokeRe: Style and form in generated code Pin
Daniel Pfeffer26-Nov-19 5:15
professionalDaniel Pfeffer26-Nov-19 5:15 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 5:21
mvahoney the codewitch26-Nov-19 5:21 
GeneralRe: Style and form in generated code Pin
Jörgen Andersson26-Nov-19 5:53
professionalJörgen Andersson26-Nov-19 5:53 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 5:54
mvahoney the codewitch26-Nov-19 5:54 
GeneralRe: Style and form in generated code Pin
Jörgen Andersson26-Nov-19 5:58
professionalJörgen Andersson26-Nov-19 5:58 
GeneralRe: Style and form in generated code Pin
dywanex19226-Nov-19 8:07
dywanex19226-Nov-19 8:07 
GeneralRe: Style and form in generated code Pin
  Forogar  26-Nov-19 5:04
professional  Forogar  26-Nov-19 5:04 
GeneralRe: Style and form in generated code Pin
Dan Neely26-Nov-19 5:17
Dan Neely26-Nov-19 5:17 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 5:20
mvahoney the codewitch26-Nov-19 5:20 
GeneralRe: Style and form in generated code Pin
Kornfeld Eliyahu Peter26-Nov-19 5:32
professionalKornfeld Eliyahu Peter26-Nov-19 5:32 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 5:34
mvahoney the codewitch26-Nov-19 5:34 
GeneralRe: Style and form in generated code Pin
#realJSOP26-Nov-19 7:03
mve#realJSOP26-Nov-19 7:03 

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.