Website of Martin Sústrik, creator of ZeroMQ, nanomsg, Mill and ribosome.

Blog about software design, economics, complex systems and psychology of programming.

The Clockwork inside Game of Thrones

When Ned Stark got executed by the end of first season of the TV series everyone went like: Ugh! Not possible! He's the protagonist! He just cannot die like this in the middle of the story! Ridiculous! What's the next season going to be about? The deep sense of confusion that the event causes is he result of a completely new story-telling device invented G.R.R. Martin. And when I say completely new I don't mean it in the sense of the best one this season but rather as I cannot think of such...

Comments: 0

Bullshit jobs

There have been a nice article by anthropologist David Graeber about what he calls bullshit jobs. I recommend to read it in full, however, in case you don't, here's a short summary: In 1930's Keynes, reflecting on the improving productivity, predicted that by the turn of century we should be working only few hours a day. The productivity did in fact improve but, surprisingly, the working hours are longer today than they've used to be back then. So what's happening here? Mr. Graeber attributes...

Comments: 12

Magic numbers in C

I was asked today why I often use magic numbers in my code. It's a small issue, but I feel passionately about it as the current trend of replacing every constant by a symbolic name is extremely annoying. And insistence of some code analysis tools on treating all magic numbers as coding style errors drives me crazy. Just the give you the context, here's an example of magic number: i = i + 4; And here's a fixed version of the code: #define FOO 4 ... i = i + FOO; There are certainly cases...

Comments: 2

Are you a programmer-mathematician or a programmer-handyman?

I always assumed that programmers hate complex tools and, if given the option, choose simple tools that get the task done over complex multi-purpose ones. (And that complexity we encounter in the tools these days is mainly because develops are paid by hour rather than by delivery. If dealing with a complex tool meant you'll miss your kid's baseball game rather than just the project schedule slipping slightly, there would immediately be an enourmous pressure on tool developers to keep the tools...

Comments: 38

Idiot's Guide to ABI Versioning

Libtool ABI versioning is used in both nanomsg and ZeroMQ, so I've been dealing with it for a long time now. However, for some not completely obvious reason it seems almost impossible to remember how it works. I've observed myself as well as other people forgetting the rules over and over again. This short article is my attempt to formulate libtool ABI versioning rules in such a way that they can be actually remembered. First of all, don't think of the ABI version major/minor/patch version, e.g....

Comments: 0

Unit Test Fetish

I hear that prople feel an uncontrollable urge to write unit tests nowaydays. If you are one of those affected, spare few minutes and consider these reasons for NOT writing unit tests: 1. Return on investment of unit tests is an order(s) of magnitude lower than that of end-to-end tests. If you write a single end-to-end test the execution of the test will probably cover a substantial part of the codebase: If you write a single unit test, you cover just a small piece of the codebase: If you are...

Comments: 23

Design of PUB/SUB subsystem in ØMQ

This article was originally written on June 23rd 2011. As there was some discussion of subscription forwarding on nanomsg mailing list, I am republishing an enhanced version of the article it in this blog. Introduction PUB/SUB (publish/subscribe) is a messaging pattern used to distribute data to arbitrary number of subscribers. In context of ØMQ the focus with PUB/SUB is on scalability, ie. on ability to add more subscribers to the system without overloading it. Minimising Network Traffic Aside...

Comments: 0

Code Generation & Visual Smog in Code (part II)

(continued from the previous episode ) 14. Now that we've dealt with repetitive code and escape sequences, here comes the actual meat of the problem: The indentation. Indentation is a way to employ the 2D shape recognition capability built into the human brain in the service of understanding the code. If the indentation is broken, our innate 2D scanner switches off and we are left with having to understand the structure of the code the hard way, the way the compilers do. This off-switch of...

Comments: 2

Code Generation & Visual Smog in Code (part I)

1. I am reading that code generation then called automatic programming originally referred to the automation of the task of punching the paper tape. Later on it became to mean generation of the real code from a higher level language like, say, Fortran. Today it's not longer about creating full-blown programming languages. It's still about compilers, but rather about compilers for ad hoc, domain-specific and thow-away languages. 2. Technically, to implement a compiler one needs two major...

Comments: 2

In the Defense of Spaghetti Code

Have you ever seen a function that spans 1500 lines of code? At that point every semi-decent programmer curses spaghetti code in general and the author of the function in particular and embarks on the task of breaking it into managable chunks, trying to decompose the problem into orthogonal issues, layer the design properly, move the common functionality into base classes, create convenient and sufficiently generic extension points et c. If done properly, they'll end up with well-defined...

Comments: 25

Poor Man's Scientific Method

I've had the following conversation with my girlfriend lately: A: Let's vaccinate our kid. B: But I've heard that vaccination can cause autism! A: It's a hoax. There's no scientific evidence for the claim. Use scientific method. Read the related papers. B: But I've searched for the papers on the Internet and I've found one that claims that vaccination causes autism. A: You've got the wrong one. There are others that prove there's no correlation between vaccination and autism. B: How...

Comments: 16

The Second Step Towards Immortality

There have been some talk about achieving immortality via Internet. The idea was that if you store all your personal data, basically your stream of consciousness, in Facebook or Twitter (and, of course, NSA reconds), some of your identity, your memories, speach habits, sense of humour, survives even your death. While that seems to be a pretty diluted form of immortality, comparing it to the past reveals that it is actually a huge step forward. As for your great-grandparent born around 1900, you...

Comments: 8

Bitcoins & Deflation

Once again I've stumbled over an article today that suggests that the big problem with Bitcoin is deflation. The overall amount of Bitcoins is fixed, thus, there's no way to inflate the currency and the only possible outcome is ever increasing value of the coin Consider the following facts though: All the Bitcoins will be mined in approximately 100 years. The human population will reach its peak in 100 years and starts declining afterwards. Comment: Pt 2 is the official UN estimate. I've also...

Comments: 9

Fighting Efficiency

As tasks are getting automated and don't require much human intervention anymore we are heading to the world where 10% of population would be able to produce all the goods needed. While that sounds like a good news at first, there's a big question lurking in the background: How is the 90% going to make their living? They are not. If nothing changes they are going to die of hunger. And even worse, once that happens there will be only 10% of the population left, so the market shrinks to one tenth...

Comments: 9

The Pashalik Syndrome

Ottoman Emptire was composed of administrative units called pashaliks (in the west) or eyalets (in the empire itself). Each pashalik was headed by pasha, a dignitary with absolute power within the confines of the territory. Pasha was in charge of military as well as of finance, police and justice. In other words, he was a little sultan within the pashalik. The only drawback of being a pasha was that the position was temporary. Pashas were appointed by sultan or grand vezier and could be removed...

Comments: 0

Beyond Rational Idiotism

Yesterday, I've stumbled over an interesting article: Contracts Without Trust or Third Parties. It proposes a way to create contracts in such a way that they don't have to be enforced by third parties (legal system, police, bank etc.) The primary example is selling things over internet. The contract should ensure that neither party cheats and decides not to deliver goods or money as agreed beforehand. In short: I am selling you a book for $10. Each of us makes a deposit of $30, then we lock the...

Comments: 4

Tragedy of the Commons and Tragedy of the Privately Owned Land

Familiar with the parable called Tragedy of the Commons ? It goes like this: Villagers share grazing land. Instead of each one having their own fenced piece of it, they are all free to use the whole extent of the pasture. Every villager owns one cow and everything works great. One day a local idiot realises that he could get rich by having more cows. He buys ten cows and uses the common pasture to feed them. Other villagers get pissed off bacause: First, the idiot gets richer than them. Second,...

Comments: 9

Public Key Encryption for Kids

While everybody is using public key encryption, it's not at all obvious how it works. The whole idea is counter-intuitive. Everyone can encrypt a message but only one person can decrypt it? Really? Are you kidding me? However, when you try to gain some confidence in the system if for nothing else, just to make sure that it's not a hoax played on you by the cryptographers you are pointed to scientific papers: The system works like this: [complex math]. The system is secure because: [more...

Comments: 0

Backdoors in Encryption Standards and How To Fight Them

In the last week there a lot of discussion of malevolent parties putting backdoors into encryption standards and how to prevent it. There have been a long thread at IETF mailing list about the topic (starting here). NIST re-opened one of its standards due to worries that the backdoor was built in by NSA (see here). And so on. It may happen that security agency walks into a standards body and demands that the backdoor is built in. That is a rather trivial case and it can be handled by adjusting...

Comments: 0

nanomsg: Towards Full-Blown Configuration Management

There have been no administrative functionality in ZeroMQ, nor there is one in nanomsg. Adding such functionality is currently being discussed on nanomsg mailing list and I feel that it may prove confusing for those not directly involved in the discussion. This blog post thus tries to introduce the basic idea and the use cases without digging too deep into the implementation details. When you are connecting two components via nanomsg, you typically do it something like this: nn_connect (s, ...

Comments: 21

page 1 of 3123next »

Website powered by Wikidot.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License