Max length of code snippet?

  • Thread starter Thread starter Clive Dixon
  • Start date Start date
C

Clive Dixon

Is there a maximum length for a code snippet? I have created quite a long
one (> 170 lines), which when I use it to generate code, it only generates
around the first 170 lines of the snippet.
 
Is there a maximum length for a code snippet? I have created quite a long
one (> 170 lines), which when I use it to generate code, it only generates
around the first 170 lines of the snippet.

Do you really have over 170 lines of code which you need to include
verbatim on a regular basis? I'd get really worried if I started seeing
that much code in multiple places.
 
Well yes, so would I, but I am having to deal with badly designed legacy
code - my attempts to refactor by 'genericising' can unfortunately only go
so far and there are still large areas where it's frankly easiest to plonk a
large code snippet in when creating a new class for a certain purpose in the
system. Thus far we've had to create by hand... (The classes use an
underlying corresponding set of auto-generated classes which severely limits
the amount of generic code which can be created, and it's far far too risky
to do anything to change that autogenerated code right now, believe me. I
wish I could, but I have to work with what I've got.)

Anyway, found my problem: I had a double $ in the code snippet where there
was a replacement token, which stopped the snippet generation in its tracks.
 
Well yes, so would I, but I am having to deal with badly designed legacy
code - my attempts to refactor by 'genericising' can unfortunately only go
so far and there are still large areas where it's frankly easiest to plonk a
large code snippet in when creating a new class for a certain purpose in the
system. Thus far we've had to create by hand... (The classes use an
underlying corresponding set of auto-generated classes which severely limits
the amount of generic code which can be created, and it's far far too risky
to do anything to change that autogenerated code right now, believe me. I
wish I could, but I have to work with what I've got.)

Anyway, found my problem: I had a double $ in the code snippet where there
was a replacement token, which stopped the snippet generation in its
tracks.

Ah, right. Wow, that does sound like a grim situation :(
 
Back
Top