Archive for the ‘Coding’ Category

Tab v Space

Coding

Many years ago, a work colleague/friend and I had a disagreement over the use of tabs and spaces in software source code. At the time, my preference was to indent my code with two spaces as I often had complex nested operations that would vanish on the right-hand side of my screen if I were using the conventional 8 spaces.

Indenting with 2 spaces:

while ( unopenedThingsExist() ) { for ( eachThing in theCollection ) { with ( opened ( eachThing ) ) { if ( lookInside ( eachThing ) == something ) { display ( nameOf ( eachThing ) ); } } } }

Indenting with 8 spaces

while ( unopenedThingsExist() ) { for ( eachThing in theCollection ) [click title to read more...]

Warning

Coding

Sometimes the only way to get a development tool installed is to compile it from source. In fact, many Open Source projects will assume this is how you intend to install. Some nice people out there might actually compile it for you and make the binaries available, but unless you have 100% trust in whoever is supplying these, compiling from source might be the best route. Perl, my Swiss Army Knife of choice, has many contributors offering modules that go through an elaborate compile/configure/test routine. Such installation processes can take a few minutes to complete, which is often a good excuse to go get a coffee.

The build scripts accompanying such from-source resources often include liberal dollops of commentary that [click title to read more…]

npm Hell

Coding, Technology, Web

A few years back I blogged about the RPM Hell (TreeTops, Jan 2012) that came about because of ineffective dependency checking. Needless to say, this reminded a lot of people about the infamous DLL Hell from many years prior. DLL and RPM dependency issues have generally been overcome with a variety of approaches and improvements in the tools and operating environments. Pushing functionality onto the Web or into the Cloud can help move the problem away from your local machine. After all, if the functionality is now just some JavaScript on a Web page then this shouldn’t be affected by whatever mess of libraries are installed on your local machine.

That worked for a while. Eventually the JavaScript workload grew [click title to read more…]

Sync or swim

Coding, Technology

The headline article in last month’s Communications of the ACM (“Attack of the Killer Microseconds”1) got me thinking. The article was drawing attention to the fact that computations are now happening so fast that we now must now even consider the time it takes data to move from one side of a server warehouse to the other at the speed of light. Multi-threading (a)synchronous programming methodologies need to be re-thought given that the overheads of supporting these methodologies are becoming more of a burden compared to the actual computation work being undertaken.

That is not what got me thinking.

What got me thinking was a point being made that despite our generally held belief that asynchronous models are better performers [click title to read more…]

Crypto fix for Strawberry on Windows

Coding

Adding PKCS10 support for one of my Perl installations turned out to be a bit of a hunt. It seems that that the makefile config is referencing the “crypto” library instead of the Windows equivalent, “eay32”. The clue was early in the installation trace where it said:

Warning (mostly harmless): No library found for -lcrypto

Mostly harmless. Not so. It affects more than just the PKCS10 that I was trying to install. Anything needing the cryptographic API from OpenSSL will be affected. All the suggested fixes for this problem that I could find (in a 10 minute trawl) involve editing the makefile (e.g. this) but there’s a much easier fix. Simply locate the “c/lib” folder in your Strawberry [click title to read more…]