• vtbassmatt (unregistered) in reply to vt_mruhlin

    You didn't by chance take 1104 with JAN Lee did you? I remember those quizzes...

  • Bobbo (unregistered)

    I have a serious case of Tool Blame, but it's not about coding specifically. It's about a tool that I like to call 'Visual SourceUnsafe', or 'Visual Shoot-Yourself-In-The-Foot'.

    It's like a hammer that requires you to hit your thumb, each time you use it.

  • (cs) in reply to iToad
    iToad:
    Old school Fortran. You could pass a constant as a parameter to a subroutine, and then change it within the subroutine.

    By "constant", you mean "literal", right, not "const int"? As in, if you have the following function (C++ syntax as I don't know Fortran):

    void changeToFive(int& x) { x = 5; }

    you could issue changeToFive(0), and after doing this future uses of 0 would actually compute with 5 (e.g. 0 + 0 would evaluate to 10)?

    I know there was some old language where this was true, but I don't know for sure it was Fortran.

  • MindChild (unregistered) in reply to trianglman

    It is "PIC BASIC", and your computer has a dedicated PIC controller, which PIC BASIC is the interface. The fact that you don't know this leads to the conclusion you have little room to speak.

  • (cs) in reply to some guy
    some guy:
    I am not a java hater, but consistent API?

    Some examples from http://mindprod.com/jgloss/gotchas.html

    // ways to set text in a component TextField.setText(); Label.setText(); Button.setLabel(); AbstractButton.setText();

    Button and AbstractButton differ because they are in entirely different GUI toolkits, Swing vs AWT
    some guy:
    Frame.setTitle();
    That sets the frame's title and not any text in it, if it were named setText that would be even more confusing.
    some guy:
    // ways to change an element setCharAt(int index, char c );
    You can see in the signature that you cannot insert any element, only a char
    some guy:
    // ways to get length lenOfArray = myArray.length;
    Arrays are not objects, they dont have methods, hence they won't be able to stay consistent
  • Ones Self (unregistered) in reply to TheRider

    I believe you are right. Enums are meant for representing static requirements. If you need to create dynamic data with a fixed structure you would usually use... (wait for it)... classes!

    The only real difference between a Java class and enum, is that enums require you to specify a finite number of objects for that class. This is extremely convenient if you want to add a little bit of extra information or functionality to your enum type. This makes Java enums much more powerful then C++ enums, for example.

  • iToad (unregistered) in reply to EvanED
    EvanED:
    iToad:
    Old school Fortran. You could pass a constant as a parameter to a subroutine, and then change it within the subroutine.

    By "constant", you mean "literal", right, not "const int"? As in, if you have the following function (C++ syntax as I don't know Fortran):

    void changeToFive(int& x) { x = 5; }

    you could issue changeToFive(0), and after doing this future uses of 0 would actually compute with 5 (e.g. 0 + 0 would evaluate to 10)?

    I know there was some old language where this was true, but I don't know for sure it was Fortran.

    Yes, you could actually change any literal value. I dimly remember this feature working in Fortran II and Fortran IV, on both the Univac 1108 and IBM 360 mainframes. I think that they fixed this some time around 1972, about the same time that the default value for uninitialized variables in Control Data Fortran changed from zero to some random value.

    The good old days - Actually, they sucked....

  • BillyBob (unregistered)

    Anyone who has ever been forced to work with Rational Rose and its clumsy and horrid code generation knows that sometimes the tool is to blame :-)

  • (cs) in reply to stratos
    stratos:
    ...does the counting of all produce of a farmers cooperation.
    Wow... sounds like quite a cooperative program.
  • grunk (unregistered) in reply to Rank Amateur
    Rank Amateur:
    I fully sympathize with Enric. I don't know how many times I've run up against the limits of a tool. For example, I've yet to find a language that allows you to programmatically change the value of a constant. What's up with that?

    Compilers --that's another thing. Why can't they make one that actually works? Every time I use one it does nothing but spit out errors.

    That reminds me: when is this new forum software going to be updated to let users see a registered commenter's bio?

    --Rank

    LOL

  • Ultimape (unregistered) in reply to grunk

    I made a nifty c program that would write over its own code to change a constant... it was the start of a really nasty virus i wrote (never in the wild).

  • (cs) in reply to Rick
    Rick:
    CapitalT:
    But there are very few languages that don't have their place (personally, PICK BASIC is one of those few, although I am sure it might have been useful 15+ years ago.)

    I don't know about today, but I believe 15 years ago, the New York City Public Library computers used Pick BASIC. :-)

    <NITPICK> Pick is not an acronym and should not be all caps. Dick Pick would be insulted.</NITPICK>

    Err..... how did my nick go there? I didn't say that!

  • Sch3lp (unregistered)

    I lol'd

    captcha: smile

  • Martijn (unregistered)

    Until Java either removes the operator overloading for String class, allows user-defined classes to have operator overloading too or changes String class to a primitive datatype, Java's a flawed language in my book.

    How can you say that operator overloading is a bad language feature, then go and overload the operators on one of the most basic Java classes?

  • foobar (unregistered)

    Yeah, but Microsoft's APIs still suck. That's a law of nature, not tool blame ^^

  • meh (unregistered)

    Hehe, there are few tools I love to hate. Namely the GNU open sores development tools. For example the error messages CVS spits out, I mean wtf?

  • meh (unregistered) in reply to Ones Self
    Ones Self:

    The only real difference between a Java class and enum, is that enums require you to specify a finite number of objects for that class. This is extremely convenient if you want to add a little bit of extra information or functionality to your enum type. This makes Java enums much more powerful then C++ enums, for example.

    How's that? In C++ you can for example represent an anonymous enum in a struct with arbitrary functions.

    struct Week { enum { Monday, Tuesday, Wednesday, }; // functions be here };

    Or then one could just have global functions taking an enum as an argument.

    void blah(MyEnum eval) { // code be here }

  • lolwut (unregistered) in reply to Goldscott
    Goldscott:
    You know you've been at a computer too long when you misspell "admit" with "admin," simply because that's what your fingers are used to typing.

    Its the forum softare's fault

  • lolwut (unregistered) in reply to lolwut

    I just realised, I can't find anywhere in the comments where someone has simply said: variables.

  • jethro tull (unregistered)

    "Tool Blame is that final, last-ditch act of desperation where one simply refuses to admin that he’s wrong" Had to read it three times before i realized that it should say "admit" instead of "admin". Looks like an ultimate geek-typo to me :)

  • DOA (unregistered) in reply to CapitalT
    CapitalT:
    Blaming the tool is only forgivable if it's PHP, but Java? I don't use it but it got one of the most consistent APIs out there (excluding 3rd party frameworks).
    Oh, come on, what do you have against PHP? It's brilliant at what it was built to do (build dynamic pages). Try writting the same page in PHP and say... JSP and see what happens (tip: try escaping special HTML characters in user input)
  • (cs) in reply to bryan986
    bryan986:
    some guy:
    // ways to get length lenOfArray = myArray.length;
    Arrays are not objects, they dont have methods, hence they won't be able to stay consistent
    Um... Arrays most definitely ARE objects and they HAVE methods (namely those inherited from java.lang.Object and a clone() method). They certainly could have been consistent.

    I can't think of any good reason why arrays use a length field and Strings a length() method, but the size() method of Lists is inherited from Collection and while it would make sense to talk about the length of a List, that is not the case for a Set or Map. Hence, size() as a consistent methode for obtaining the number of elements in any kind of collection. Criticizing it for being inconsistent with Strings and arrays only shows one's lack of understanding, I'm afraid.

  • JC (unregistered)

    I used to work for a large insurance company and we printed customer letters on various different types of paper. One day, not long after the new system went live, they introduced a new type of paper for a new letter.

    Not a problem we thought as we had a flexible system that simply allowed us to add a new paper type in the paper types database table and then associate letters with that paper type.

    All was well until we found that the system was throwing exceptions whenever we tried to print the new letter. After some investigation it was discovered that a developer had decided in their wisdom to create an enum for paper types in the code, thus meaning our new wizzy, flexible system had to have the code changed every time the business decided they wanted to have a different sort of paper on which to print.

  • (cs) in reply to MindChild
    MindChild:
    It is "PIC BASIC", and your computer has a dedicated PIC controller, which PIC BASIC is the interface. The fact that you don't know this leads to the conclusion you have little room to speak.
    Or, as alternatively noted by other posts, Pick Basic was developed by Dick Pick (originally on IBM S/360s). It was spookily like Mumps -- thus the original comment. The fact that you have not used google, wikipedia, et al to verify your assertion leads me to the conclusion that you are a callow, ignorant twit, who also lacks the grace to quote the object of your feeble scorn:
    trianglman:
    Blaming the tool is rarely forgivable. It is much more often a case of using the wrong tool. I wouldn't use C to write a quick text parsing script no more than I would use PHP to write a desktop app. But there are very few languages that don't have their place (personally, PICK BASIC is one of those few, although I am sure it might have been useful 15+ years ago.)
    At least a poor workman tries to use the tool before resorting to abuse. I believe this qualifies MindChild as today's Worse Than Failure ...
  • Stilgar (unregistered)

    what is the Java equivalent of .NET's Reflection API? It can prove very useful here :)

  • (cs) in reply to meh
    meh:
    Ones Self:

    The only real difference between a Java class and enum, is that enums require you to specify a finite number of objects for that class. This is extremely convenient if you want to add a little bit of extra information or functionality to your enum type. This makes Java enums much more powerful then C++ enums, for example.

    How's that? In C++ you can for example represent an anonymous enum in a struct with arbitrary functions.

    struct Week { enum { Monday, Tuesday, Wednesday, }; // functions be here };

    Or then one could just have global functions taking an enum as an argument.

    void blah(MyEnum eval) { // code be here }

    Well, yes, but it's hardly very elegant or expressive, is it? As a C++ programmer I was initially convinced of the value of the following approach:

    Paul:
    Enums in Java are pretty much full fledged classes. Each enum constant can call any constructor you provide, and the enum class you create can have its own static and instance methods. Each enum constant can even be its own inner class; e.g., define an abstract method in the enum class and implement it in the constant.
    Why can't C++ have full-fledged enums like this? Then I realised that it does; they're just not called enums. (Because in fact neither the Java version, nor the C++ version, is anything that a normal programmer would recognise as an enum.) What you'd do in C++ is something along the lines of
    struct Enumerable
    {
               Enumerable (EnumerableValues myValue);
       int     GetValue();
       string  ToString();
       bool    DoAnythingYouLike();
    private:
       int     value_;
       enum { val1, val2, val3, valn
       } EnumerableValues;
    };
    

    set <Enumerable> enumerables;

    The syntax is a little botched, but you get the idea.

    Why Java 1.5 sees fit to splodge yet more syntactic sugar into the porridge is beyond me. It's not as if the guys at Sun haven't pitch-forked the equivalent of generics in, thus allowing a slightly more sane approach such as the above ...

  • Josh (unregistered)

    J2EE == Dumb

  • dreadlocks (unregistered) in reply to Stilgar
    Stilgar:
    what is the Java equivalent of .NET's Reflection API? It can prove very useful here :)
    the Reflection API
  • dubya (unregistered) in reply to Josh
    Josh:
    J2EE == Dumb
    well, that has convinced me.
  • zamies (unregistered) in reply to some guy

    obiously you are one of the experts

  • zamies (unregistered) in reply to some guy
    some guy:
    CapitalT:
    Blaming the tool is only forgivable if it's PHP, but Java? I don't use it but it got one of the most consistent APIs out there (excluding 3rd party frameworks).

    I am not a java hater, but consistent API?

    Some examples from http://mindprod.com/jgloss/gotchas.html

    // ways to set text in a component TextField.setText(); Label.setText(); Button.setLabel(); AbstractButton.setText(); Frame.setTitle();

    // ways to change an element setCharAt(int index, char c ); Vector.setElementAt( Object o, intindex ); List.set( int index, Object o );

    // ways to get length lenOfArray = myArray.length; lenOfString = myString.length(); myList.size();

    Now it's getting really stupid

  • CrystalMethod (unregistered) in reply to DOA
    DOA:
    CapitalT:
    Blaming the tool is only forgivable if it's PHP, but Java? I don't use it but it got one of the most consistent APIs out there (excluding 3rd party frameworks).
    Oh, come on, what do you have against PHP? It's brilliant at what it was built to do (build dynamic pages). Try writting the same page in PHP and say... JSP and see what happens (tip: try escaping special HTML characters in user input)

    Err, you are taking the piss I assume? In JSP it's as simple as wrapping the string in fn:escapeXml{}.

  • CrystalMethod (unregistered) in reply to Stilgar
    Stilgar:
    what is the Java equivalent of .NET's Reflection API? It can prove very useful here :)

    java.lang.rflect - where do you think .NET copied it from?

  • Ahnfelt (unregistered) in reply to Martijn

    The String class is special in Java; you can write string literals. I guess you can argue that + shouldn't mean concatenation.

    But personally I appreciate that I can add floats, ints etc. with + instead of having a different operator for each.

    Operator overloading only a real problem when you allow everybody to use it (look at C++ stream << and >> plus Boost::Spirit for horrendous examples).

  • (cs) in reply to Ahnfelt
    Ahnfelt:
    The String class is special in Java; you can write string literals. I guess you can argue that + shouldn't mean concatenation.

    But personally I appreciate that I can add floats, ints etc. with + instead of having a different operator for each.

    Operator overloading only a real problem when you allow everybody to use it (look at C++ stream << and >> plus Boost::Spirit for horrendous examples).

    Ahh.... I once did a purposely-FUBAR'd code that did some interesting overloads:

    • would SUBSTRACT
    • would ADD
    • would elevate to the power of (second argument)

    Hm... maybe I would've been able to send that to the IOCCC, except it was C++ and not C.

  • Stilgar (unregistered) in reply to CrystalMethod
    CrystalMethod:
    Stilgar:
    what is the Java equivalent of .NET's Reflection API? It can prove very useful here :)

    java.lang.rflect - where do you think .NET copied it from?

    it's obvious where MS copied it from. The real question is where SUN copied it from. You don't think Java invented anything new do you?:) However I just didn't know the name. What I suggest is that this guy could have dinamically generated his enums:)

  • DOA (unregistered) in reply to CrystalMethod
    CrystalMethod:
    DOA:
    CapitalT:
    Blaming the tool is only forgivable if it's PHP, but Java? I don't use it but it got one of the most consistent APIs out there (excluding 3rd party frameworks).
    Oh, come on, what do you have against PHP? It's brilliant at what it was built to do (build dynamic pages). Try writting the same page in PHP and say... JSP and see what happens (tip: try escaping special HTML characters in user input)

    Err, you are taking the piss I assume? In JSP it's as simple as wrapping the string in fn:escapeXml{}.

    Bad example perhaps... try reading from a multipart form. Without using an external library. Takes a couple of lines in PHP. Needs a new project in Java
  • (cs) in reply to Stilgar
    Stilgar:
    What I suggest is that this guy could have dinamically generated his enums:)
    I don't know about .NET, but Java's Reflection API only allows you to get information about classes and access their fieldd and methods, but not to add, remove or change them in any way.
  • Duston (unregistered)

    I was once bemoaning the fact that strlen() doesn't actually return the length of the string (well it does, but if you're going to malloc()...) and thought that was "stupid." When I mentioned this to a fellow for whom I now hold little or no respect, he said, "There are no stupid languages, just stupid programmers." While what he said has some truth, being called a "stupid programmer" in so many words certainly did not ingratiate him to me in the least. And besides, there ARE stupid languages, English being one of them.

  • ineedabettername (unregistered) in reply to vt_mruhlin
    vt_mruhlin:
    Mmmm, I like the security at WTFU. Intro to CS class at Virginia Tech had online quizzes that were graded by javascript, then the final score on the assignment was posted to a perl script that recorded it. Shockingly I got 100% on all of them....

    Hope you've already graduated--you do know that Tech's CS profs read this site regularly, right?

    Hope mruhlin isn't your PID if you're still a student...

  • Alex G. (unregistered)

    Disclaimer: I am not a programmer.

    Or not really, unless you count bash as a programming language. It's the only thing I am fluent in.

    I am a Unix guy, who just believes that unix admins should know at least a scripting language and a machine language. At least vaguely.

    So I picked Java because I could work it on every single of the (rather obtuse and strange) platforms I work with, and it was pleasant to work with. And the Java experience knowledge would be appreciated when working with J2EE servers. (I hate JRun. Not related, but I just felt like saying).

    Reading through this: http://mindprod.com/jgloss/gotchas.html

    Which was commented on a few time so far, save for a few gotchas, I kept thinking "Uh.. why are you even mentioning this.. I mean, why would I try to do this?".

    For instance he somewhat expects the foreach implementation (which I didn't know about, that was useful, i've always complained about the lack of foreach, just like I deal with the fact that Perl has no case/switch) to be able to iterate over a String object? I mean, why would I think that, considering I like to think I understand to concept?

    I have now come to the conclusion that people who fall into these gotchas and complain about them have been tainted by other programming languages and feel the need to complain since it doesn't work like they are used to. And the original thing-that-works-in-C-but-not-in-Java seems to usually be a gotcha in itself that just happens to work.

    I don't judge which is better, I just felt the need to share that tool blame seems to be common for these reasons.

  • (cs) in reply to brazzy
    brazzy:
    I can't think of any good reason why arrays use a length field and Strings a length() method, but the size() method of Lists is inherited from Collection and while it would make sense to talk about the length of a List, that is not the case for a Set or Map. Hence, size() as a *consistent* methode for obtaining the number of elements in any kind of collection. Criticizing it for being inconsistent with Strings and arrays only shows one's lack of understanding, I'm afraid.

    Why? The STL treats strings as collections, and std::string has a size() method just like every other collection.

    I'll admit it's a weaker comparison than the .length thing, but it still would be more consistent.

    Of course, the reduced power of generics as compared to templates means that a consistent interface is rather less important in Java than it is in C++.

    CrystalMethod:
    Stilgar:
    what is the Java equivalent of .NET's Reflection API? It can prove very useful here :)

    java.lang.rflect - where do you think .NET copied it from?

    I thought they copied it from here, or maybe here.

    (Okay, I'm being a bit facetious; I don't actually think that MS designed a language that was almost the same as Java except for some rather nice syntactic sugar improvements from first principles or earlier languages. My point is that people shouldn't fault MS for copying Java because Java's a copy of what came before it too.)

    Ahnfelt:
    The String class is special in Java; you can write string literals. I guess you can argue that + shouldn't mean concatenation.

    But personally I appreciate that I can add floats, ints etc. with + instead of having a different operator for each.

    I personally appreciate that I can use + in C# or C++ to add BigInts or Complexs instead of having a different operator for both.

    Operator overloading only a real problem when you allow everybody to use it (look at C++ stream << and >> plus Boost::Spirit for horrendous examples).

    I can't speak to the Spirit example, but I will vigorously defend the << and >> overloading. What's the alternative to operator overloading? Function calls. Which means that you can have this:

    cout << a << b << c;

    or this:

    cout.print(a).print(b).print(c);

    Thank you, but I'll take the former. (And I can defend cout over printf too.)

    Another example that probably some people would consider an abuse of operator overloading is using them to build ASTs for expressions. In other words, given some classes that represent literal values, operations, etc., overload the operators so that something like "Tree1 == Tree2 + Tree3" will evaluate to the following tree:

    EqualsNode
       |---- Left:  Tree1
       |---- Right: PlusNode
                       |---- Left:  Tree2
                       |---- Right: Tree3

    Then you can assign it to something, like say "Formula = (Tree1 == Tree2 + Tree3);".

    Some people would consider this an abuse. But which of the following is easier to read:

    Formula answer(And(And(And(And(
                       Equals(Id(varName),
                              Plus(Int(lb),
                                   Times(Id(x), Int(s))),
                       Less(Int(0)), IdNode(x))),                                     
                       Less(Id(varName + "_x"),
                            Divide(Minus(Node(ub), Int(lb)),
                                   Int(s)))),
                       Less(Int(lb)), Id(varName))),
                       Less(Id(varName), Int(ub))));

    or

    Formula ans = ((var < lb) ||
                   (var > ub) ||
                   ((var == lb + x*s + y) &&
                    (0 < y) &&
                    (y < s) &&
                    (0 <= x) &&
                    (x < (ub-lb)/s) &&
                    (lb <= var) &&
                    (var <= ub)));

    The former is a simplified version of what I started with, the latter what I was able to refactor it into.

    It may be an abuse of the operator overloading system in some sense of the word, but I would be very very hard pressed to say that it didn't dramatically increase the code readability where it's used, and isn't that really what syntactic sugar like that is about?

    (Though actually in C++ operator overloading is absolutely critical to generic programming in some instances, so it's actually more than syntactic sugar. But my contention is that it's well worth dealing with the abuses even without that.)

    Addendum (2007-03-07 11:56): Actually I think I have to do a better point-by-point comparison. I also added some conversion operators (which are much more questionable than the op overloading) and pulled some other tricks (for instance, x is a string holding the name of a variable in the code instance, but a pre-built identifier node in the latter) to clear up the second one. So the non-op overloading one would look like this with the equivalent modifications:

    Formula answer(And(And(And(And(
                       Equals(varName, Plus(lb, Times(x, s)),
                       Less(0, x),                                     
                       Less(x, Divide(Minus(ub, lb), s))),
                       Less(lb, varName)),
                       Less(varName, ub)));

    So this looks rather better, but it's still a far cry in my mind from the op overload case.

    And actually, looking at this again, I'm not even comparing the same code examples. The op-overload case is more complicated than the refactoring of the non-op-overload case.

    Here is what it should have been:

    Formula ans = ((var == lb + x*s) &&
                   (0 <= x) &&
                   (x < (ub-lb)/s) &&
                   (lb <= var) &&
                   (var <= ub));

    Sorry for screwing up that post so badly.

  • (cs) in reply to Duston
    Duston:
    When I mentioned this to a fellow for whom I now hold little or no respect, he said, "There are no stupid languages, just stupid programmers." While what he said has some truth, being called a "stupid programmer" in so many words certainly did not ingratiate him to me in the least.

    I'd put it like this: there are languages that give you copious amounts of rope to hang yourself, and the people who vigorously defend such languages for their "power" usually vastly overestimate their ability to avoid hanging themselves as well as underestimate the need for code to be maintainable by people other than the original author.

  • XV (unregistered)

    Java enums are fun. They're just regular instance classes. It's literally syntactic sugar.

    public enum Colors { RED, GREEN, BLUE }

    Is (almost) literally the same as:

    public class Colors {
        public static final Colors RED = new Colors();
        public static final Colors GREEN = new Colors();
        public static final Colors BLUE = new Colors();
        private Colors() { }
    }

    Now I left out a lot of the additional methods that get added, but the important thing is that enumerated values are simply objects.

    Which means that they can be null.

    So, to reuse an old DailyWTF - er, WTF - tradition:

    public enum Bool { TRUE, FALSE }

    We now have a set of three values for instances of Bool: Bool.TRUE, Bool.FALSE, and null.

    Real enumerations do not allow any value outside their enum, Java enums are not in fact really enums. The fact that null is allowed can cause issues.

    Also, the real WTF is that the code BBCode tag is

     and not .  (Also, translating CRLF to 
    in
     tags is bad.  It's completely unnecessary.)

  • (cs) in reply to XV
    XV:
    Real enumerations do not allow any value outside their enum, Java enums are not in fact really enums. The fact that null is allowed can cause issues.
    You can't please everyone. On the one hand, Java is criticized for having primitive types rather than treating everything as an object, but now you are asking for a new primitive type to be added, one that would cause at least one issue of its own: what would the default value be for an enum field, or for the contents of an enum array?
  • (cs) in reply to some guy
    some guy:
    CapitalT:
    Blaming the tool is only forgivable if it's PHP, but Java? I don't use it but it got one of the most consistent APIs out there (excluding 3rd party frameworks).

    I am not a java hater, but consistent API?

    Some examples from http://mindprod.com/jgloss/gotchas.html

    // ways to set text in a component TextField.setText(); Label.setText(); Button.setLabel(); AbstractButton.setText(); Frame.setTitle();

    // ways to change an element setCharAt(int index, char c ); Vector.setElementAt( Object o, intindex ); List.set( int index, Object o );

    // ways to get length lenOfArray = myArray.length; lenOfString = myString.length(); myList.size();

    Button = AWT, replaced by Swing's JButton which extends AbstractButton and has setText() Frame.setTitle() = not exactly related to buttons or text fields in terms of what text gets put where, so this is perfectly valid StringBuffer/Builder.setCharAt = makes sense in this context Vector = discouraged class, replaced with ArrayList and retrofitted to use the List interface for backward compatibility List.set = standard throughout the entire Collections API

    An array's length is a final field, not a method. A String's length is a method which takes into account more than just the length of the implementation array.

    List.size = standard throughout the entire Collections API Also I wouldn't exactly call the "number of elements" a "length". Either "size" or "count" would make sense.

    Also remember that Java has had many incarnations, each supporting as much backward compatibility as possible. .NET had the advantage of being designed from scratch, taking all the new stuff from Java and weeding out deprecated stuff.

    Disclaimer: I'm not a Java fanboy, I just don't think it deserves the crap people throw at it.

  • TK (unregistered) in reply to SomeCoder
    SomeCoder:
    This is probably obvious but I want to say it. Tool Blame is such a WTF but we need to remember that sometimes, Tool Blame is valid. As someone who has delved into the inner workings of parts of the .NET framework, I can safely say... WTF???????

    But this definitely is an example of a WTF Tool Blame.

    I think you mean the difference between WTF (Tool Blame) and (WTF Tool) Blame. Yes, I sometimes miss parentheses in spoken language...

  • (cs) in reply to Samah
    Samah:
    Button = AWT, replaced by Swing's JButton which extends AbstractButton and has setText() Frame.setTitle() = not exactly related to buttons or text fields in terms of what text gets put where, so this is perfectly valid

    It still would be better consistent IMHO.

    An array's length is a final field, not a method. A String's length is a method which takes into account more than just the length of the implementation array.

    So? Why should I care about that? It's an implementation issue. Why doesn't a string use a final field, or an array a method? Strings are immutable, so a final field would work.

    There seems to be no rhyme or reason here at least.

  • (cs) in reply to EvanED
    EvanED:
    Samah:
    Button = AWT, replaced by Swing's JButton which extends AbstractButton and has setText() Frame.setTitle() = not exactly related to buttons or text fields in terms of what text gets put where, so this is perfectly valid

    It still would be better consistent IMHO.

    An array's length is a final field, not a method. A String's length is a method which takes into account more than just the length of the implementation array.

    So? Why should I care about that? It's an implementation issue. Why doesn't a string use a final field, or an array a method? Strings are immutable, so a final field would work.

    There seems to be no rhyme or reason here at least.

    I think that Sun may have left length() as a method in String for future expansion based on character sets, etc. If you read the source for String.java it actually just returns "private final int count" anyway. However, in Java 1.4, they brought in the CharSequence interface which defines the length() method and is implemented by String, StringBuilder, etc. Lucky for them it was implemented that way to start with, eh.

    Also, if you want consistency in a GUI toolkit, go look at SWT. Every widget is created the same way and there are pretty much NO convenience constructors. setText is standard across everything (iirc).

  • dkfal (unregistered)

    wait

    are you calling the guy a tool or java a tool???

Leave a comment on “Tool Blame”

Log In or post as a guest

Replying to comment #:

« Return to Article