Slashdot Mirror


User: J.+Random+Software

J.+Random+Software's activity in the archive.

Stories
0
Comments
403
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 403

  1. Re:Java for Applications.... on Java Performance Urban Legends · · Score: 1

    After b = new String(a) and c = new String(a), b.equals(c) but b != c. No matter how much state they share, the objects themselves must be distinct--there's no way for a constructor to give you a reference to an existing object instead of creating another.

  2. Re:Programming shortcuts on Summary of JDK1.5 Language Changes · · Score: 1

    Strings constructed at runtime aren't interned, only literals and constants. Otherwise they wouldn't have had to provide an intern method or override equals.

  3. Re:Wrong! on Summary of JDK1.5 Language Changes · · Score: 1
    I thought that's one of the differences between C and C++. A C compiler can get away with
    #define NULL ((void *) 0)
    but a C++ compiler cannot, because the implicit conversion from (void *) to any other pointer type has been removed.

    And it's important to note that only a zero value that's a compile-time constant has this meaning. Casting a zero-valued int to a pointer at runtime summons nasal demons (though many recent platforms have a clean enough architecture that a word-sized zero really is a null pointer).

  4. Re:I disagree - x++ vs ++x on Summary of JDK1.5 Language Changes · · Score: 1

    But the syntax was copied from C. If the argument is that you write "i++" in Java because that's what you write in C, the counterargument is that you should have been writing "++i" in C whenever you didn't actually need the previous value. C++ just increases the cost of the incorrect style.

  5. Re:What Alan Kay has to say about C++ on Summary of JDK1.5 Language Changes · · Score: 1

    Unlike Java's (needlessly crippled) "primitive types", SmallInteger is a genuine class. Instances happen to be implemented more efficiently with no boxing, but they still support an extensible set of messages and can be intermingled transparently with other (boxed) objects. Lisp fixnums act like this too--the trick is to reserve a few tag bits to tell you whether a value is a pointer to the most general representation of class instances, or an unboxed integer (or character, boolean, cons...).

  6. Re:Shorthand programming on Summary of JDK1.5 Language Changes · · Score: 1

    It is best to let the compiler choose the fastest integer type except in special cases, but needing more than the language offers--16 bits--has to be one of those cases. Competent coders use the preprocessor to either include typedefs or refuse to compile if they want INT_MAX > 32767.

  7. Re:Shorthand programming on Summary of JDK1.5 Language Changes · · Score: 1

    Assuming int is 32 bits is absurd. We already have an integer type that's at least 32 bits, namely long. And if you want the value of INT_MAX you know where to find it.

  8. Re:Barf on Summary of JDK1.5 Language Changes · · Score: 1
    What's wrong with bad coding blowing up at runtime?

    If you can easily prove that it can't, is there any reason to run the risk?

    From my C++ experience, genericity equals crappy performance in time and space.

    Time? How can a compiler produce worse code given more information about the arguments? Space is the usual tradeoff. If you want inline wrappers that just cast and use one real implementation, you can do that too.

  9. Re:More overloading evil... on Summary of JDK1.5 Language Changes · · Score: 1

    Any overload of operator && is strict (though the builtin is not), because they didn't provide any way for a user-defined function to request evaluation of a non-strict argument. You can emulate this yourself with expression-tree classes but it's a lot of work.

  10. Re:sir, i think you are looking for on Summary of JDK1.5 Language Changes · · Score: 1

    "In C" doesn't mean alloca() will exist, even if it happens to be in your implementation. And a compiler could produce better code for a known set of objects (at fixed offsets in a traditional stack frame) than for accessing one of an unknown number of randomly-sized allocations.

  11. Re:Looking to Get Back into Java on Summary of JDK1.5 Language Changes · · Score: 1

    Out of the box Emacs offers a class browser, reindents source, jumps to compiler errors, and integrates version control systems and debuggers. In what sense is that not an IDE?

  12. Re:No enumerators?? on Summary of JDK1.5 Language Changes · · Score: 1

    Liveness is a global property. Pointers are dangerous unless you know what everyone is doing--or might ever do.

    Now that generational copying collectors are often faster than malloc/free, dangling pointers are an entire class of errors that it's stupid to still tolerate.

  13. Re:Drag + Drop installs on If I Had My Own Distro... · · Score: 1
    Do you install new binaries for everything whenever a new security advisory comes out, or just do the ones you think of and then hope you didn't miss any?

    Even after you've add enough memory to waste, using it still isn't free. The relative penalty for cache or even TLB misses is large and growing all the time, so paging in N copies of the same object code is just as gross as downloading N copies in the first place.

    Besides, Debian GNU solved your "dependency hell" problem a long time ago, right down to side-by-side deployment being possible for those few libraries whose maintainers aren't competent to make backward-compatible changes.

  14. Re:Drag + Drop installs on If I Had My Own Distro... · · Score: 1

    ... and upgrading the shared library repairs them all simultaneously. If they were statically linked, you wouldn't even know which executables need to be replaced.

  15. Re:Maybe he should have read Knuth on XML Co-Creator says XML Is Too Hard For Programmers · · Score: 2, Informative

    It's fairly common to comment out markup when hand-editing, since <![IGNORE[...]]> can't be used within a document. Skipping non-markup in the document should be just a matter of matching the Perl regex

    ( [^<]+ | <!--.*?--> | <\?.*?\?> | <![CDATA[.*?]]> )* <foo

    If someone else defines a foo element in a different namespace, I don't see how you can do anything other than ignore it--it's almost certainly not what you were looking for, and you have no idea what it might mean.

  16. Re:But XML is great for computers... on XML Co-Creator says XML Is Too Hard For Programmers · · Score: 1
    Certain details of the format have to be fixed (because if you don't know anything about your input you can't really consume it, only ignorantly transform it) but the format can still be extensible. For example, that could be implemented in XPath by
    //user[@id="abc01"]/@real-name
    which will search the entire document for the matching user element, no matter which other attributes are in use and which elements (LDAP info? groups?) may be nested around or inside it.
  17. Re:Maybe he should have read Knuth on XML Co-Creator says XML Is Too Hard For Programmers · · Score: 1

    <foo isn't allowed in an attribute value, but it could appear in marked sections, comments, or processing instructions (which aren't too hard to ignore), or in a processing entity declaration in the prolog (which has to be fully parsed to deal with), or in a few other places if you read the external DTD subset. It also won't do what you want if the element you want is in a namespace (the correct prefix, if any, is unpredictable) or if the document uses default namespaces (you might have found someone else's foo element from a different namespace).

  18. Re:My Rights Online?? on Judge Grants Padilla Access to Lawyer · · Score: 1

    He's not being "tried", only interrogated. He hasn't been permitted to mount a legal defense. The Fifth Amendment requires due process for all criminal cases (the bit about war only applies to the clause about indictments), so why is military jurisdiction allowed to withhold it?

  19. Re:Death to spacers! on Slashback: Rocketry, Pythonation, Scoffing · · Score: 2, Informative

    GML originated at IBM, where they wouldn't have screwed their own customers by saying "let's require ASCII!" If you want to use C0 control characters as delimiters, all you need is a SGML Declaration, but keep in mind that those characters (except U+0009 HORIZONTAL TAB) have no semantics in Unicode.

  20. Re:Browser Tabs on Hyatt Discusses Tabs · · Score: 1

    The Mozilla binding is ctrl-click: it's either "open new window" or "open new tab", your choice.

  21. Re:Serious question on tabbed browsing on Hyatt Discusses Tabs · · Score: 1

    The problems with MDI are that you can't directly reach those documents via the window manager, and that you're stuck with an opaque bounding box around all the documents that only wastes real estate. Tabs are actually even worse--at least with MDI it's never impossible to see two documents side by side.

  22. Re:Dave hit the nail on the head on Hyatt Discusses Tabs · · Score: 2, Informative

    All the abilities you're describing (open in background, open multiple URLs) are just as feasible with real browser windows. The debate is only whether every major app ought to have its own half-assed window manager.

  23. Re:Why 17? on 1.8TB Of Disk Space In A (Semi-)Normal PC · · Score: 2, Interesting

    Might be using four RAID arrays plus a boot drive. Or have eighteen IDE controller channels (four per card and two on the motherboard?) with one used for a CD drive. Or built a 16-drive filesystem due to some obscure size limit and then added a hot spare. Hard to tell while the images are unavailable.

  24. Re:Ringworld as Lifeboat? on Ask Larry Niven · · Score: 1

    Protector ended in an elaborate arms race and running battle, working off nothing more than the history of the Pak and two points of light. One of the Pak in the library (looking for a mission) might simply look up and deduce that a core explosion would inevitably come.

  25. Cautionary tales? on Ask Larry Niven · · Score: 5, Interesting

    You've built worlds with uncommonly dystopian elements, such as Plateau's long tyranny over a disarmed populace, organlegging, all-out war with ruthless aliens, and suppression of dangerous technology. Have you intended any of these to be cautions about likely (or even inevitable) events, or just interesting to think about?