Posts matching tags 'programming'
2008/4/28
InformIT has an interview with Donald Knuth; he's skeptical about multicore processors, unit testing and reusable code, doesn't like the idea of eXtreme Programming™, and has more or less conceded that literate programming is unlikely to become mainstream any time soon, whilst still believing that it is a superior way to write code:
In my experience, software created with literate programming has turned out to be significantly better than software developed in more traditional ways. Yet ordinary software is usually okay—I’d give it a grade of C (or maybe C++), but not F; hence, the traditional methods stay with us. Since they’re understood by a vast community of programmers, most people have no big incentive to change, just as I’m not motivated to learn Esperanto even though it might be preferable to English and German and French and Russian (if everybody switched).
Jon Bentley probably hit the nail on the head when he once was asked why literate programming hasn’t taken the whole world by storm. He observed that a small percentage of the world’s population is good at programming, and a small percentage is good at writing; apparently I am asking everybody to be in both subsets.
With the caveat that there’s no reason anybody should care about the opinions of a computer scientist/mathematician like me regarding software development, let me just say that almost everything I’ve ever heard associated with the term "extreme programming" sounds like exactly the wrong way to go...with one exception. The exception is the idea of working in teams and reading each other’s code. That idea is crucial, and it might even mask out all the terrible aspects of extreme programming that alarm me.
(via Wired) ¶ [no comments]
2008/1/9
Something I didn't know until today: the Facebook API includes a complete SQL-style query language for querying one's social graph, which allows you to do things like:
SELECT name, pic, status, music FROM user WHERE uid in (select uid2 from friend where uid1 = 1234567890)FQL, as it's called, can be called from the Facebook API, or you can play with it here (using the fql.query method).
(via
brad) ¶ [no comments]
2006/8/29
The core developers of Python (a rather elegant open-source programming language, in which, incidentally, this website is written) have broken ground on Python 3000, the massive, compatibility-breaking overhaul they intend to give Python, fixing the mistakes, shortcomings and inelegancies in the current version. Here are the things that will change, and here are the things that won't.
It's heartening to see that lambda functions (once slated to be abolished) have been given a reprieve. Otherwise there would have been no concise way of passing anonymous functions as a data type, and instead of being able to do something like (to quote a rather silly example):
greeters = {
'english' : lambda name: "Hello, %s"%name,
'french' : lambda name: "Bonjour, %s"%name,
'australian' : lambda name: "G'day, %s"%name
}
one would have to take the long way around, doing something like:
def greet_english(name): return "Hello, %s"%name
def greet_french(name): return "Bonjour, %s"%name
def greet_australian(name): return "G'day, %s"%name
greeters = { 'english': greet_english, ... }
And I don't buy the argument that anonymous functions are bad form, and that each chunk of code should have a name that describes what it does. There are many instances where one wants to specify a tiny fragment of code which will fit into a larger mechanism like a small but crucial cog (be it in a function call, a data structure or wherever), without the bureaucratic overhead of giving it a name. Otherwise we may as well be programming in Java or COBOL or some Vogon-designed abomination of a language.
2006/8/1
Bruce Schneier has a post about an interesting way to beat buffer overrun attacks:
Fortunately, buffer-overflow attacks have a weakness: the intruder must know precisely what part of the computer's memory to target. In 1996, Forrest realised that these attacks could be foiled by scrambling the way a program uses a computer's memory. When you launch a program, the operating system normally allocates the same locations in a computer's random access memory (RAM) each time. Forrest wondered whether she could rewrite the operating system to force the program to use different memory locations that are picked randomly every time, thus flummoxing buffer-overflow attacks.
Memory scrambling isn't the only way to add diversity to operating systems. Even more sophisticated techniques are in the works. Forrest has tried altering "instruction sets", commands that programs use to communicate with a computer's hardware, such as its processor chip or memory.
This produces an elegant form of protection. If an attacker manages to insert malicious code into a running program, that code will also be decrypted by the translator when it is passed to the hardware. However, since the attacker's code is not encrypted in the first place, the decryption process turns it into digital gibberish so the computer hardware cannot understand it.
(via schneier) ¶ [no comments]
2005/11/21
A request for help from one "Adoh Fadduq" of the United Arab Emirates, found in gnu.emacs.help:
Insha Allah, I am now trying to choose an editor for my software development and typesetting work. I have closely considered Emacs, which fits my needs in some respects. I do, however, feel that there is a big security issue with it for me and my brethren: Emacs was largely developed by Jews and for Jews. Considering how cunning the Jews are, I would not be surprised to find that they have hidden special bugs and booby traps inside emacs, in order to spy on and disrupt work of my Allah believing brethren. Are my concerns justified?
(via
dreamstooloud) ¶ [no comments]
2005/5/10
The Tory programming language is a programming language that takes the form of a series of Conservative election pledges:
The following example loops endlessly, outputting the ascii values 0 to 255:We will spend more on hospitals! We will jail anyone not in jail already! We will spend billions limiting immigration! We will deport anyone we can deport! We will abolish schools!
(via gimbo) ¶ [no comments]
2005/4/26
Nifty Python hack of the day: a C-style switch() construct, implemented without using dictionaries (instead using a class and yield).
(via pythonurl) ¶ [no comments]
2005/2/9
A fairly informative dissection and analysis of Google Maps and how it does its magic. It's pretty interesting; unlike GMail (the other example of an impressive DHTML-based interface from Google), Maps doesn't use XMLRPC, but instead just fetches tiles in JavaScript and uses a hidden frame to communicate with the server, and the browser's inbuilt XSLT engine to parse the result. Which all makes for some very impressive hack value.
2005/1/29
Glyph Lefkowitz is not only the developer/prime mover of an impressively elegant Python-based network programming framework, but has also written some nuanced and insightful essays about various topics, including a good argument for extending Python rather than embedding it (i.e., there are many good reasons other than laziness for it), a righteous excoriation of the Ayn Rand Institute's take on the "War on Terrorism", and a very astute attempt at a framework for ethics in software development, which does a good job of unmuddying the waters. Go and read.
2004/10/31
This looks fairly nifty: Unununium, a thoroughly modular operating system, following the principle that the utility of a system is proportional to the number of connections possible between its components. It's implemented in Python (the kernel contains a Python interpreter), consists of small pieces, loosely joined, and also aims to be completely persistent (so that the machine's state is retained when it is powered off). And, of course, probably won't take the world by storm, though could well become the next Oberon. (via gimbo)
2004/7/8
Why's Poignant Guide to Ruby, a gleefully insane and yet surprisingly useful beginner's guide to the Ruby language, peppered with zany examples and illustrated with cartoons, and sidebars rambling about gigantic robot monkey brains and such. A bit like those children's guides to TRS-80 BASIC programming and such that were around in the 1980s, only on much stronger drugs.
Ruby's a fairly nifty language; though probably a bit too overshadowed by both Perl and Python, which are technically more ordinary-looking but good enough for most things and have inertia behind them, to become big. Still, I should probably get around to doing more with it at some stage.
2004/4/2
Dating Design Patterns, or, adapting object-oriented software design methodology to the task of picking up women (or, as the authors put it, "attempting to implement getLaid method successfully on FEMALE platform"); the "design patterns" have names like "Jini Singles Bar", "Pan-Dimensional Renaissance Differentiator" and "Reverse Polarity" (which sounds more like Star Trek than OOP).
Classic Method Call: The recommended parameters for Just Asking.
Structured Exposure, a.k.a. Container-Managed Dating: How to use commonly available dating containers to achieve maximum sessions with less time and effort and an array of services you don't have to write yourself.
Umm, OK... (via Slashdot; where else?)
2003/7/31
Python 2.3 is officially out, and brings with it lots of features. Generators are now a first-class part of the language (and not part of __future__), which allows a sort of lazy evaluation; Python can import modules from ZIP files; there is the enumerate() function, which allows you to iterate over a sequence's indices and values more efficiently, as well as Set and Boolean types; and there are a number of nifty new modules, such as a correct CSV handler, and more. Oh, and it's apparently 25% faster too.
2003/4/1
The latest development in Trustworthy Computing technology: NewCode, a programming language based on Orwellian principles. It is (theoretically) impossible to express security vulnerabilities in NewCode.
2003/2/11
An internal memo from Sun about what's wrong with Java:
- The support model seems flawed
- The JRE is very large.
- Extensions do not support modularity.
- It is not backward-compatible across minor releases.
Interestingly enough, the memo goes on to compare Java to Python, with Java coming out of it not looking very good.
2003/1/15
The Year in Scripting Languages, a roundup of what happened in 2002 in the worlds of Python, Perl, Ruby, Tcl and Lua.
(Lua? Oh yes, it appears to be a new embedded scripting language of Brazilian origin. No idea what it looks like, as the site doesn't actually show any code.)
"Forget about Basic and go for Lua! Lua is just as easy to use, but a lot more powerful. Lua is also very easy to extend."
-- Jon Kleiser, in comp.sys.mac.programmer.help.
2003/1/3
Via Richard's blog, a USENET rant on why XML is evil. It meanders a bit, in the classic crackpot sense (the extension of the metaphor of XML as a bad child into a reference to diaper fetishism, segueing into a digression on why Americans like big breasts, is but one example), but I must say I agree somewhat with the sentiment; to whit, XML is useful as a markup language for text, but putting everything in XML (as some are advocating) is just silly. For one, for most things, there is too much syntactic overhead compared with other formats, and the idea seems to suffer from the Microsoft Fallacy (i.e., the assumption that clock cycles are too cheap to care about and may be squandered at will).
(I was thinking recently of the data format for a project I've been working on (more info on that later), and was toying with making it XML-based; after all, everybody else is doing it, aren't they? Though I'll probably make it some sort of Python-like pseudocode notation, or something otherwise lighter.)
2002/6/21
2002/1/3
Python 2.2 now has iterators and generators, like some of the more outré functional languages (not to mention Ruby and SuperCollider). Here is a good tutorial.
2001/11/10
Linux geekery: A great big list of Linux sound hacking links. Everything from sound processing libraries to revolutionary new DSP APIs to file reading code to MIDI classes for Python and Tcl. Also, CDfs, which lets you mount a CD (including multiple sessions and audio tracks) as a special file system.
2001/10/23
MacOS X geek-out: Qt is now available for MacOS X. Mind you, there's no X11-style free licence. Meanwhile, Apple say they have ported Tk to MacOS X. Which means that Tkinter may soon be available to Python scripts running on OSX.
Now hopefully someone will get around to writing a Gtk backend for Quartz (the MacOS X windowing/drawing mechanism). (There are already backends for Win32 and frame buffers, so it shouldn't be impossible.) Then it will be possible to run GIMP on MacOS X without an X server.
Another thing I'd like to see would be some Python bindings to Cocoa/AppKit. (Given the nature of the Objective C runtime, it may be doable.)
2001/7/27
Penguinheads, take note: Borland's Kylix development environment for Linux is now available for free , but only for developing GPLed software. Which is a nice gesture on Borland's part, giving something back to the free software community and all. (you probably saw this on Slashdot already)
2001/3/17
Python roundup: An interview with Guido van Rossum, creator of Python, in which he reveals how he wrote the language, and why it will be the next big thing, taking the mantle now held by the popular mutant camel Perl. And if that isn't enough, here's Eric S. Raymond's take:
Ugly programs are like ugly suspension bridges: they're much more liable to collapse than pretty ones, because the way humans (especially engineer-humans) perceive beauty is intimately related to our ability to process and understand complexity. A language that makes it hard to write elegant code makes it hard to write good code.
I agree with ESR; Perl has its uses for quick file parsing jobs, but isn't really suited to large programming tasks (especially when there are better languages). Python is currently my favourite language for day-to-day use. I've looked at Ruby briefly, and it looks possibly more elegant than Python (some of the OO syntax reminds me of SuperCollider on the Mac), though isn't yet quite as mature as Python.
2000/11/7
As the Amiga claws its way out of the grave and prepares to reconquer the world, it brings its own twist to the virtual-machine era: a virtual assembly language. That's right; rather than add a C/Pascal syntax or doing something doovy like Python, the Amiga people stayed true to the hardcore demo-jock traditions of the faithful and made it look like assembly language, only with infinite registers and other enhancements. 'Cause high-level languages are for pussies. Not quite sure whether it'll catch on, but it's interesting.
2000/10/16
A good opinion on why a Linux Visual Basic clone is a stupid idea. I agree; technically, VB's syntax has nothing to offer that Python (or even Perl) cannot trump by orders of magnitude, and VB compatibility would depend on having all the Windows guts there. The only reason I can think of for even considering such a daft enterprise is to have something on paper to impress clueless management types.
2000/9/30
This looks most interesting: Python WebWare; not as heavy as Zope, but it has some interesting-looking components such as Python Server Pages and WebKit.
2000/8/16
There's an interesting discussion on Slashdot about how human languages influence programming languages, and how languages designed by non-English-speakers would differ from ones designed by English-speakers. (Oddly enough, some of the most elegant recent programming languages come from non-English-speaking countries; Ruby and Python, for example, are of Japanese and Dutch origin, respectively, while Perl is very American. What does this say about the clarity of the English language?)
2000/6/14
An interesting programming contest, which involves writing a program which automatically summarises news items in haiku form. Given the complexity of the task, any satisfactory solutions are going to have to be quite interesting... (via Slashdot)
2000/3/5
Good rant about the surfeit of open-source projects: (Freshmeat)
Is there a cool KDE application? Rewrite it from scratch with the GTK+ toolkit. Don't contribute enhancements to the existing project. Don't even evaluate their codebase for potentially reusable code; that goes against the spirit of COMPETITION. You need to write something... cooler. Is there a Java version yet? Rewrite it. What about a console version? Rewrite it. A applet? Rewrite. An EPPLET? REWRITE. A pure assembly version? RE. WRITE. ... Remember that rewriting is always a more creative process than porting, and there's nothing more important in mental health than a creative outlet. Doing a search on the appindex for "icq" will demonstrate how popular this method of project development/psychotherapy can be.