• pudding (unregistered)

    Someone needs to make a joke about "Irish Girl"'s "Pi".

  • Paolo G (unregistered) in reply to Jay
    Jay:
    If it's the Greek letter, then the value should be 960. At least, that's what Unicode says.

    In Ancient Greece, pi was 5 or 80. The Ancient Greeks used letters for numbers, like the Romans did. Capital pi was used for 5 and lower case pi (with the symbol ʹ after it to indicate it was a number and not a letter) was used for 80.

    See http://en.wikipedia.org/wiki/Greek_numerals

  • (cs)

    At least, today (3/14) is the π-Day: http://www.exploratorium.edu/pi/

  • François (unregistered)

    Pie XII was a pope (french pronounciation) http://en.wikipedia.org/wiki/Pope_Pius_XII

  • (cs) in reply to Jay
    Jay:
    I've gotten burned by this a few times over java.lang.util.Date versus javax.sql.Date. You can get some very subtle bugs. Other than saying "never ever use the same member name in two different classes" I don't know how you'd avoid the problem, and that seems a rather drastic solution.
    The huge WTF'ery of java.sql.Date is that it is actually derived from java.util.Date despite not behaving the same, so the tools actually help you make subtle mistakes. Even worse is that the documentation admits that it is implementation inheritance and not really like util.Date, but that in writing this it didn't occur to them it was a completely WTF thing to do.
  • Poochner (unregistered) in reply to Jay
    Jay:
    Someone else could always come along with a more accurate measuring device then whatever you used.

    </diatribe>

    THAN! THAN! not THEN! Using comparatives goes with THAN. Using time goes with THEN.

    AAAAAAAAARRRRRRGGGGGHHHHHH!

    (ok, I'll try to calm down now.)

  • (cs) in reply to DHager
    DHager:
    real_aardvark:
    I can't even be bothered to check in my handy Wikipedia, but AFAIK, maths has no common terms labelled XML, DTD, or TWERP.

    I don't understand why you're so hung up on the fact that nobody has defined constants for those items in the math package.

    But fine, replace "acceptable" with "manageable".

    Of course, by your logic, EVERYBODY should also share state constants, like Foo.READY and Foo.ACTIVE, since those words are also candidates for repetition? In fact, they're far more likely to be repeated in different namespaces than "PI".

    So obviously nobody is allowed to use them?

    Anyone at all is more than welcome to use them, for any purpose at all outside of the state machine. I can't see that it would have any purpose, but I don't object to any meaningless concatenation of random characters being re-used -- although, I agree: by my logic, all you're doing is making it needlessly difficult for future maintenance programmers (a) to understand what the hell you're on about and (b) to integrate your code with hitherto unimagined libraries.

    Have you ever seen a plausible use-case that involves naked constants representing state and does not involve the state machine itself? I have, and they're horrible designs.

    If you have to use Java, at least work with its ability to hide attributes/constants such as READY and ACTIVE within the class foo. Conceptually, they have no meaning outside that class. Why leak them and pollute other name-spaces?

    Having replaced "acceptable" with "manageable," can we now agree to replace "manageable" with "sensible"?

    Addendum (2008-03-14 14:40): OK, I've taken a cold shower and I understand your point. I'll try to restate mine:

    Code should be written, as far as possible, to assist comprehension by the reader. (Well, that's APL out, for a start, then.) There are any number of war stories in C/C++/other languages where importing the wrong header can silently change the meaning of TRUE or FALSE. After being burned often enough, people tend to avoid this sort of confusion.

    I suggest that "DTD" and "XML" are reasonably constrained names, given the semantics of what you are doing.

    I suggest that "PI" is not -- even if it's buried in the middle of a class, as a local, finalized, variable.

    I suggest that any normal person, looking at a class that uses "ACTIVE" and "READY", would think "Aha! State machine!."

    They would be unlikely to think of probiotics (for the first one) or (ahem) the Irish Girl reclining on a futon for the second one.

    There are a million and one alternatives to PI, encapsulated or otherwise. There are rather less alternatives to "XML", "DTD", "READY" or "ACTIVE".

    To quote Chinua Achebe, "Things fall apart." Try to avoid this propensity.

  • Misnomer (unregistered) in reply to MET
    MET:
    Anyway, why not use moderately self descriptive names like PROCESS_INSTRUCTION rather than the cryptic PI.

    Unfortunately that is the name defined in the XML standard ( See: http://www.w3.org/TR/REC-xml/#sec-pi ). Naming the constant anything different could cause confusion for those familiar with the XML standard.

    I still only see a WTF in that the poster didn't have the curiosity to figure out what it was. (Or that he just thought it was funny so he'd post it here.)

  • Anon (unregistered) in reply to Misnomer

    That's nice, and irrelevant. The class in question deals with HTML, and not XML.

    (And, no, it's not even a general SGML parser. If you check out the GNU Classpath documentation on the class they point out that a large number of constants within the DTDConstants class aren't actually used for anything. But they were in the standard API once, and due to Sun's refusal to ever break backwards compatibility with anything except JDBC, they'll be in there forever.)

  • DHager (unregistered) in reply to real_aardvark

    [quote user="real_aardvark"]If you have to use Java, at least work with its ability to hide attributes/constants such as READY and ACTIVE within the class foo. Conceptually, they have no meaning outside that class. Why leak them and pollute other name-spaces?[//quote] You mean, like: if(myobj.getState() == MyClass.READY){...}

    [quote]I suggest that "DTD" and "XML" are reasonably constrained names, given the semantics of what you are doing.

    I suggest that "PI" is not -- even if it's buried in the middle of a class, as a local, finalized, variable.[/quote]

    From my perspective, the value judgement is different. It's more important for users of the class to have a consistent set of names which corresponds to the existing XML literature. Replacing PI with, say "PROC_INST" while preserving the other names would be bad, as would renaming all of the constants to customized versions.

    [quote]I suggest that any normal person, looking at a class that uses "ACTIVE" and "READY", would think "Aha! State machine!."[/quote]I happened to vaguely have an object representing a network client in a NIO system in mind, actually.

    [quote]To quote Chinua Achebe, "Things fall apart." Try to avoid this propensity.[/quote] I have to admit I didn't really enjoy that book.

  • netlynx (unregistered) in reply to jdr

    I believe 12 is referring to the length of the value, not the value itself.

  • (cs) in reply to DHager
    DHager:
    real_aardvark:
    If you have to use Java, at least work with its ability to hide attributes/constants such as READY and ACTIVE within the class foo. Conceptually, they have no meaning outside that class. Why leak them and pollute other name-spaces?
    You mean, like: if(myobj.getState() == MyClass.READY){...}
    No, I was suggesting that the equivalent would be
    import MyClass.*
    if (myobj.getState() == READY){...}
    
    This is all getting too much like a high-school debate, and as usual in those things, we're not disagreeing about anything substantive (apart from who gets to date the Irish Prom Queen). I'm mostly suggesting that one should choose names carefully (eg "Moon Unit") in order to protect those that come after us.

    Briefly: (1) PI is instantly recognisable to the general public and to otherwise ignorant math guys, any of whom might be expected to use computers. Do not cause brain-fart on this one unless absolutely necessary. (2) DTD and XML are instantly recognisable to programmers. I find it hard to believe that anybody would be so obtuse as to re-use them in the middle of a library/massive great jar construct, but I could be wrong. A different case, I think. (3) The existing XML literature is wrong. Wrong! goddamnit!

    Well, (3) might need a bit of justification. Given that I assume that nobody in their right minds would misuse PI as a constant that refers to anything other than π, then you can apply my grumpy old man attitude just as much to the XML standards as you can to these interminable Java packages.

    DHager:
    real_aardvark:
    I suggest that any normal person, looking at a class that uses "ACTIVE" and "READY", would think "Aha! State machine!."
    I happened to vaguely have an object representing a network client in a NIO system in mind, actually.
    As in "(so) client does not see (NIO-created) socket close with SO_TIMEOUT ... Category java:classes_nio"? Aha! State machine! My rates are quite unreasonable.
    DHager:
    real_aardvark:
    To quote Chinua Achebe, "Things fall apart." Try to avoid this propensity.
    I have to admit I didn't really enjoy that book.
    Well, at least you've read it, which diggs you way up in my estimation. Even knowing who he is makes you a +1 with gold star and, probably, purple colon.

    Actually, I rather enjoyed it until the end, which I thought was a bit of a cop-out.

  • (cs) in reply to real_aardvark
    real_aardvark:
    <Major Snippage> PI, on the other hand, has an almost universally recognised documentary significance. Feel free to abuse it. Expect, however, that maintenance programmers such as myself will call you an XML or a DTD. Or even a TWERP.
    Give this man a banana too. Hell, give him pie, no, he deserves Sacher Tort! Why do so few people realise what a WTF this really is?
  • Vertigo (unregistered) in reply to T $
    T $:
    The real WTF is that REQUIRED has a value of 2. If anything, it should have a value of 1 (as compared to 0, not required). Clearly the wrong function was circled here. And yet, there's that title and commentary...
    its easy!

    0 = no 1 = yes 2 = maybe

    havent you heard of fuzzy logic??

  • Todd Musheno (unregistered)

    Hum... since this is part of the DTD class, maybe it is short for Processing Instruction (PI is actually a common abbreviation for this in the DTD/XML world). Mystery solved, maybe you should do some research before condemning things you dont understand. ;-)

  • (cs) in reply to Todd Musheno
    Todd Musheno:
    Hum... since this is part of the DTD class, maybe it is short for Processing Instruction (PI is actually a common abbreviation for this in the DTD/XML world). Mystery solved, maybe you should do some research before condemning things you dont understand. ;-)
    Well, the alternative would be to read the rest of the thread. Not as intellectually challenging, I grant you.

    But anyhow, thanks for the pointless input. Come back and see us soon!

  • Alejandro (unregistered)

    PI = Processing Instruction 12 = Ordinal number of the Procesing Instruction token

    (there is a list of tokens, in what it seems to be a parsing program)

    where is the wtf?

  • clacke (unregistered)

    Disregarding that this wasn't even about the mathematical PI, in the context of my integer-based geometry class for one project, i defined PI within that module as 512. I don't see what's wrong with that. Namespaces, man.

  • anarkist (unregistered)

    Oh my... this post is a total disgrace...

  • acvicari (unregistered) in reply to charonme

    1 Kings 23 "Now he made the sea of cast metal ten cubits from brim to brim, circular in form, and its height was five cubits, and thirty cubits in circumference. "

    The "circular in form" is the relevant phrase here.

    And I'm not sure how 1 Kings 26 "It was a handbreadth thick, and its brim was made like the brim of a cup, as a lily blossom; it could hold two thousand baths," is supposed to improve the situation. If I take something circular in form 10 cubits across (circumference of 31.4... cubits), and deform the circle to be lily-shaped but still 10 cubits across, then the perimeter will get longer, not shorter.

  • Axel (unregistered) in reply to charonme

    The sea (basin) measured 10 cubits (180 inches) from rim to rim and 30 cubits (540 inches) measured its circumference, according to I Chron 4:2. According to I Chron 4:5, it was a handbreadth (4 inches) thick. If you assume "rim to rim" to be the outer dimension and 30 cubits' circumference to be around the inside of the top edge, those numbers work perfectly. Certainly the,engineers and scribes of Solomon's day knew pi wasn't 3. Nor did they try to declare it so.

  • Axel (unregistered)

    the,engineers -> the engineers (darn phone). 180 - (540/3.14) = 8 = 2 handbreadths. Q.E.D.

  • Axel (unregistered) in reply to Axel

    "I Chron" -> "II Chron." I shouldn't post late at night.

Leave a comment on “My Pi Goes to Twelve”

Log In or post as a guest

Replying to comment #:

« Return to Article