In 1983, Tom Duff needed to copy memory into an output register faster than his compiler could manage, and wrote the most famous abuse of switch in the history of C. I ported his device to JavaScript and raced it against the plainest possible loop — and the verdict changed with the engine, the engine’s version, and the CPU underneath. 

“Go To Statement Considered Harmful” is one of the most-quoted titles in programming, and almost nobody reads past it. The argument underneath is narrower than the slogan it became — and the reflex it bred, avoiding every jump, produces code worse than the goto it was meant to replace. 

Efficient resource utilization was at the forefront of computing from the very beginning. Over time we traded some of that efficiency for developer experience, and preserved the rest by harnessing better hardware and new paradigms: multithreading and multiprocessing, stream processing 
, asynchronous programming… Languages are how we reason about problems, encode algorithms, and organize…
We spend a lot of effort making code run and almost none making it argue . An invariant is the cheap proof tool that turns “I think this loop is right” into “I know it is” — and we already use them without naming them. 

Most of the numbers that decide an architecture can be settled on the back of a napkin, before a line of the prototype is written. A handful of formulas and a latency ladder you can recite from memory rule out bad designs a profiler could only catch after they’re built. The same numbers expose the quieter traps — like a redundant trio of replicas that one dead node takes down whole.…
Tests are a cornerstone of modern development, and somewhere along the way we started treating a green suite as proof. It isn’t: it tells you the cases you thought of still pass, not the ones you didn’t. That confusion was always with us — and it matters more now that an AI agent might be the one chasing the green. 

I once needed the SLA for an endpoint my dashboard leaned on, so I asked the team that owned it. Their lead came back with 200ms ± 500ms . Read that literally and the fastest responses arrive 300ms before the request is even sent. The number wasn’t malicious — it came straight out of the standard formulas. The formulas were wrong for the data, and that mistake is everywhere. 

The third article in the series, still on conditions . The previous installment 
 was about their shape — merging if s, factoring shared decisions, dropping checks that earn nothing. This one reaches for the other lever: the algebra of the conditions themselves — not a textbook tour, just the handful of transformations I lean on in everyday code. 

Great programmers cheat. A hard problem gets quietly swapped for an easier one; a transaction-grade database is replaced by a flat file nobody misses; machinery everyone else considers mandatory simply never gets built. They know a lot — and that’s exactly why they get away with it. 

The second article in the series. The first 
 was about control flow ; this one stays with the same tactic — reshaping code — one layer down, at the condition . Here: merging if s, factoring shared decisions, and dropping checks that earn nothing. The Boolean algebra of conditions — De Morgan and friends — is a different lever, and gets its own installment next time. 

The first time I said “code is cheap” out loud in a meeting, a manager waved at the budget — headcount, salaries, the tooling line — and asked which part of that looked cheap. He wasn’t wrong about the number — he was wrong about what it was buying. 

You can find plenty of articles about design — where and how to use SQL, NoSQL, message queues, Redis, VMs, and so on. Almost nobody writes about tactics : the actual coding. It borders on style, but it isn’t just style. This is the first article in a series on tactics I use day to day. Highly opinionated — I don’t expect you to follow it. Look, chuckle, think about it, and use what…
How a slow first cut, a surprising benchmark, and a tour through V8’s regex engine landed five small libraries on npm that still earn their keep a decade later. 

-->
 
 As programmers we rarely have a luxury to write a project from scratch. Usually we have
to retrofit existing projects with all cool things we need. If a new component, or a library
we want to use introduces new concepts that bleed outside its boundary, we have a “culture clash”,
when old code is unaware about new concepts have to work with it anyhow.…
-->
 
 Incomplete objects allow us to concentrate on important properties of JavaScript objects
ignoring the rest: we don’t need to specify every single property, and we can deal with
cyclical graphs. 
 Incomplete arrays is a complimentary feature to inspect only the first few array items. 
 Both features are very useful for patterns, and heya-unify 
 provides…
-->
 
 Custom unification in heya-unify 
 allows us to deal with our specific objects in JavaScript,
create unification helpers, and even custom logical conditions. It is there to bridge unification
with our existing projects. 
 
 Looking at the 1st part 
 and
 the 2nd part 
 of the series is recommended before diving into details. 
 Custom unification…
-->
 
 Unification for JS 
 introduced heya-unify 
 —
a practical mini library to leverage unification in JavaScript. This post explains when
it makes sense to use unification, and gives practical examples of how to use it. 
 
 When to unify? 
 Below is my laundry list for unification. As soon as I see a project, which deals with items on
the list, I…
-->
 
 Unification is a very interesting programming tool. Originated from logical programming
(its the foundation of Prolog) and used in functional programming (e.g., Haskell) it helps
to compare objects for equality, identify known patterns, and reassemble results differently. 
 Wikipedia gives a somewhat complex definition 
 of unification, but many people see it…
-->
 
 Time and again working on big web applications we customize files based on user’s platform,
and their preferences. We can send different files to legacy browsers, different CSS and JS to
mobile browsers depending on their form factor, different images to accomodate bandwidth requirements,
and so on. 
 This post was prompted by my desire to serve sprites…
ClubAjax 
 invited me to speak about technologies behind Heya 
, specifically about code generative solutions behind heya-pipe 
. Pipes are built on a firm foundation of functional programming (FP), and it allows us to use a wide range of technologies to optimize their performance including generating code on the fly (code generation AKA CG). 
 As soon as we are talking about CG,…
After 8 years I decided to switch to Octopress 
. Being a server-less framework, it allows my web site to scale better, and, the most important thing for me, reduces expences on administring an active server (less active components to update). An additional bonus is that it reduces requirements for a web site host, which allows me to be more flexible when selecting a hosting company.
I spoke at ClubAjax 
 about optimization of modern web applications. Usually I speak about theoretical matters, but this time I decided to go practical. This is a huge topic and it was blogged/debated/presented to death, including my Improving performance… 
. Yet I decided to add to it after realizing that many things have changed in last years, including how we build web applications. I…
Once I wrote a blog post On JavaScript, EDP, and 0ms timeouts 
, which discussed a "smart" trend to pepper code with timeouts of … 0ms: setTimeout(f, 0) . Authors of those "programming pearls" genuinely believed that this code reschedules a function call to the next available time slice after the code that set the timer was executed without introduction of a delay (after all it is 0ms!). In…
Finally : my open source JavaScript project DCL 
 is built on ideas described in this article. Available for node.js and modern browsers, it implements OOP with mixins and AOP at "class" and object level. Read documentation and background articles on www.dcljs.org 
, clone its code on github.com/uhop/dcl 
, and follow @dcl_js 
. 
 Once again I was invited in ClubAjax 
 to…
Finally: my open source JavaScript project DCL 
 is built on ideas described in this article. Available for node.js and modern browsers, it implements OOP with mixins and AOP at "class" and object level. Read documentation and background articles on www.dcljs.org 
, clone its code on github.com/uhop/dcl 
, and follow @dcl_js 
. 
 Almost any Java programmer, who starts to study…
Many years ago I decided to replace plain text areas in Django’s Admin with rich text editor, so I can edit HTML on my blog using WYSIWYG. Six (yes, 6) years ago I looked around and selected 
 TinyMCE 
. Over time it turned out that I was forced to upgrade TinyMCE and the link script I had because new browsers continue breaking my rich editor editing. Finally it stopped working again…
What happened to Dojo in 2008? This question was asked on StackOverflow. This is my personal take on the matter: on Dojo, jQuery, history, mistakes, marketing, social vs. technical, and communities 
.
This month I continued my presentation at ClubAJAX 
. Last time 
 I did a survey of what is available in JavaScript, and concentrated on object-oriented (OOP) and aspect-oriented (AOP) techniques. This time I continued the survey, and talked about functional programming (FP), and domain-specific languages (DSL). And as promised I touched the code generation facilities too. 
 I suggest…
Today at dojo.connect 
 I did a presentation “RAD CRUD”: rapid development of form-based applications. It continues my other presentation “CRUD with Dojo” 
, but it is more in depth, targets Dojo developers, and contains some advanced material. 
 Direct link: RAD CRUD 
. 
 
 
	 
		 
		 
		 
		…
I was asked to talk about advanced JavaScript techniques at the last monthly meeting of ClubAJAX 
 — monthly get-together of Dallas-area JavaScript programmers. Instead I ended up talking about leveraging cool JavaScript features to implement well-known programming techniques and paradigms: OOP 
, AOP 
, FP 
, and so on. 
 Unfortunately I couldn’t finish in time, so I did…
Wolfram Kriesing 
 asked 
: 
 
 Somehow I have the feeling that you can bend dojox’s charting module to look and feel like http://highcharts.com/ 
 — will be for free. 
 
 Yes, it is relatively simple. To prove a point I wrote a quick-and-dirty demo available here: Tribute to Highcharts 
. Obviously not everything matches 100%. Go and judge for yourself. 
…
My presentation at ClubAJAX 
 got off to a rocky start: I was let in the
building 40 minutes after I was supposed to start the presentation.
Everybody waited patiently. Thank you guys! As promised I publish slides along with relevant links (I had to skip most
of planned demos). 
 Here is my presentation on SlideShare 
: CRUD with Dojo 
. The original presentation can be…
Time to time I sync my blog software to the Django trunk and
introduce small enhancements. Some of them visible to my readers,
some of them are just for me. This time after reading Simon Willison 
’s post on rev=canonical 
 I decided to add short URLs to my blog as well. This is a convention
to provide custom short URLs managing the mapping on your own web
site. In my…
Steve Yegge 
 is one of the bloggers I read almost religiously. His posts are full of insights on the software development topics and in general, and he is always ready with an amusing anecdote from his rich life. His last post Have you ever legalized marijuana? 
 didn’t disappoint either. The author explains “Shit’s Easy Syndrome” (a difficult topic even for…
Explaining some dark corners of JavaScript, browsers, or Dojo for the 100th time I realized that I already did it on numerous occasions, and some of my answers are published on public web sites. So I decided to round up the most general ones I posted on StackOverflow 
 and publish links to them here for a future reference. 
 JavaScript 
 This section is for language-specific topics.…
As you may know today Google released Friend Connect 
. I decided to give it a try. It took about 20 minutes to set up my blog with 4 gadgets: Members, Sign In, Rate/Review, and Wall/Comments. It took about 30 minutes to separate the skin from all these widgets, and set up the Canvas so users can see gadgets in a separate window, if they want to. 
 Google Friend Connect doesn’t have…
In the previous post 
 we explored “array extras” and how they can help us to write concise yet performant and clean code. In this post we take a look at generalizing recursive algorithms with recursion combinators — high-level functions that encapsulate all boilerplate code needed to set up the recursion. These functions were added to dojox.lang.functional and will be officially released with…
Finally: my open source JavaScript project DCL 
 is built on ideas described in this article. Available for node.js and modern browsers, it implements OOP with mixins and AOP at "class" and object level. Read documentation and background articles on www.dcljs.org 
, clone its code on github.com/uhop/dcl 
, and follow @dcl_js 
. 
 If we look at the history of computer…
Yesterday Google announced 
 its new offering: Google App Engine 
. These are my random notes I did yesterday when I studied the new service. 
 Google didn’t go the same way as Amazon with its AWS 
. The former offers a form of shared hosting (think “distributed WebFaction 
”), while the latter offers a virtualized environment (think “distributed…
As you all know by now Dojo 1.1 was released in the wild 
. You can get a lot of useful links and info from James Burke’s post on Dojo 1.1 
, but let me tell you why you should be excited: 
 
 Dojo 1.1 is the first official release, which contains dojox.lang.functional 
. It was available in the trunk for awhile, but now you can use it without deploying Dojo courtesy of…
What makes JavaScript so different from other languages? Is it its
dynamic nature? Its prototype-based funky inheritance? No. The most
unusual thing for newcomers is how JavaScript programs handle the
workflow. The program looks like a bowl of spaghetti. There is no start
or end of the program. What we have here is a bunch of functions, which
are called in response to some…
I just finished the first cut of the dojo.dnd 1.1 technical documentation 
. Let me use this post to remind you about the dojox.gfx 1.1 documentation 
. I hope I satisfied the curiosity of many developers, but the ultimate proof will be the number of simple questions on Dojo Forum 
. Let’s hope it will go down. And don’t forget that the Dojo Book 
 has a DnD chapter…
F/OSS 
 is a phenomenon of the modern life. But what makes it successful? Ben Laurie 
 is convinced that Open Source Is Just Economics 
. I beg to differ. Yes, it does make sense for several companies to gang together and develop something jointly. And they did it for years without the open source. Not always successfully, but they did it. For example, IBM has cooperated with Microsoft…
Everybody knows that JavaScript is a multi-paradigm language, and it can be used to program functionally. Practically all functional idioms can be used directly: higher-order functions, recursion, closures, and so on. The recent resurgence of Functional Programming (FP) brings functional methodologies in the mainstream. FP fundamentals gave us a lot of powerful idioms: iterative functions, which…
I published first day pictures from PyCon 2007. They are raw, unedited, I didn’t put descriptions yet. You can recognize Django guys, people from multiple Python web frameworks, and, of course, the BDFL with OLPC. But why wait for pictures to be prepped? Dig in while they are raw and fresh: 
 

 Yes, this is Steve Holden sporting a Django t-shirt.
Introduction 
 Web 2.0 brought on us an onslaught of new server-side web frameworks, and made it OK to put some code on the client side as well. Yes, I am talking about Ajax 
. While elements of Ajax were available (and used) for a long time now, 2005 was the crucial year for this relatively old technology fueled by proliferation of modern browsers with proper support of JavaScript and…
How long does it take to do a project? Software developers are asked this very question on regular basis. This is how every project begins. Why is it important? Because “time is money” and many software projects are priced mostly by time spent on the project. “We will take your project estimate in hours, multiply them by your rate in $/h, and we have our price.” Ask any…
This is the 2nd part of Setting up tools on Windows 
 — notes mostly for myself. (No, I don’t run Django with MSSQL under IronPython 
. Yet.) 
 In this installment I add more stuff to Eclipse, and set up my apps under FastCGI on Linux-based shared host (I use DreamHost). 
 
 Eclipse 
 This section was updated on 9/30/2006. 
 I already set it up with PyDev and…
Today I converted three web sites to the latest Django’s trunk formerly known as the magic-removal branch. It was a very positive experience in general. New Database API with lazy database queries (courtesy of QuerySet ) rocks! Direct interaction with model classes allows doing a lot of things much simpler than it was before. A lot of small improvements, which makes a big difference like…
Yes, another Google SoC 
 is upon us. I signed up as a mentor with Dojo 
 and Django 
. Both projects are on the leading edge of new wave of web-based applications doing extremely cool stuff. I anticipate that some smart students will bridge both projects, but individual projects are fine too. 
 What is Google SoC? Read the FAQ 
. Who can apply? Any student anywhere in the…