CheckStyle code review.



  • @boomzilla said:

    @blakeyrat said:
    The real point is that C# will compile a==b as a.Equals(b) if it needs to. So you don't need to know or care whether the string is, was, or could be interned.
    This is one of those things that sounds like a really convenient idea, but seems like it could lead to some hard to find "bugs." I'd assume that the compiler makes sure that a can't be null, which is the most obvious problem. It seems like there's little need to check for the actual same reference, though I suppose someone developing some sort of ORM might want to. I dunno. No doubt it saves waaaaay more sloppy coders than it burns, if any. Its biggest negative effect might just be that it clouds the understanding of what's actually going on in the minds of many C# developers.

    <FONT size=2 face=Consolas><FONT size=2 face=Consolas></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>string</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> a = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>null</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>;</FONT></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>string</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> b = </FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>""</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>;</FONT></FONT>

    <FONT size=2 face=Consolas><FONT size=2 face=Consolas>a == b;//false</FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>string</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.Equals(a, b);//false</FONT></FONT>

    <FONT size=2 face=Consolas>a.Equals(b);//NPE</FONT>

    <FONT size=2 face=Consolas></FONT> 

    <FONT size=2 face=Consolas>So really it's like it compiles to the second one. But what hard-to-find bug could this lead to?  If you want to do reference checking, you call string.ReferenceEquals, which certainly follows the principle of least surprise.</FONT>

    <FONT size=2 face=Consolas><FONT size=2 face=Consolas> 

    </FONT></FONT>


  • @boomzilla said:

    Its biggest negative effect might just be that it clouds the understanding of what's actually going on in the minds of many C# developers.

    It's an implementation detail. Developers don't need to know exactly what it's doing, no more than your website visitor needs to know whether the site is on Apache or IIS. Making implementation details irrelevant is a good thing.



  • @blakeyrat said:

    I missed the word "literal" on my first read-through, oops.

    I still think it could be rewritten to be clearer.

    Well, to be fair to them, it is in like every paragraph they have in the article, as well as them giving an example of how it's used...

  • ♿ (Parody)

    @Sutherlands said:

    But what hard-to-find bug could this lead to?  If you want to do reference checking, you call string.ReferenceEquals, which certainly follows the principle of least surprise.

    Obviously, I'm no .NET dev, and so I was assuming that == is the same as for Java, except that the compiler may pull a fast one on you. In fact, TFM says:

    For reference types other than string, == returns true if its two operands refer to the same object. For the string type, == compares the values of the strings.

    So, there is no problem and no compiler tricks. I've never heard of ReferenceEquals before (since, uh, I don't do .Net). Sheesh, that's the last time I believe something I read around here.



  • @boomzilla said:

    Sheesh, that's the last time I believe something I read around here.
    That'll learn ya.

    edit: Also, ReferenceEquals goes for all objects, not just strings.  The == operator can be overloaded for user-defined classes.

  • ♿ (Parody)

    @blakeyrat said:

    @boomzilla said:
    Its biggest negative effect might just be that it clouds the understanding of what's actually going on in the minds of many C# developers.

    It's an implementation detail. Developers don't need to know exactly what it's doing, no more than your website visitor needs to know whether the site is on Apache or IIS. Making implementation details irrelevant is a good thing.

    Well, it's not even an implementation detail. But the way it was described here mislead me (and I guess others didn't understand what was really happening, either) to think that it was one that could potentially have some problematic implications. Instead they flat out did the "natural" thing for strings. Which is a Good Thing, I think.



  • @UpNDown said:

    Most of these errors are there for a reason.  They're not pretty, but usually have some sense behind them. For instance, leading and trailing underscores have traditionally been reserved for code generators, or special system variables (LINE ?).  For code generators, it's so that they can pump out variables that don't conflict with the user's variables.


    Although note that it only allows underscore as the first character, and OP says it applies to all members of a class. That means that you can't follow the Java convention for static final variables of using all-caps with underscore to separate words.

    @boomzilla said:

    Obviously, I'm no .NET dev, and so I was assuming that == is the same as for Java, except that the compiler may pull a fast one on you. In fact, TFM says:

    For reference types other than string, == returns true if its two operands refer to the same object. For the string type, == compares the values of the strings.

    So, there is no problem and no compiler tricks. I've never heard of ReferenceEquals before (since, uh, I don't do .Net). Sheesh, that's the last time I believe something I read around here.


    How do you mean, "no compiler tricks"? TFM says that the compiler must have a special case for strings. Do special cases not count?



  • @pjt33 said:

    @belgariontheking said:
    Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag 'thrown'.
    Yeah, that's because you didn't import all the right libraries.  Error level.  Guess who's error?


    Are you sure? Looks to me like a badly formatted @throws tag which is confusing it about what is actually thrown. Is it looking for a class  thrown extends Exception, or is it a really badly worded error message?
    Actually I figured this one out today while taking with a coworker.  Here's the line involved:
      * @exception   thrown if an exception occurs during processing.
    CheckStyle is actually looking for an exception class called thrown.  It doesn't exist so it flagged it. It was tough to figure out cuz CheckStyle listed it as line 0, not the line of the comment.

    Doesn't seem like it should be error level, nor should any complaint about comments, but there you go.

     



  • @RHuckster said:

    Is there any way you can set options (especially for those silly things like regular expressions for property names, max return counts, and other arbitrary limits/standards)? I would think any descent code review application would let you set those kinds of things.
    Probably, but the test was run by some guy in India and he's got the limits all set to whatever the company wants.

    I'm tempted to save myself some time and run it myself before sending it back to him.  I'll see how difficult it is to set up CheckStyle to match the company's whininess.



  • @pjt33 said:

    How do you mean, "no compiler tricks"? TFM says that the compiler must have a special case for strings. Do special cases not count?
    Can you please point to me where TFM says that the compiler has a special case for strings?  (While you're looking for said text, remember that a function returning something different than another overload on a different object has nothing to do with the compiler.)



  • @powerlord said:

    If this is in a Servlet, you should be using HttpServletResponse.SC_FORBIDDEN (which I assume has the value 403 (since it's an int), but I haven't actually checked).  If this is in an outgoing connection, you should be using HttpURLConnection.HTTP_FORBIDDEN
    Didn't know about those.  I was about to declare it a static final in my class.  Thanks!



  • @pjt33 said:

    Although note that it only allows underscore as the first character, and OP says it applies to all members of a class. That means that you can't follow the Java convention for static final variables of using all-caps with underscore to separate words.
    It actually runs a different regex on finals.
    ConstantName

    • format: "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"
    I didn't think that was worth mentioning but maybe I should have.

     


  • ♿ (Parody)

    @Sutherlands said:

    @pjt33 said:
    How do you mean, "no compiler tricks"? TFM says that the compiler must have a special case for strings. Do special cases not count?

    Can you please point to me where TFM says that the compiler has a special case for strings?  (While you're looking for said text, remember that a function returning something different than another overload on a different object has nothing to do with the compiler.)

    The language definition says that strings are a special case for the equality operator. I have no clue how they implemented it, but following the language definition is different (in my book) to some sort of optimization or whatever to protect lazy coders (which was my original impression). If it were me, I'd just overload the operator, too, assuming the language allowed that. But that is, indeed an implementation detail.



  • @boomzilla said:

    @Sutherlands said:
    @pjt33 said:
    How do you mean, "no compiler tricks"? TFM says that the compiler must have a special case for strings. Do special cases not count?
    Can you please point to me where TFM says that the compiler has a special case for strings?  (While you're looking for said text, remember that a function returning something different than another overload on a different object has nothing to do with the compiler.)
    The language definition says that strings are a special case for the equality operator. I have no clue how they implemented it, but following the language definition is different (in my book) to some sort of optimization or whatever to protect lazy coders (which was my original impression). If it were me, I'd just overload the operator, too, assuming the language allowed that. But that is, indeed an implementation detail.
    I know, was saying to pjt33 that it wasn't a "compiler trick".  Here is how == is implemented (retrieved from Reflector)

    <FONT color=#1000a0>public</FONT> <FONT color=#1000a0>static</FONT> bool operator ==(string a, string b)
    {
        <FONT color=#1000a0>return</FONT> Equals(a, b);
    }
    
    It's only a special case because it's overloaded.


  • ♿ (Parody)

    @belgariontheking said:

    Actually I figured this one out today while taking with a coworker.  Here's the line involved:

      * @exception   thrown if an exception occurs during processing.

    CheckStyle is actually looking for an exception class called thrown.  It doesn't exist so it flagged it. It was tough to figure out cuz CheckStyle listed it as line 0, not the line of the comment.

    Doesn't seem like it should be error level, nor should any complaint about comments, but there you go.

    Hmm....that actually sounds incredibly useful for telling you when the comments have stopped matching the code, which is of course a major problem with comments. Not to say that they completely succeed, but definitely a non-WTF idea.


  • @TGV said:

    208 occurrencees of violating a regex (^[a-z_][a-zA-Z0-9]*$)

    That's a regexp that forbids underscores in names? Man, that's weird.

    Oh, underscores are allowed; you're only allowed to have *one* of them. At the beginning.  And you can't start a name with an uppercase or digit.  So every name *should* start with an underscore, to "use up" that special position that can't be an uppercase.

    Return count is 4 (max allowed is 3).

    Nothing like arbitrary limits on what code can do.  Warning level.

    Is this trying to limit shortcutting inside loops etc. with a return but still allow you to have a couple of returns like if(x) return foo; else return bar; or try-catch-finally? Why not say "No returns > 20 lines away from the bottom of the function"? Then, to be even more arbirtary, "No functions longer than 128 lines"?



  • @Sutherlands said:

    @pjt33 said:

    How do you mean, "no compiler tricks"? TFM says that the compiler must have a special case for strings. Do special cases not count?
    Can you please point to me where TFM says that the compiler has a special case for strings?  (While you're looking for said text, remember that a function returning something different than another overload on a different object has nothing to do with the compiler.)

     

    The section boomzilla quoted rather strongly implies that. In the light of your later post I'll amend that to say that TFM is badly written, and instead of

    @TFM said:

    For reference types other than string, == returns true if its two operands refer to the same object. For the string type, == compares the values of the strings.

    it should say @More accurate said:

    For reference types for which == is not overloaded, it returns true if its two operands refer to the same object. Note that == is overloaded for the string type to compare the values of the strings.



  • @pjt33 said:

    The section boomzilla quoted rather strongly implies that. In the light of your later post I'll amend that to say that TFM is badly written

     Actually I would suggest that people do not take things out of context... The documentation clearly states that. the material quoted is for Predefined Types and that

    User-defined value types can overload the == operator (see <font color="#1364c4">operator</font>). So can user-defined reference types, although by default == behaves as described above for both predefined and user-defined reference types. If == is overloaded, <font color="#1364c4">!=</font> must also be overloaded. Operations on integral types are generally allowed on enumeration.



  • @Qwerty said:

    Is this trying to limit shortcutting inside loops etc. with a return but still allow you to have a couple of returns like if(x) return foo; else return bar; or try-catch-finally? Why not say "No returns > 20 lines away from the bottom of the function"? Then, to be even more arbirtary, "No functions longer than 128 lines"?
    Of course there's a limit on how long a method can be.  Whachu think this is, tolerance camp?

    It's 150 (violated it 3 times).  Cyclomatic Complexity is limited to 25 (violated it 3 times -- can you guess where?), and a single line is limited to 150 characters (violated it 4 times).  Again, not mentioned because they're not really WTFs IMO. All of these are in my predecessor's code.

    In college, one of my professors wanted each method to be no longer than a printed page.  I think that's cutting it a bit short, but having single methods that run on for days just creates readability nightmares.  I think 150 is a nice somewhere in the middle number.  It gives me some freedom but if my method's longer than 150 lines, I know I'm doin it wrong.



  • @belgariontheking said:

    In college, one of my professors wanted each method to be no longer than a printed page.  I think that's cutting it a bit short, but having single methods that run on for days just creates readability nightmares.  I think 150 is a nice somewhere in the middle number.  It gives me some freedom but if my method's longer than 150 lines, I know I'm doin it wrong.

    FWIW, the guidline my company uses (and I wrote the guidelines) is that  method must fit on the screen in the IDE. The notable exception is "fall-through" methods, such as those used to initialize large structures which are not subject to any length restriction, but may contain nothing but a long seqwuence of "topologically equivilant" statements....

    By the time a method is longer than this (about 40-50 lines) tend to violate (please note the use of the words "tend to") single responsibility, and become difficult to test. One good indicator (again a generalization) of single responsibility, is if you can explain what the method does, to sufficient detail that another developer could implement it (given  the signature and context in addition) in a single sentance. If you need to use multiple sentances, odds are that you have multiple responsibilties taking place.



  • @belgariontheking said:

    150

    Right now I am perusing a Sun class in Java trying to trace out WhyTF it's bailing out of a HTTP authentication challenge. Specifically, the class is sun.net.www.protocol.http.HttpURLConnection. It's over 2800 lines long. Fortunately, the critical getInputStream() method is a mere 343 lines. Unfortunately, nearly every-other is mutating members, and the lines that aren't are calling other methods that mutate members, so it's still impossible to easily follow. Also, it mixes tabs and spaces, so that's cool tool. Nevertheless, I think I've figured out why it's not working: NTLM sucks.

    I am [i]this[/i] close to placing this broken authentication mechanism with a Perl script...



  • @TheCPUWizard said:

    FWIW, the guid(e)line my company uses (and I wrote the guidelines) is that (the) method must fit on the screen in the IDE.

    I use a 14-point font, you insensitive clod!



  • @blakeyrat said:

    I use a 14-point font, you insensitive clod!
     

    Exactly how fucked are your eyes? Mine are pretty fucked, and I use Consolas 11.




  • @dhromed said:

    Exactly how fucked are your eyes? Mine are pretty fucked, and I use Consolas 11.
    Rat vision is quite blurry.

     



  • @dhromed said:

    @blakeyrat said:

    I use a 14-point font, you insensitive clod!
    Exactly how fucked are your eyes? Mine are pretty fucked, and I use Consolas 11.

    It was just a joke!

    Cripes. I was just saying a "screen" is a not-very-useful measure, because it depends on the screen and on personal settings. You write code on a netbook, bam, suddenly your functions can barely hold a for() loop.

    But to answer your question, I just find it easier to read. I can read Consolas 11 fine, but I have a huge monitor and I like to slouch in my chair, so why not use 14-point? I also used to code in a variable-width font, but I don't anymore since there are finally some fixed-width fonts that don't look like ass. But my theory has been, "if you're doing something in your code that requires a space to be the same width as an 'm', you're doing it wrong."



  • @blakeyrat said:

    @TheCPUWizard said:
    FWIW, the guid(e)line my company uses (and I wrote the guidelines) is that (the) method must fit on the screen in the IDE.

    I use a 14-point font, you insensitive clod!

    Blakeyrat, that is why it is a guideline, and not a rule. I actually work with one developer who is completely blind [zero vision], and uses braille keyboard along with a screen reader; so I think you are overreaching with the name calling.

     Ironaically, it is only in recent times, that the size (about 50 lines) has actually matched what can "fit on a screen" pretty closely. EVen back when I was doing Pascal programming (30 years abou) the "50 line" guidline was in place, although that meant slightly over two screens.

     David

    ps: Of course, font size (as used with computers, rather than acutally measuring 1/72th of an inch) is somewhat meaningless since it is actually the distance to the screen and the arc (of the field of vision) that a given element covers which really matters. So there would be different font sizes on a 22" 1680x1050 than on an 92" 6720x4200 display [and yes, the latter was just announced, should ship in late 2012 and cost about $40K US]



  • @TheCPUWizard said:

    Blakeyrat, that is why it is a guideline, and not a rule. I actually work with one developer who is completely blind [zero vision], and uses braille keyboard along with a screen reader; so I think you are overreaching with the name calling.

    Did I enter a parallel universe where the concept of "humor" doesn't exist? WTF, people. Yah, it's a bad joke, but it's obviously a joke.



  • @blakeyrat said:

    @TheCPUWizard said:
    Blakeyrat, that is why it is a guideline, and not a rule. I actually work with one developer who is completely blind [zero vision], and uses braille keyboard along with a screen reader; so I think you are overreaching with the name calling.

    Did I enter a parallel universe where the concept of "humor" doesn't exist? WTF, people. Yah, it's a bad joke, but it's obviously a joke.

    I caught that. Personally I would have gone the "but I use centuple line spacing!" route.

    Oh, and maybe they're playing anti-humor on you?



  • @blakeyrat said:

    @TheCPUWizard said:
    Blakeyrat, that is why it is a guideline, and not a rule. I actually work with one developer who is completely blind [zero vision], and uses braille keyboard along with a screen reader; so I think you are overreaching with the name calling.
    Did I enter a parallel universe where the concept of "humor" doesn't exist? WTF, people. Yah, it's a bad joke, but it's obviously a joke.

    Ok, dude, when are you going to realize that most people in this forum have 0% sense of humor?  That is the prize you pay to work in IT, you lose your humanity and gain an insane ammount of knowlodge (of obscure and usually irrelevant stuff).

     



  • @blakeyrat said:

    Did I enter a parallel universe where the concept of "humor" doesn't exist?
     

    I don't understand what you're trying to say here, Blakeymouse!

    *strokes evil goatee*

    ===>  ;) ;) ;) ;) ;) ;) ;)

     

    Yeah, I get the font size. I like to slouch as well and my eyes are shit. My monitor is about 120dpi, and at 40-50cm with 1200px of width, Consolas 11 is perfect for me. I read some text-heavy sites at much bigger fontsizes than that.

    Re. variable width fonts: You're a funny man, Mr. Blakey. You lose every single alignment- and clarity-advantage that fixed-width code offers, and gain nothing but 10% shorter lines. But if it works for you, it works for you.



  • @serguey123 said:

    @blakeyrat said:

    @TheCPUWizard said:
    Blakeyrat, that is why it is a guideline, and not a rule. I actually work with one developer who is completely blind [zero vision], and uses braille keyboard along with a screen reader; so I think you are overreaching with the name calling.
    Did I enter a parallel universe where the concept of "humor" doesn't exist? WTF, people. Yah, it's a bad joke, but it's obviously a joke.

    Ok, dude, when are you going to realize that most people in this forum have 0% sense of humor?  That is the prize you pay to work in IT, you lose your humanity and gain an insane ammount of knowlodge (of obscure and usually irrelevant stuff).

    I realized it was intended as a joke...but... it was also a perfect case for where a "guideline" and a "rule" can differ.



  • @dhromed said:

    Re. variable width fonts: You're a funny man, Mr. Blakey. You lose every single alignment- and clarity-advantage that fixed-width code offers,

    Like... what?

    Developers use fixed-width fonts out of habit. Or because they have some insane fear of tab stops. There's no rational reason for it. But I'd love to hear you flail about trying to pull one out of your ass to justify this statement.

    @TheCPUWizard said:

    I realized it was intended as a joke...but... it was also a perfect case for where a "guideline" and a "rule" can differ.

    Obviously if I make a joke relating to "guidelines" vs. "rules" that must mean that I don't really understand the distinction, and thus must be educated! I mean, it's impossible to joke about a topic you understand!

    Geewhiz, Mr. Science, thanks for teaching us all a little bit about the fucking world! I thought this was a humor forum, not a hamfisted PBS children's show, but obviously I was mistaken!



  • @serguey123 said:

    @blakeyrat said:

    @TheCPUWizard said:
    Blakeyrat, that is why it is a guideline, and not a rule. I actually work with one developer who is completely blind [zero vision], and uses braille keyboard along with a screen reader; so I think you are overreaching with the name calling.
    Did I enter a parallel universe where the concept of "humor" doesn't exist? WTF, people. Yah, it's a bad joke, but it's obviously a joke.

    Ok, dude, when are you going to realize that most people in this forum have 0% sense of humor?  That is the prize you pay to work in IT, you lose your humanity and gain an insane ammount of knowlodge (of obscure and usually irrelevant stuff).

     

     

    A DEV who is BLIND... sorry since when did anyone employ a developer who cannot read directly his own code.................. who ever suggested employing this guy should be awarded the "This is a stupid suggestion but we may get a 'fair employer' suggestion" award

     



  • @Helix said:

    A DEV who is BLIND... sorry since when did anyone employ a developer who cannot read directly his own code.................. who ever suggested employing this guy should be awarded the "This is a stupid suggestion but we may get a 'fair employer' suggestion" award

     He does "read directly his own code", just uses a screen reader (audible into headsets).  He is the lead developer for a major (fortune 100 company) and if he ever became available I would not hesitate to hire him [if I could afford him] or give him the best recommendation possible.

    On the topic of screen readers, if anyone is developing an application for distribution [including within a corporate environment] then this should be part of normal testing.  I was contacted by one company last year who was facing bankrupcy becuase their flagship product failed ADA [Americans with Disabilities] testing, and was being forced out of use at thousands of client sites. I looked at "updating" the application, but it was way too far away from what is necessary, so they lost the sales, faced a lawsuit, laid off 80%+ of their staff. They will probably be totall gone within months, and this was a multi- $100M/yr company who simply didnt consider that not all people use displayes, keybords, mice...



  • @TheCPUWizard said:

    @Helix said:

    A DEV who is BLIND... sorry since when did anyone employ a developer who cannot read directly his own code.................. who ever suggested employing this guy should be awarded the "This is a stupid suggestion but we may get a 'fair employer' suggestion" award

    He does "read directly his own code", just uses a screen reader (audible into headsets). He is the lead developer for a major (fortune 100 company) and if he ever became available I would not hesitate to hire him [if I could afford him] or give him the best recommendation possible.

    It says it's a troll RIGHT ON THE POST!

    What's wrong with everybody in this thread!? Jesus. You could troll this thread with anything, it's sucker-central.

    If Hitler wrote code, he'd use Consolas 11pt! Blind people are only useful as sausage filling! Programmers are all big fat stinky-heads who smell like butts!



  • @blakeyrat said:

    @TheCPUWizard said:

    @Helix said:

    A DEV who is BLIND... sorry since when did anyone employ a developer who cannot read directly his own code.................. who ever suggested employing this guy should be awarded the "This is a stupid suggestion but we may get a 'fair employer' suggestion" award

    He does "read directly his own code", just uses a screen reader (audible into headsets). He is the lead developer for a major (fortune 100 company) and if he ever became available I would not hesitate to hire him [if I could afford him] or give him the best recommendation possible.

    It says it's a troll RIGHT ON THE TAGS!

    What's wrong with everybody in this thread!? Jesus. You could troll this thread with anything, it's sucker-central.

    If Hitler wrote code, he'd use Consolas 11pt! Blind people are only useful as sausage filling! Programmers are all big fat stinky-heads who smell like butts!

    FTFY, not everybody reads or see the tags (the email notification doesn't have it).

    I agree and endorse the programmers description btw



  • @serguey123 said:

    @blakeyrat said:

    @TheCPUWizard said:

    @Helix said:

    A DEV who is BLIND... sorry since when did anyone employ a developer who cannot read directly his own code.................. who ever suggested employing this guy should be awarded the "This is a stupid suggestion but we may get a 'fair employer' suggestion" award

    He does "read directly his own code", just uses a screen reader (audible into headsets). He is the lead developer for a major (fortune 100 company) and if he ever became available I would not hesitate to hire him [if I could afford him] or give him the best recommendation possible.

    It says it's a troll RIGHT ON THE TAGS!

    What's wrong with everybody in this thread!? Jesus. You could troll this thread with anything, it's sucker-central.

    If Hitler wrote code, he'd use Consolas 11pt! Blind people are only useful as sausage filling! Programmers are all big fat stinky-heads who smell like butts!

    FTFY, not everybody reads or see the tags (the email notification doesn't have it).

    I agree and endorse the programmers description btw

    And the sausage filling...  Mmmm, blindelicious...



  • @blakeyrat said:

    If Hitler wrote code, he'd use Consolas 11pt!
     

    Don't you dare insult my great-grandfather.



  • @dhromed said:

    @blakeyrat said:

    If Hitler wrote code, he'd use Consolas 11pt!
     

    Don't you dare insult my great-grandfather.

    Your great-grandfather was Consolas?



  • @blakeyrat said:

    Geewhiz, Mr. Science, thanks for teaching us all a little bit about the fucking world! I thought this was a humor forum, not a hamfisted PBS children's show, but obviously I was mistaken!
    mmmmmm... haaaaaaaam.



  • @blakeyrat said:

    Developers use fixed-width fonts out of habit. Or because they have some insane fear of tab stops. There's no rational reason for it. But I'd love to hear you flail about trying to pull one out of your ass to justify this statement.
     

    It's actually useful if you need to write files that are speced with things like "character 1&2 of the line are '01', characters 3-15 are ID number prefilled with 0s, characters 16-24 are..." but it's a really small thing.



  • @locallunatic said:

    @blakeyrat said:

    Developers use fixed-width fonts out of habit. Or because they have some insane fear of tab stops. There's no rational reason for it. But I'd love to hear you flail about trying to pull one out of your ass to justify this statement.
    It's actually useful if you need to write files that are speced with things like "character 1&2 of the line are '01', characters 3-15 are ID number prefilled with 0s, characters 16-24 are..." but it's a really small thing.

    Like I said above, if you're doing that in a code editor, you're doing something wrong. Spreadsheets exist.



  • @blakeyrat said:

    Like I said above, if you're doing that in a code editor, you're doing something wrong. Spreadsheets exist.
     

    How do I use a spreadsheet to build non-comma deliminated text files of data to feed mainframes?  I wish I could do it a different way, but for feeding the various constant contents it is a help to have it in the code editor.



  • @locallunatic said:

    @blakeyrat said:
    Like I said above, if you're doing that in a code editor, you're doing something wrong. Spreadsheets exist.
    How do I use a spreadsheet to build non-comma deliminated text files of data to feed mainframes? I wish I could do it a different way, but for feeding the various constant contents it is a help to have it in the code editor.

    GUIs have been around 20 years, nobody in the mainframe community has created a better UI than that? Not one person?

    This is why us developers with real (read: Windows or Linux) servers make fun of you.

    (Oh and BTW, spreadsheets can do that easily, its just not obvious. Import your columns into the spreadsheet, create a new column and put a formula in it to concatenate the others in the correct order, fill the formula down, then copy the new column into your text file to upload to the mainframe. I wager that's still a better solution than twisting a code editor to that purpose.)



  • @blakeyrat said:

    This is why us developers with real (read: Windows or Linux) servers make fun of you.
    Ha, you're funny...  Mainframes still, for the most part, run the world blakey.

    But I agree, I pity the fool who has to work with a mainframe...  Except of course those fortran security experts who make an ungodly amount of money.



  • @C-Octothorpe said:

    @blakeyrat said:
    This is why us developers with real (read: Windows or Linux) servers make fun of you.
    Ha, you're funny... Mainframes still, for the most part, run the world blakey.

    But I agree, I pity the fool who has to work with a mainframe... Except of course those fortran security experts who make an ungodly amount of money.

    And McDonalds runs the restaurant industry, that doesn't make them immune to mockery.



  • @blakeyrat said:

    @locallunatic said:
    @blakeyrat said:
    Like I said above, if you're doing that in a code editor, you're doing something wrong. Spreadsheets exist.
    How do I use a spreadsheet to build non-comma deliminated text files of data to feed mainframes? I wish I could do it a different way, but for feeding the various constant contents it is a help to have it in the code editor.

    GUIs have been around 20 years, nobody in the mainframe community has created a better UI than that? Not one person?

    This is why us developers with real (read: Windows or Linux) servers make fun of you.

    Unfortunately all I get to do is follow the spec to feed into an insurance company's machine, believe me I wish I could do it a different way.

    @blakeyrat said:

    (Oh and BTW, spreadsheets can do that easily, its just not obvious. Import your columns into the spreadsheet, create a new column and put a formula in it to concatenate the others in the correct order, fill the formula down, then copy the new column into your text file to upload to the mainframe. I wager that's still a better solution than twisting a code editor to that purpose.)

    The point is that the mono-spaced code editor makes it easier to keep things straight when the client pulls crap from the DB to put in said file, but also has to dump stupid constants through out.  Using the interop stuff in C# to get the client interfacing with Excel is at best a overly convoluted way of building these text files.



  • @blakeyrat said:

    @locallunatic said:
    @blakeyrat said:
    Like I said above, if you're doing that in a code editor, you're doing something wrong. Spreadsheets exist.
    How do I use a spreadsheet to build non-comma deliminated text files of data to feed mainframes? I wish I could do it a different way, but for feeding the various constant contents it is a help to have it in the code editor.
    GUIs have been around 20 years, nobody in the mainframe community has created a better UI than that? Not one person?

    Mainframes handle this issue quite easily.  IBM is more than happy to help you install WebSphere and build a web service that consumes the data.  However, 98% of the people that use mainframes will write the application in COBOL or RPG and only know how to read a fixed layout file.

    @blakeyrat said:

    Oh and BTW, spreadsheets can do that easily, its just not obvious. Import your columns into the spreadsheet, create a new column and put a formula in it to concatenate the others in the correct order, fill the formula down, then copy the new column into your text file to upload to the mainframe. I wager that's still a better solution than twisting a code editor to that purpose.)

    That work OK if you are doing it once.  However, if the a daily data feed comes in this format, you've got to parse it in some easily automated way.  Excel macros running on somebody's workstation doesn't count as automated, and Office on a server doesn't count as easy.



  • @locallunatic said:

    The point is that the mono-spaced code editor makes it easier to keep things straight when the client pulls crap from the DB to put in said file, but also has to dump stupid constants through out.  Using the interop stuff in C# to get the client interfacing with Excel is at best a overly convoluted way of building these text files.

    However, you should never need to see the text in your code editor.  When I have to do something like this, I usually use a good text editor to mock-up files for testing and then write a serializer/deserializer to work with them.  I've never found myself needing to see the layout in the source files.  Alt-tabbing over to the text editor is just fine.  Besides, Notepad++ allows me to select a region of text and it give me row and column information.


  • @Jaime said:

    That work OK if you are doing it once. However, if the a daily data feed comes in this format, you've got to parse it in some easily automated way. Excel macros running on somebody's workstation doesn't count as automated, and Office on a server doesn't count as easy.

    While I admit that is true, it still doesn't really address my shock that nobody in the mainframe development community has ever, in 20 years, attempted to build a better tool for this? Ever? It beggars belief-- what the hell are you people doing all day? Especially since it seems like the requirements would be pretty basic.


Log in to reply