Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  Five-minute Multimethods in Python

So what are multimethods? I'll give you my own definition, as I've come to understand them: a function that has multiple versions, distinguished by the type of the arguments. (Some people go beyond this and also allow versions distinguished by the value of the arguments; I'm not addressing this here.)As a very simple example, let's suppose we have a function that we want to define for two ints, two floats, or two strings. Of course, we could define it as follows:def foo(a, b): if isinstance(a, int) and isinstance(b, int): ...code for two ints... elif isinstance(a, float) and is...

2,343 0       PYTHON MULTIMETHOD ARGUMENT LIST VERSION OVERLOADDING


  Google Dart? Don’t bet against JavaScript

Procotols, programming languages and operating systems all compete in a constantly evolving software ecosystem. Out of that ecosystem only a few technologies truly have staying power and survive over the long term. An example? How about Ethernet? It’s been a survivor over the last thirty years despite existing in a constantly changing landscape that’s been populated with many worthy competitors. Ethernet’s grasp has been so strong, there even an informal law, known as Metcalfe’s second law, that says “nev...

26,545 0       GOOGLE DART JAVASCRIPT COMPARISON FUTURE


  The Mature Programmer

1. The Mature ProgrammerThe mature programmer manages their own time and productivity well. The MP knows that maintenance is as much work as the initial writingand code always takes longer than you think. The MP knows that any changes to code can introduce bugs, no matter how seemingly trivial.The MP knows that premature optimization is foolish and dangerous. The MP knows that sexy coding like writing big complex systems fromscratch is rarely the best way to go. The MP does not get into ego competitions about who has the prettiest code. The MP acheives thebest final result in the minimum ...

2,397 0       EFFICIENCY FEATURE CODING STANDARD MATURE PROGRAMMER MP


  How Integers Should Work (In Systems Programming Languages)

My last post outlined some of the possibilities for integer semantics in programming languages, and asked which option was correct. This post contains my answers. Just to be clear: I want practical solutions, but I’m not very interested by historical issues or backwards compatibility with any existing language, and particularly not with C and C++.We’ll start with:Premise 1: Operations on default integer types return the mathematically correct result or else trap.This is the same premise that as-if infinitely ranged begins with, but we’ll perhaps end up with some different ...

2,087 0       ALGORITHM NUMBER SYSTEM EMBEDDED SYSTEM


  In praise of impractical programming

Although it’s become a cultural mainstay now, I still remember when I first saw that thick book — the one with the wizard on the cover — about a school for magic where wonders are easily conjured by those who know the proper spells. Of course, I’m talking about the Structure and Interpretation of Computer Programs. There was that other book with the spells, but the “Wizard Book” sincerely claimed to teach magic.For the past few years, I’ve been working as a software developer in the newsroom, where perceptions of my kind have changed from novelty ...

2,699 0       IMPRACTICAL PROGRAMMING STRUCTURE SCHEME PRACTICAL


  Macro vs. Micro Optimisation

So there's recently been a bit of hype about another Colebourne article: http://blog.joda.org/2011/11/real-life-scala-feedback-from-yammer.htmlI'd like to respond to a few points he makes.First - You should evaluate Scala and pay attention to its benefits and flaws before adopting it.  Yes, there are flaws to Scala.   Working at typesafe makes you more aware of some of them.  We're actively working to reduce/minimize/get rid of these.   In my opinion, the negatives of using Scala are peanuts compared to the postives of choosing Scala over Java.  I think everyone s...

2,837 0       SOFTWARE PERFORMANCE OPTIMIZATION MACRO MICRO


  Only fast languages are interesting

If this isn’t a Zawinski quote, it should be.I have avoided the JVM my entire life. I am presently confronted with problems which fit in the JVM; JVM libraries, concurrency, giant data: all that good stuff. Rather than doing something insane like learning Java, I figured I’d learn me some Clojure. Why not? It’s got everything I need: JVM guts, lispy goodness; what is not to love?Well, as it turns out, one enormous, gaping lacuna is Clojure’s numerics performance. Let’s say you want to do something simple, like sum up 3 million numbers in a vector. I do shit l...

2,447 0       PERL FAST LANGUAGE CLOJURE JVM SLOW LUSH


  Method chaining and lazy evaluation in Ruby

Method chaining has been all the rage lately and every database wrapper or aything else that’s uses queries seems to be doing it. But, how does it work? To figure that out, we’ll write a library that can chain method calls to build up a MongoDB query in this article. Let’s get started!Oh, and don’t worry if you haven’t used MongoDB before, I’m just using it as an example to query on. If you’re using this guide to build a querying library for something else, the MongoDB part should be easy to swap out.Let’s say we’re working with a...

3,087 0       RUBY IMPLEMENTATION METHOD CHAINING LAZY EVALUATION