DFA code generation
-
I used to generate c# switch case blocks that were about 2 or 3 pages long. Fun times. =) No, I won't post a sample - it's even uglier than it sounds. It also sometimes included "goto case" statements
danah gaz wrote:
No, I won't post a sample
Ok, I won't read your sample. :)
Life is a computer program and everyone is the programmer of his own life.
-
I used to generate c# switch case blocks that were about 2 or 3 pages long. Fun times. =) No, I won't post a sample - it's even uglier than it sounds. It also sometimes included "goto case" statements
-
Well it was either leave it or rewrite and debug a complex lexer by hand. The thing *worked perfectly* every single time, and was fast. It was just really, really ugly to look at. =) Also, I love that you're A Bastard Programmer from Hell. I used to read the Bastard Operator from Hell series when I was a kid. Loved it.
"The power cord?" I ask
"Yes... Woopsy"
"No worries at all" I say "Is it all working well now?"
"Yes, I think so. I'm sorry, you WERE right all along"
"Yes, we're getting a lot of this, it's due to the current Global Warming
problem. It causes random thermal expansion and contraction resulting in
temperature induced movement of friction based holding mechanisms.."I listen carefully. Nothing. In other words, <DUMMY MODE ON>...
"You can fix it permanently tho'" I say
"Really? How?"
"Well it's all to do with lowering salt deposits on the metal contacts"
"Oh!" (Dummy mode irrevocably engaged)
"All you need to do is just take the power plug out deposit some dilute mineral
salts on it. Do you have some dilute mineral salts on you?""Uh, no?"
"Ok, no worries, just stick it in your mouth drool into it. But make sure you
wipe the plug first to get rid of any germs, and TURN THE SWITCH OFF ON THE
MONITOR before you do - we don't want a nasty accident!"Oh. Ok!"
Fzzzt< >clunk!<
I hang up as the receiver hits the floor. Disk space is too good for them.
:-D
-
Well it was either leave it or rewrite and debug a complex lexer by hand. The thing *worked perfectly* every single time, and was fast. It was just really, really ugly to look at. =) Also, I love that you're A Bastard Programmer from Hell. I used to read the Bastard Operator from Hell series when I was a kid. Loved it.
"The power cord?" I ask
"Yes... Woopsy"
"No worries at all" I say "Is it all working well now?"
"Yes, I think so. I'm sorry, you WERE right all along"
"Yes, we're getting a lot of this, it's due to the current Global Warming
problem. It causes random thermal expansion and contraction resulting in
temperature induced movement of friction based holding mechanisms.."I listen carefully. Nothing. In other words, <DUMMY MODE ON>...
"You can fix it permanently tho'" I say
"Really? How?"
"Well it's all to do with lowering salt deposits on the metal contacts"
"Oh!" (Dummy mode irrevocably engaged)
"All you need to do is just take the power plug out deposit some dilute mineral
salts on it. Do you have some dilute mineral salts on you?""Uh, no?"
"Ok, no worries, just stick it in your mouth drool into it. But make sure you
wipe the plug first to get rid of any germs, and TURN THE SWITCH OFF ON THE
MONITOR before you do - we don't want a nasty accident!"Oh. Ok!"
Fzzzt< >clunk!<
I hang up as the receiver hits the floor. Disk space is too good for them.
:-D
-
I used to generate c# switch case blocks that were about 2 or 3 pages long. Fun times. =) No, I won't post a sample - it's even uglier than it sounds. It also sometimes included "goto case" statements
danah gaz wrote:
It also sometimes included "goto case" statements
As well it should.
-
danah gaz wrote:
It also sometimes included "goto case" statements
As well it should.
-
I used to generate c# switch case blocks that were about 2 or 3 pages long. Fun times. =) No, I won't post a sample - it's even uglier than it sounds. It also sometimes included "goto case" statements
danah gaz wrote:
It also sometimes included "goto case" statements
I dont get why devs hate goto so much, I dont use it but its not that bad.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
-
danah gaz wrote:
It also sometimes included "goto case" statements
I dont get why devs hate goto so much, I dont use it but its not that bad.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
----------------------------------------------- 128 bit encrypted signature, crack if you can
It's not wrong as such, but using it breaks control flow (such as gotoing out of a loop, or worse, into another loop) and can contribute to maintenance issues and general spaghetti code. Obviously maintenance isn't really an issue for autogenerated code - as long as you have the tool that generates it whenever you are modifying the source file that creates it, but it is just offensive to one's sensibilities to look at modern code full of goto statements.