Click here to Skip to main content
14,455,910 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
digimanus26-Nov-19 22:13
Memberdigimanus26-Nov-19 22:13 
GeneralRe: Thought of the Day Pin
Johnny YYZ27-Nov-19 1:40
professionalJohnny YYZ27-Nov-19 1:40 
GeneralAmazon knows it? Pin
Kornfeld Eliyahu Peter26-Nov-19 5:31
mveKornfeld Eliyahu Peter26-Nov-19 5:31 
GeneralRe: Amazon knows it? Pin
W Balboos26-Nov-19 7:28
mveW Balboos26-Nov-19 7:28 
GeneralRe: Amazon knows it? Pin
Kschuler26-Nov-19 9:23
MemberKschuler26-Nov-19 9:23 
GeneralRe: Amazon knows it? Pin
Kornfeld Eliyahu Peter26-Nov-19 23:37
mveKornfeld Eliyahu Peter26-Nov-19 23:37 
GeneralRe: Amazon knows it? Pin
GenJerDan26-Nov-19 21:44
MemberGenJerDan26-Nov-19 21:44 
GeneralStyle and form in generated code Pin
honey the codewitch26-Nov-19 5:28
mvahoney the codewitch26-Nov-19 5: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 5:41
professionalPIEBALDconsult26-Nov-19 5:41 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 5:42
mvahoney the codewitch26-Nov-19 5:42 
GeneralRe: Style and form in generated code Pin
Maximilien26-Nov-19 5:41
MemberMaximilien26-Nov-19 5:41 
GeneralRe: Style and form in generated code Pin
CodeWraith26-Nov-19 5:44
MemberCodeWraith26-Nov-19 5:44 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 5:49
mvahoney the codewitch26-Nov-19 5:49 
JokeRe: Style and form in generated code Pin
Daniel Pfeffer26-Nov-19 6:15
professionalDaniel Pfeffer26-Nov-19 6:15 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 6:21
mvahoney the codewitch26-Nov-19 6:21 
GeneralRe: Style and form in generated code Pin
Jörgen Andersson26-Nov-19 6:53
communityengineerJörgen Andersson26-Nov-19 6:53 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 6:54
mvahoney the codewitch26-Nov-19 6:54 
GeneralRe: Style and form in generated code Pin
Jörgen Andersson26-Nov-19 6:58
communityengineerJörgen Andersson26-Nov-19 6:58 
GeneralRe: Style and form in generated code Pin
dywanex19226-Nov-19 9:07
Memberdywanex19226-Nov-19 9:07 
GeneralRe: Style and form in generated code Pin
  Forogar  26-Nov-19 6:04
professional  Forogar  26-Nov-19 6:04 
GeneralRe: Style and form in generated code Pin
Dan Neely26-Nov-19 6:17
MemberDan Neely26-Nov-19 6:17 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 6:20
mvahoney the codewitch26-Nov-19 6:20 
GeneralRe: Style and form in generated code Pin
Kornfeld Eliyahu Peter26-Nov-19 6:32
mveKornfeld Eliyahu Peter26-Nov-19 6:32 
GeneralRe: Style and form in generated code Pin
honey the codewitch26-Nov-19 6:34
mvahoney the codewitch26-Nov-19 6:34 
GeneralRe: Style and form in generated code Pin
#realJSOP26-Nov-19 8:03
mva#realJSOP26-Nov-19 8: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.