312 karma · joined January 24, 2009
No minimum wage laws, and if the staff can't leave the ship, say hello to slavery.
What I'm saying is, there's no copy or clone or dup method built into Python's base object, as there is in Ruby. And Python programmers are not instructed to define a clone method for a class, as in Java. A __copy__ or __deepcopy__, okay, but not copy or deepcopy.
Hence, in Python you just don't see foo.clone() or foo.dup() or foo.copy() or foo.deepcopy(). Instead, you see copy.copy(foo) or copy.deepcopy(foo). Pythonic code often looks different than Ruby or Java, looks more stand-alone function-y than instance method-y.
Shopping! Creating a useful software product is harder than buying one off the shelf. Creating great literature is harder than buying something at Barnes & Noble.
if you want Python to smell like Java or Ruby. :->
For several years, the company I had been working for used a multi-platform GUI library called C++/Views. We had the code for the library itself and compiled it as needed for the various platforms we needed to support. It came with a handy, yet annoyingly buggy, WYSIWYG GUI-creator tool.
Wouldn't you know, the WYSIWYG tool stopped working in September 2001. C++/Views was no longer supported, and we didn't have source code for the WYSIWYG tool. A guy Brian and I experimented around with it awhile and discovered we could use the tool only if we set the system clock back before September 8, 2001. So, that became every developer's workaround: temporarily setting the clock back to use the darn tool.
Nasty billennium (1,000,000,000) bug. Fun, fun.
Sorry I'm so crabby about this. But, by golly, Google's new "button" really calls out for the question "Why?" And to think on top of it all, Google has to go through a lot of trouble (probably Javascript trouble, though I haven't studied the code) to make these silly "buttons" tabbable. Pretty soon, every Web 7.0 kiddie will try to replicate Google's "buttons" and fail to make them tabbable.
Agree: "Desktop clients still have a bright future thanks to stuff like this."
Ah, but if he's prone to computer addiction, the software needs to shove him outside to interact with real people, or shove him out of his chair to enjoy his girlfriend/boyfriend/pet(?!) in the next room. Perhaps Facebook needs the various noprocrast features HN has.
The Hash#keys method should have returned a Set, not an Array. That way no one would have been baffled by the lack of predictable order. But, unfortunately, Set is not a built-in class. Hence, Hash#keys has to return an Array.
Since Rails came out, there's been, I think, an ever increasing use of Symbols as Hash keys. If you want to examine your Hash in a specific order--perhaps in a test--it's tempting to sort the Array of keys. But there's no Symbol#<=> method. Therefore, an Array of Symbols cannot be sorted (without monkey patching).
If, for whatever reason, you create a Hash whose keys are of various types, the keys are probably not sortable. Hence, there's no way to examine its contents in a predictable order.
A few thoughts about the new ordered Hash:
Personally, I see no need for the built-in Hash to be ordered. I'm so accustomed to thinking of hashes as unordered. And, because I don't have Ruby 1.9, I don't use the newfangled hashy syntax for passing parameters.
But one of the commenters (Radarek) points out something about parameter passing. He/she says, "It's another big + for ordered hashes because they are used as replacement for named parameters [in Ruby 1.9]." He/she mentions a project in which a method must process its keyword parameters in the order they were given.
The thought of trying to process keyword parameters in the order given is very jarring to my old-fashioned Ruby brain, and to my Python brain. Yet, evidently, someone out there wants to do this without telling the client to pass an Array of Arrays.
So I wonder what the major use case is for the predictable ordering of the built-in Hash. Perhaps it's for ease of examining and comparing Hashes in tests? Perhaps it's for processing keyword parameters in a specific order when they're passed using spiffy syntax? What?
<meta name="description" content="Interactive spoof of corporate personality tests">
Anyone know what triggers the new search results?
(5) Different apps want to open files in different places. One app's Open dialog wants to look in the directory you finished off your last Open. Another app wants Open to look in the directory of the file you most recently opened by double clicking on its icon. A third app wants Open to look in the directory where you completed your most recent Save. Etc. As in the Save As problem, no one can remember each app's Open convention.
I know several older people (in their 70s) who sorely miss the days of yore when they worked with their user files on floppies. Each project lived on one or two floppies. Even if the OS allowed subdirectories, they didn't bother creating them. So, on DOS or early Windows, say, the users could always find their work at A:\ (unless there was no hard drive; then their work was at B:\). No getting lost in Open or Save As, no Recent nonsense, no digging down through folder icons, and hardly a need for built-in search.
We've been living with hierarchical file systems for several years now. And the upshot is, the Finder (or whatever it's called) and desktop apps plus newfangled browser apps don't present a consistent interface to the file system.
I believe the chief causes of the confusion are (1) different apps save newly created/edited files to different places (2) many users are clueless about navigating the file system within the Save As dialog (3) many users rely on an app's Recent list (4) many users don't know how to search their own file systems.
(1) Some apps always want to Save As to the Documents folder. Some always want to Save As to wherever you finished off your previous Save As. Some always want to Save As to the folder of the file you most recently opened in that app. Etc. No one can remember each app's convention.
(2) People don't realize they can navigate within Save As to someplace other than wherever the app feels like plopping the file by default at that moment. True even when shown over and over and over how to do this.
(3) Once you move a file, its entry in an app's Recent listing is probably borked. This sends people who rely on Recent for finding and opening files into a panic.
(4) They don't know how to click on the desktop and hit cmd-F or to click on Start->Find. And once they do, the Find window looks nothing like Google or a web browser. They don't understand what the various search criteria are or how to enter them. They don't know how to read the results.
John Derbyshire examines al-Khwarizmi's work in chapter 3 of Unknown Quantity: A Real and Imaginary History of Algebra [ISBN 978-0-452-28853-9], which I just finished reading a few days ago.
The first part of al-Khwarizmi's book concerns finding the roots of first- and second-order polynomials of one unknown. He classified the polynomials into 6 fundamental types, with all positive coefficients. Keep in mind, that negative numbers did not exist at the time, though subtraction did. He showed how to manipulate polynomials into a suitable one of the 6 types by adding a term (al-jabr, completing) or subtracting a term (al-muqabala, reducing).
Says Derbyshire, "al-Khwarizmi has no literal symbolism--no way to lay out equations in letters and numbers, no sign for the unknown quantity and its powers." The problems, the fundamental types, the procedures are all presented in words.
Interestingly, Diophantus 600 years earlier did addition and subtraction of polynomial terms using "a rich literal symbolism to aid the manipulations."