• (cs) in reply to hoodaticus
    hoodaticus:
    Procedural coders should be banned from .NET development.

    When Visual Studio starts up, it should require you to implement an OO design pattern in a mini-game. If you win, Visual Studio won't uninstall itself, delete all your projects, and revoke your license.

    Or better yet, Haskell gets installed if you lose. Let the punishment fit the crime. If you only write procedural code, you get a language where it's painful to write procedural code.

  • (cs) in reply to eVil
    eVil:
    The Great Lobachevsky:
    Yeah, there aren't any women in computers, right? At least any that know JavaScript. ;-)

    Got to the right websites, and you'll find your computer is chock-full of them. They generally naked and licking each other though, so I doubt they have much time for JavaScript.

    The ones I found actually use "JavaScript" as a safeword. Go figure.

  • Haters Gonna Hate (unregistered)
    "In a strictly object oriented environment like C#/.NET," writes J.D., "there's really no such thing as 'global variables'

    TRWTF.

  • foo (unregistered) in reply to Some damn Yank
    Some damn Yank:
    This board quotes everything for you. How did you manage to mess it up?
    It's actually easy. When you want to delete parts of a quote (to avoid pointless full-quotes) or insert text between quoted parts (like this one), you have to mess with the quoting tags.
    Some damn Yank:
    Whatever you did even messed up my quoting of you!
    Blame the forum software. Whenever there's any kind of tag mismatch, it fails to do any quoting. Of course, that's TRWTF, since if it can check it at render time, it could easily verify it before submission and reject invalidly formed comments.

    CAPTCHA: damnum (I don't normally do this, but this is one is so appropriate ...)

  • Andrew (unregistered) in reply to Andreas
    Andreas:
    The next WTF is that you do not need to initialize out-parameters before calling a method. You cannot access the values inside the method anyway.

    +10pts!

    Plus those out parameters need to be assigned to within the method call. So whatever you assign to those initialized parameters are going to be overwritten anyway.

  • (cs) in reply to Nagesh
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
  • Foodge Eeat (unregistered) in reply to z00n3s!$
    z00n3s!$:
    C-Octothorpe:
    The Great Lobachevsky:
    Yeah, there aren't any women in computers, right? At least any that know JavaScript. ;-)
    I don't have any in my computer, but I've got a couple in my trunk, if that counts for anything...
    Like to keep mobile, do ya?

    I found carrying around the whole bodies to be too much work (and too likely to be discovered) so I just cut off the parts I actually use and carry them around in my briefcase.

    You clearly fail to see the utility during those long vacations. Backwood log cabins aren't generally furnished with dishwashers. Besides, someone has to chop the firewood and fetch the chilled beer from the lake.

  • Randy Snicker (unregistered)

    I feel I should point out that 22,000 is not actually a range.

  • (cs) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Or better yet, Haskell gets installed if you lose. Let the punishment fit the crime. If you only write procedural code, you get a language where it's painful to write procedural code.
    Like!

    It would also be cool if it compiled all your projects to native assembly with NGEN, then deleted all the source.

    You want procedural? Here, have some MSASM.

  • SeySayux (unregistered)

    Obviously, the correct solution is...

    template<class... T>
    void pass(function<void(T&...)> a, function<void(T...)> b) {
         tuple<T...> t;
         unpack(a,t);
         unpack(b,t);
    }
    

    Tuples + unpack ftw!

  • Anketam (unregistered)

    Then you find out the coder's bonus was tied to the amount of SLOC he created.

  • anonymouser (unregistered) in reply to Mort
    Mort:
    ObiWayneKenobi:
    Don't get me wrong. I think static methods have their uses, typically in what DDD people call the "Service" - components that *only* do input/output on something, but aren't directly related to any one entity or domain concept.

    That said even then I would prefer to use instance methods to use Dependency Injection/IoC, but having a static class that acts as a "broker" or possibly as a Factory pattern implementation is okay with me. I've used static methods in Factories that simply construct a domain object from some type of raw data.

    Having a single file with half a dozen classes inside that file, all of which have static methods, however, is blasphemy and anyone who does it should be fired immediately for being a clueless Mort; it shows not only no understanding of OOP but no understanding of component design.

    Huh?
    Just go ask Elvis; he loves to show off his knowledge.

    BTW, nice obscure reference.

  • DOS ex Machina (unregistered)

    I read that last line as:

    22,000 lines-of-code rage
    and thought, "yeah, sounds about right."
  • evertras (unregistered)

    This one hits really close to home. Recent paraphrased error I had while tweaking some code:

    Error: No overloaded version of method SomeMethod has 43 parameters.

    I was missing one. :(

  • Nagesh (unregistered) in reply to hoodaticus
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    Not being troll!!! Please be ignoring my impostar!!!
    1. IoC alowing you to write coding without knowing who to be axes your clases to insert dependencies.
    2. Inserted dependencies needing to be done directly without mediation by Objecs receiving external needs.
    3. Primatives not eligibal for inserting.
    4. Nor statics.
    5. No more to be said.
  • ted (unregistered) in reply to Nagesh
    Nagesh:
    4. drinking cofee stimulate brian cells.
    I didn't even click on the link and knew it was some fag linking bbc. It's not clever. It's not funny. Just the word "cofee" with a link under it and the short, useless, one sentence point was all I needed to know that you were linking the article where the scientists iteratively one-up each other on how they stimulate brain cells.

    It was funny to read when it came out. It's even funny when clicking on the Random button on the site and seeing it. It's NOT funny when someone links to it from a one-sentence post and thinks they're so fucking clever to have discovered bbc.

    You probably still use lmgtfy and think you're so damn clever.

    It means in real life, you're an unoriginal hipster doofus.

    Got anything to do with sanitizing inputs to a SQL database, etc.? Link to Computer Security. Got a nerd-project slow-ass turing machine? Like a minecraft logic circuit from redstone? Link to the one where it's some guy alone in the Alaska making a firepit out of rocks. Got a story about Guantanamo? Link to the one where they beat the password out of the guy with a wrench.

    Fuck off. You're not clever.

  • (cs) in reply to hoodaticus
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    "Troll"? You give it too much credit. N*g*sh is just a troll script (I'm betting Bourne shell). The repetitiveness and lack of imagination are clues.
  • Master and Commander of the Troll Amry (unregistered) in reply to D-Coder
    D-Coder:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    "Troll"? You give it too much credit. N*g*sh is just a troll script (I'm betting Bourne shell). The repetitiveness and lack of imagination are clues.
    Nagesh (unregistered) is no troll. It's a troll parody.
  • (cs) in reply to Nagesh
    Nagesh:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    Not being troll!!! Please be ignoring my impostar!!!
    1. IoC alowing you to write coding without knowing who to be axes your clases to insert dependencies.
    2. Inserted dependencies needing to be done directly without mediation by Objecs receiving external needs.
    3. Primatives not eligibal for inserting.
    4. Nor statics.
    5. No more to be said.
    That's a lot of amazingly irrelevant drivel. The only thing a language needs to do IoC is function pointers.
  • (cs) in reply to Master and Commander of the Troll Amry
    Master and Commander of the Troll Amry:
    D-Coder:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    "Troll"? You give it too much credit. N*g*sh is just a troll script (I'm betting Bourne shell). The repetitiveness and lack of imagination are clues.
    Nagesh (unregistered) is no troll. It's a troll parody.
    Can't be. Parodies are supposed to be funny.
  • (cs) in reply to D-Coder
    D-Coder:
    Master and Commander of the Troll Amry:
    Nagesh (unregistered) is no troll. It's a troll parody.
    Can't be. Parodies are supposed to be funny.
    Ba-ZING!
  • Master and Commander of the Troll Amry (unregistered) in reply to D-Coder
    D-Coder:
    Master and Commander of the Troll Amry:
    D-Coder:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    "Troll"? You give it too much credit. N*g*sh is just a troll script (I'm betting Bourne shell). The repetitiveness and lack of imagination are clues.
    Nagesh (unregistered) is no troll. It's a troll parody.
    Can't be. Parodies are supposed to be funny.
    Correct. http://en.wikipedia.org/wiki/Scary_Movie_%28film_series%29 But isn't a troll attempt also supposed to be non-obvious?
  • (cs) in reply to Master and Commander of the Troll Amry
    Master and Commander of the Troll Amry:
    D-Coder:
    Master and Commander of the Troll Amry:
    D-Coder:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    "Troll"? You give it too much credit. N*g*sh is just a troll script (I'm betting Bourne shell). The repetitiveness and lack of imagination are clues.
    Nagesh (unregistered) is no troll. It's a troll parody.
    Can't be. Parodies are supposed to be funny.
    Correct. http://en.wikipedia.org/wiki/Scary_Movie_%28film_series%29 But isn't a troll attempt also supposed to be non-obvious?
    And therein lies the rub: is it a real person who is stupid or inexperienced, or a troll, or a troll trolling a troll, or a troll who is trolling the troll but doesn't know he's getting trolled, ad nauseum, or some retard who thinks he's funny or clever who keeps repeating the same vomitastic TDWTF "meme", which is really a meta-meme...

    Ah fuck it, I give up!

  • Nagesh (unregistered) in reply to hoodaticus
    hoodaticus:
    Nagesh:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    Not being troll!!! Please be ignoring my impostar!!!
    1. IoC alowing you to write coding without knowing who to be axes your clases to insert dependencies.
    2. Inserted dependencies needing to be done directly without mediation by Objecs receiving external needs.
    3. Primatives not eligibal for inserting.
    4. Nor statics.
    5. No more to be said.
    That's a lot of amazingly irrelevant drivel. The only thing a language needs to do IoC is function pointers.
    Spring is to be providing instantiation of clases only.
  • (cs) in reply to Nagesh
    Nagesh:
    hoodaticus:
    Nagesh:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    Not being troll!!! Please be ignoring my impostar!!!
    1. IoC alowing you to write coding without knowing who to be axes your clases to insert dependencies.
    2. Inserted dependencies needing to be done directly without mediation by Objecs receiving external needs.
    3. Primatives not eligibal for inserting.
    4. Nor statics.
    5. No more to be said.
    That's a lot of amazingly irrelevant drivel. The only thing a language needs to do IoC is function pointers.
    Spring is to be providing instantiation of clases only.
    Are we absolutely sure we can't IP ban this guy?
  • (cs) in reply to hoodaticus
    hoodaticus:
    Nagesh:
    hoodaticus:
    Nagesh:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    Not being troll!!! Please be ignoring my impostar!!!
    1. IoC alowing you to write coding without knowing who to be axes your clases to insert dependencies.
    2. Inserted dependencies needing to be done directly without mediation by Objecs receiving external needs.
    3. Primatives not eligibal for inserting.
    4. Nor statics.
    5. No more to be said.
    That's a lot of amazingly irrelevant drivel. The only thing a language needs to do IoC is function pointers.
    Spring is to be providing instantiation of clases only.
    Are we absolutely sure we can't IP ban this guy?
    Fake and unregistrd nagesh is geting on my nerves. Alex, I vote to ban him imediately at once.
  • (cs) in reply to hoodaticus
    hoodaticus:
    PedanticCurmudgeon:
    Or better yet, Haskell gets installed if you lose. Let the punishment fit the crime. If you only write procedural code, you get a language where it's painful to write procedural code.
    Like!

    It would also be cool if it compiled all your projects to native assembly with NGEN, then deleted all the source.

    You want procedural? Here, have some MSASM.

    Or Forth, Befunge, Chef (for the sheer amount of typing needed to get anything done), or Piet for the artistically inclined. There's all kinds of languages we can use to punish the clueless.

  • Nagesh (unregistered) in reply to Nagesh
    Nagesh:
    hoodaticus:
    Nagesh:
    hoodaticus:
    Nagesh:
    hoodaticus:
    Nagesh:
    IoC is best OO patern in existance, but I think imposible in C.
    This would be fun to respond to if you weren't a troll.
    Not being troll!!! Please be ignoring my impostar!!!
    1. IoC alowing you to write coding without knowing who to be axes your clases to insert dependencies.
    2. Inserted dependencies needing to be done directly without mediation by Objecs receiving external needs.
    3. Primatives not eligibal for inserting.
    4. Nor statics.
    5. No more to be said.
    That's a lot of amazingly irrelevant drivel. The only thing a language needs to do IoC is function pointers.
    Spring is to be providing instantiation of clases only.
    Are we absolutely sure we can't IP ban this guy?
    Fake and unregistrd nagesh is geting on my nerves. Alex, I vote to ban him imediately at once.

    MATTERHORN!!! I'm telling you for last time stoping to be haking my acount!

  • (cs) in reply to hoodaticus
    hoodaticus:
    ObiWayneKenobi:
    Don't get me wrong. I think static methods have their uses, typically in what DDD people call the "Service" - components that *only* do input/output on something, but aren't directly related to any one entity or domain concept.

    That said even then I would prefer to use instance methods to use Dependency Injection/IoC, but having a static class that acts as a "broker" or possibly as a Factory pattern implementation is okay with me. I've used static methods in Factories that simply construct a domain object from some type of raw data.

    Having a single file with half a dozen classes inside that file, all of which have static methods, however, is blasphemy and anyone who does it should be fired immediately for being a clueless Mort; it shows not only no understanding of OOP but no understanding of component design.

    +5. It's not statics that are evil. It's the exclusive use of stateless classes to prove true the axiom "You can do FORTRAN in any language."

    That's why FORTRAN is such a wonderful language. Thank you for your continued support for an unfairly maligned language.

  • (cs) in reply to ObiWayneKenobi
    ObiWayneKenobi:
    Don't get me wrong. I think static methods have their uses, typically in what DDD people call the "Service" - components that *only* do input/output on something, but aren't directly related to any one entity or domain concept.

    That said even then I would prefer to use instance methods to use Dependency Injection/IoC, but having a static class that acts as a "broker" or possibly as a Factory pattern implementation is okay with me. I've used static methods in Factories that simply construct a domain object from some type of raw data.

    Having a single file with half a dozen classes inside that file, all of which have static methods, however, is blasphemy and anyone who does it should be fired immediately for being a clueless Mort; it shows not only no understanding of OOP but no understanding of component design.

    You don't know fucking shit, you prick.

  • Mr Keith (unregistered) in reply to JayC
    JayC:
    frits:
    Well duh. Everybody knows that using bools is short-sighted. That method should return a enumeration like the following:
    public enum TestResult
    {
       Passed,
       Failed,
       Aborted //Never used
    };
    
    (this line is needed for the freaking quotes to work)

    SQL Databases are BASED on three valued logic, and the semantics are not much different than above (NULL often better read as UNKNOWN). There are times you really want three values, and there are times where you'd rather merge the "null" case with one of the other two. Nullable booleans are useful for this as well. However, I've honestly never tried && with Nullable booleans to see if they could follow the three valued logic truth tables much as they do for SQL (well, some versions of SQL, look at http://en.wikipedia.org/wiki/Null_(SQL)).

    SET ANSI_NULLS ON, eh? If we're to be droll about null, are in the camp of EF Codd or Chris Date?

  • (cs) in reply to Global
    Global:
    Globalization is the future Frist

    I agree. We need to create a new class named "World" that everyone can put all their variables into. That way, we can have things like initrodeCounter and acmeCounter for "privacy".

    That way, if Initrode and Acme are having a competitive war they can tweak each other's variables.

    It would be the ultimate in globalization.

  • z00n3s!$ (unregistered) in reply to C-Octothorpe
    C-Sucktothroat:
    And therein lies the nub: is it a real person who is stupid or inexperienced, or a gimp, or a gimp whipping a gimp, or a gimp who is whipping the gimp but doesn't know he's getting fucked, ad nauseum, or some retard who thinks he's funny or clever who keeps repeating the same vomitastic TDWTF "meme", which is really a meta-meme...

    Ah fuck me! I give my ass up to you!

    CAPTCHA: inhibeo - The internet does the inhibeo for my brain.

  • (cs) in reply to Coyne
    Coyne:
    Global:
    Globalization is the future Frist

    I agree. We need to create a new class named "World" that everyone can put all their variables into. That way, we can have things like initrodeCounter and acmeCounter for "privacy".

    That way, if Initrode and Acme are having a competitive war they can tweak each other's variables.

    It would be the ultimate in globalization.

    That's about the only thing that could get me to join the patchouli-soaked communist anarchists (WTF?) in protesting the G-8 meetings.

  • (cs) in reply to hoodaticus
    hoodaticus:
    Coyne:
    Global:
    Globalization is the future Frist

    I agree. We need to create a new class named "World" that everyone can put all their variables into. That way, we can have things like initrodeCounter and acmeCounter for "privacy".

    That way, if Initrode and Acme are having a competitive war they can tweak each other's variables.

    It would be the ultimate in globalization.

    That's about the only thing that could get me to join the patchouli-soaked communist anarchists (WTF?) in protesting the G-8 meetings.

    Glad I could help you realize just how bad globalization could be.

  • (cs) in reply to hoodaticus
    hoodaticus:
    ObiWayneKenobi:
    If it's not a class with nothing but static methods (used in moderation that's fine, all over the place not so much)
    I wouldn't permit static classes unless there is a damn good justification. Too many people in the hiring pool need to be deprived of their crutch if they are to learn anything.

    Yes, because

    Math m = new Math();
    m.setArgument1(5.0);
    m.setArgument2(7.0);
    m.doF();
    double result = m.getResult();
    

    Is so mucht better than

    double result = Math.f(5.0, 7.0);
    

    Static classes are perfect for methods that can be easily grouped, but aren't (logically) part of a class/object.

    Ofcourse in this example one could also argue that f() should be part of a class, but the function might be much broader than a specific class (e.g. fourier transformation just to give an example, but it might even be calculateTaxRate()).

  • (cs) in reply to dtech
    dtech:
    hoodaticus:
    ObiWayneKenobi:
    If it's not a class with nothing but static methods (used in moderation that's fine, all over the place not so much)
    I wouldn't permit static classes unless there is a damn good justification. Too many people in the hiring pool need to be deprived of their crutch if they are to learn anything.

    Yes, because

    Math m = new Math();
    m.setArgument1(5.0);
    m.setArgument2(7.0);
    m.doF();
    double result = m.getResult();
    

    Is so mucht better than

    double result = Math.f(5.0, 7.0);
    

    Static classes are perfect for methods that can be easily grouped, but aren't (logically) part of a class/object.

    Ofcourse in this example one could also argue that f() should be part of a class, but the function might be much broader than a specific class (e.g. fourier transformation just to give an example, but it might even be calculateTaxRate()).

    I'm pretty sure that's what he meant by "damn good justification".

    Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.
    Me.
  • (cs) in reply to dtech
    dtech:
    hoodaticus:
    ObiWayneKenobi:
    If it's not a class with nothing but static methods (used in moderation that's fine, all over the place not so much)
    I wouldn't permit static classes unless there is a damn good justification. Too many people in the hiring pool need to be deprived of their crutch if they are to learn anything.

    Yes, because

    Math m = new Math();
    m.setArgument1(5.0);
    m.setArgument2(7.0);
    m.doF();
    double result = m.getResult();
    

    Is so mucht better than

    double result = Math.f(5.0, 7.0);
    

    Static classes are perfect for methods that can be easily grouped, but aren't (logically) part of a class/object.

    Ofcourse in this example one could also argue that f() should be part of a class, but the function might be much broader than a specific class (e.g. fourier transformation just to give an example, but it might even be calculateTaxRate()).

    A complex number class would naturally have as methods all mathematical operations that can be performed on them. But in practice, I agree with your example and would make f() an extension method of double[], which is the exact same thing as using a static class.

    As with scripture, no rule I propose applies to good programmers: they don't need them any more; they graduated. But the juniors we have to hire need to be banned from using static classes and instead forced, kicking and screaming, into OO. Otherwise they will never learn it.

    I have seen developers with tremendous potential do .NET with static classes. It's like they're standing at the threshhold of becoming advanced devs, but they never take that last step. They just stagnate for years. It's tragic.

    Take away the crutches and teach them to run.

  • (cs) in reply to frits
    frits:
    C-Octothorpe:
    Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.
    Me.
    Me. Unless you count extension methods. I haven't yet met a dev who used extension methods to avoid OOP, though.

    Addendum (2011-09-28 16:02): In fact, the presence of a Util class is a huuuuuge warning sign that I'm gonna be teaching OOP in the near future.

  • (cs) in reply to hoodaticus
    hoodaticus:
    frits:
    C-Octothorpe:
    Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.
    Me.
    Me.
    Really? Why not?

    If you have several methods that are related, lets say they interact with active directory, but don't require any kind of state, where would you put them?

    EDIT: and don't say extension methods because that's just cheating.

  • talentless_newbie (too lazy to log in properly) (unregistered)

    Even if the original coder came from a purely procedural background (and I admit, I did, too), surely it should have occurred to them to wrap all of those into a structure, one would think.

    If you have 45 'out' parameters in one method, if you don't at least wonder whether there is a better way pass around and manipulate stuff, you should give up and go back to being an enduser.

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    hoodaticus:
    frits:
    C-Octothorpe:
    Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.
    Me.
    Me.
    Really? Why not?

    If you have several methods that are related, lets say they interact with active directory, but don't require any kind of state, where would you put them?

    EDIT: and don't say extension methods because that's just cheating.

    As it turns out, I have just such an ActiveDirectory class. It's (almost) a singleton and only has methods on it that pertain to the directory itself. The instance contains other objects, such as ActiveDirectoryUserCollection, which self-updates in the background until the AppDomain unloads.

    There is a static method called GetTrustedDomain(string) which returns a similar ActiveDirectory object for a domain other than the one the host is on, which will have its own ActiveDirectoryUserCollection and on and on.

    Can your static methods compete with that?

    If I want to look up a user in AD, I do this:

    var user = ActiveDirectory.Users[username];

    Now I have a user object and can do this:

    foreach (var message in user.GetInbox().GetMessages()) {}

    or

    user.GetIsAuthentic(password);

  • (cs) in reply to Nagesh
    Nagesh:
    Solution! With help of collegue, I am geting farther on problum. Changing "bool" to Java type, I guet insted: Test.java:1: class, interface, or enum expected public Boolian DoQualityControlChecksPass( ^ Test.java:29: class, interface, or enum expected public string GetQCRuleFailuresText( ^ Test.java:55: class, interface, or enum expected bool replInsurRateInRange = false; ^ Test.java:56: class, interface, or enum expected decimal actualReplInsRate = -1.0m; ^ Test.java:57: class, interface, or enum expected bool rentalYieldInRange = false; ^ Test.java:58: class, interface, or enum expected decimal actualRentalYield = -1.0m; ^ Test.java:59: class, interface, or enum expected bool propValUnderMax = false; ^ Test.java:60: class, interface, or enum expected decimal actualPropValue = -1.0m; ^ Test.java:61: class, interface, or enum expected bool livingAreaInRange = false; ^ Test.java:62: class, interface, or enum expected double actualLivingArea = -1.0d; ^ Test.java:63: class, interface, or enum expected bool riskRatingsAllUnder4 = false; ^ Test.java:64: class, interface, or enum expected bool riskRatingsHave3OrMoreOver3 = false; ^ Test.java:65: class, interface, or enum expected bool twoTierMktIsNo = false; ^ Test.java:66: class, interface, or enum expected string actualTierMkt = null; ^ Test.java:67: class, interface, or enum expected bool mktValEqualsContrPrice = false; ^ Test.java:68: class, interface, or enum expected decimal actualContractPrice = -1.0m; ^ Test.java:69: class, interface, or enum expected bool mktValVarianceFromEMVInRange = false; ^ Test.java:70: class, interface, or enum expected decimal actualEMV = -1.0m; ^ Test.java:71: class, interface, or enum expected bool valDateNotInFuture = false; ^ Test.java:72: class, interface, or enum expected DateTime actualValuationDate = DateTime.MinValue; ^ Test.java:73: class, interface, or enum expected bool intCondWordsNotFound = false; ^ Test.java:74: class, interface, or enum expected List<string> intCondWordsFound = null; ^ Test.java:75: class, interface, or enum expected bool extCondWordsNotFound = false; ^ Test.java:76: class, interface, or enum expected List<string> extCondWordsFound = null; ^ Test.java:77: class, interface, or enum expected bool essRepairsWordsNotFound = false; ^ Test.java:78: class, interface, or enum expected List<string> essRepairsWordsFound = null; ^ Test.java:79: class, interface, or enum expected bool commentsWordsNotFound = false; ^ Test.java:80: class, interface, or enum expected List<string> commentsWordsFound = null; ^ Test.java:81: class, interface, or enum expected bool salesCountCorrect = false; ^ Test.java:82: class, interface, or enum expected bool salesPricesInRange = false; ^ Test.java:83: class, interface, or enum expected bool salesNotTooOld = false; ^ Test.java:84: class, interface, or enum expected bool minReqSalesInSameSuburb = false; ^ Test.java:85: class, interface, or enum expected List<int> invalidSalesIDs = null; ^ Test.java:86: class, interface, or enum expected bool sameValAndValValidDate = false; ^ Test.java:87: class, interface, or enum expected bool sameTenderPriceAndCheckCost = false; ^ Test.java:88: class, interface, or enum expected bool latestSaleGreaterThanValAmount = false; ^ Test.java:89: class, interface, or enum expected bool strataEqualsStratum = false; ^ Test.java:90: class, interface, or enum expected List<string> falseSecuritisationFields = null; ^ Test.java:92: class, interface, or enum expected string qcResultText = null; ^ Test.java:93: class, interface, or enum expected bool qcRes = false; ^ Test.java:94: class, interface, or enum expected bool currentUseIsResidential = true; ^ Test.java:95: class, interface, or enum expected string currentUseNotAsResidential = string.Empty; ^ Test.java:96: class, interface, or enum expected bool impValRateInRange = true; ^ Test.java:97: class, interface, or enum expected decimal impValRate = 0; ^ Test.java:98: class, interface, or enum expected bool landValRateInRange = true; ^ Test.java:99: class, interface, or enum expected decimal landValRate = 0; ^ Test.java:101: class, interface, or enum expected try ^ Test.java:127: class, interface, or enum expected "Of course, since the variable declaration isn't always consistent in the dozen or so places this method is called, the DoQualityControlChecksPass method re-initializes all parameters anyway." ^ Test.java:130: class, interface, or enum expected replInsurRateInRange = true; ^ Test.java:131: class, interface, or enum expected actualReplInsRate = 0m; ^ Test.java:132: class, interface, or enum expected rentalYieldInRange = true; ^ Test.java:133: class, interface, or enum expected actualRentalYield = 0m; ^ Test.java:134: class, interface, or enum expected propValUnderMax = true; ^ Test.java:135: class, interface, or enum expected actualPropValue = 0m; ^ Test.java:136: class, interface, or enum expected decimal actualImpValue = 0m; ^ Test.java:137: class, interface, or enum expected decimal actualLandValue = 0m; ^ Test.java:138: class, interface, or enum expected livingAreaInRange = true; ^ Test.java:139: class, interface, or enum expected actualLivingArea = 0d; ^ Test.java:140: class, interface, or enum expected riskRatingsAllUnder4 = true; ^ Test.java:141: class, interface, or enum expected riskRatingsHave3OrMoreOver3 = true; ^ Test.java:142: class, interface, or enum expected twoTierMktIsNo = true; ^ Test.java:143: class, interface, or enum expected actualTierMkt = null; ^ Test.java:144: class, interface, or enum expected mktValEqualsContrPrice = true; ^ Test.java:145: class, interface, or enum expected actualContractPrice = 0m; ^ Test.java:146: class, interface, or enum expected mktValVarianceFromEMVInRange = true; ^ Test.java:147: class, interface, or enum expected actualEMV = -1.0m; ^ Test.java:148: class, interface, or enum expected valDatePastOrPresent = true; ^ Test.java:149: class, interface, or enum expected actualValuationDate = this.moJob.ValValidDate; ^ Test.java:150: class, interface, or enum expected intCondWordsNotFound = true; ^ Test.java:151: class, interface, or enum expected intCondWordsFound = null; ^ Test.java:152: class, interface, or enum expected extCondWordsNotFound = true; ^ Test.java:153: class, interface, or enum expected extCondWordsFound = null; ^ Test.java:154: class, interface, or enum expected essRepairsWordsNotFound = true; ^ Test.java:155: class, interface, or enum expected essRepairsWordsFound = null; ^ Test.java:156: class, interface, or enum expected commentsWordsNotFound = true; ^ Test.java:157: class, interface, or enum expected commentsWordsFound = null; ^ Test.java:158: class, interface, or enum expected salesCountCorrect = true; ^ Test.java:159: class, interface, or enum expected salesPricesInRange = true; ^ Test.java:160: class, interface, or enum expected salesNotTooOld = true; ^ Test.java:161: class, interface, or enum expected minReqSalesInSameSuburb = true; ^ Test.java:162: class, interface, or enum expected invalidSalesIDs = null; ^ Test.java:163: class, interface, or enum expected sameValAndValValidDate = true; ^ Test.java:164: class, interface, or enum expected sameTenderPriceAndCheckCost = true; ^ Test.java:165: class, interface, or enum expected latestSaleGreaterThanValAmount = true; ^ Test.java:166: class, interface, or enum expected strataEqualsStratum = true; ^ Test.java:167: class, interface, or enum expected bool noSecuritisationFailures = true; ^ Test.java:168: class, interface, or enum expected falseSecuritisationFields = new List<string>(); ^ Test.java:169: class, interface, or enum expected currentUseIsResidential = true; ^ Test.java:170: class, interface, or enum expected currentUseNotAsResidential = string.Empty; ^ Test.java:171: class, interface, or enum expected impValRateInRange = true; ^ Test.java:172: class, interface, or enum expected impValRate = 0; ^ Test.java:173: class, interface, or enum expected landValRateInRange = true; ^ Test.java:174: class, interface, or enum expected landValRate = 0; ^ 93 errors helping plz?
    Please send teh codes!
  • (cs) in reply to hoodaticus
    hoodaticus:
    C-Octothorpe:
    hoodaticus:
    frits:
    C-Octothorpe:
    Who doesn't have a static "Util" class in their code base filled with various static "helper" methods like your example.
    Me.
    Me.
    Really? Why not?

    If you have several methods that are related, lets say they interact with active directory, but don't require any kind of state, where would you put them?

    EDIT: and don't say extension methods because that's just cheating.

    As it turns out, I have just such an ActiveDirectory class. It's (almost) a singleton and only has methods on it that pertain to the directory itself. The instance contains other objects, such as ActiveDirectoryUserCollection, which self-updates in the background until the AppDomain unloads.

    There is a static method called GetTrustedDomain(string) which returns a similar ActiveDirectory object for a domain other than the one the host is on, which will have its own ActiveDirectoryUserCollection and on and on.

    Can your static methods compete with that?

    If I want to look up a user in AD, I do this:

    var user = ActiveDirectory.Users[username];

    Now I have a user object and can do this:

    foreach (var message in user.GetInbox().GetMessages()) {}

    or

    user.GetIsAuthentic(password);

    Sounds pretty cool, but I hope the call to load/update the user collection(s) are on-demand. I'd be curious to see how that class would behave under the pressure of 45k+ AD users in multiple domains. :)

    Also comparing a rarely called AD search method to an AD service (what you've got) is like comparing apples and grapes, IMO.

  • (cs)

    Weird. I just learned about the 'out' keyword today while perusing a sample CS program for a library I'm using... and less than an hour later I take a look at TDWTF and there it is being abused.

    I am not a programmer by trade - I'm an electrical engineer - and the programs I build are typically just user interfaces for machinery. I code in VB .NET using the OO techniques I learned in university for C++. VB 2010 plus WPF is great for my HMIs because it's straightforward and isn't a gimped up piece of crap like VB6 and WinForms.

    In spite of my limited experience, this example makes me cringe something fierce. Seriously, just create a class!!

  • Macho (unregistered) in reply to evilspoons
    evilspoons:
    Weird. I just learned about the 'out' keyword today while perusing a sample CS program for a library I'm using... and less than an hour later I take a look at TDWTF and there it is being abused.

    I am not a programmer by trade - I'm an electrical engineer - and the programs I build are typically just user interfaces for machinery. I code in VB .NET using the OO techniques I learned in university for C++. VB 2010 plus WPF is great for my HMIs because it's straightforward and isn't a gimped up piece of crap like VB6 and WinForms.

    Cool story, bro!

  • (cs) in reply to evilspoons
    evilspoons:
    Weird. I just learned about the 'out' keyword today while perusing a sample CS program for a library I'm using... and less than an hour later I take a look at TDWTF and there it is being abused.

    I am not a programmer by trade - I'm an electrical engineer - and the programs I build are typically just user interfaces for machinery. I code in VB .NET using the OO techniques I learned in university for C++. VB 2010 plus WPF is great for my HMIs because it's straightforward and isn't a gimped up piece of crap like VB6 and WinForms.

    In spite of my limited experience, this example makes me cringe something fierce. Seriously, just create a class!!

    If you are code in VB .NET why are you using CS program? Am I miss sumthing?

  • (cs) in reply to Matt Westwood
    Matt Westwood:
    You don't know fucking shit, you prick.

    Hi Mort, is that you? How's your C#-written-like-VB6 coming along?

  • (cs) in reply to hoodaticus
    hoodaticus:
    Coyne:
    Global:
    Globalization is the future Frist

    I agree. We need to create a new class named "World" that everyone can put all their variables into. That way, we can have things like initrodeCounter and acmeCounter for "privacy".

    That way, if Initrode and Acme are having a competitive war they can tweak each other's variables.

    It would be the ultimate in globalization.

    That's about the only thing that could get me to join the patchouli-soaked communist anarchists (WTF?) in protesting the G-8 meetings.
    We could always round up everyone who wears patchouli and machine-gun them. The Government of Syria has the right idea.

Leave a comment on “The Global Workaround”

Log In or post as a guest

Replying to comment #:

« Return to Article