The Paradox of Programming Languages

Published at 20:57 on 14 November 2013

I care so much about programming languages principally because I don’t care about computer geekery that much, at least not as much as most computer programmers do. I can’t really geek out on learning a programming language. Just give me something that’s simple and well-designed and therefore not much work to understand and use.

That me averse to overly-complex languages like Ruby, Perl and particularly C++. Why would I want to piss away my valuable time becoming proficient in one of those when for less investment in time I can be proficient in something simpler and easier like Java, Python, or C#?

It means I can spend less time worrying about computer programming and have more brain cells to devote to other things.

There is No Excuse for Not Having GC

Published at 10:45 on 1 January 2013

About five years ago, I set out to learn C++. I gave up after a few days when I ended up going down the rabbit hole of what’s on the heap, what’s on the stack, and what can be freed when. It was an enormous headache, and nowhere was it clearly and succinctly explained.

And it wasn’t even necessary to worry about. Modern languages like Java, Python, and C# all have garbage collection. Program in one of those and you don’t ever have to care much about memory management. The language subsystem that runs your programs does it all for you.

Given that memory leaks are one of the most common, and one of the most difficult to track down and resolve, classes of bugs, this is a win of simply monumental proportions. It is unfathomable why one would wish to voluntarily relinquish such a boon.

The standard answer to this observation is to point out that there are certain timing-dependent programs (typically ones that access raw devices), where GC gets in the way and can cause lost data.

I don’t think this argument has much validity when it comes to arguing in favor or not providing GC. Rather, it is an argument in favor of providing the programmer with control over GC. All one needs are four basic operations:

  1. Turn automatic GC off.
  2. Turn it back on again.
  3. Perform a GC cycle manually.
  4. GC a single datum manually.

With those, one can do timing-critical programming and not have GC get in the way one bit.

By turning GC off and reclaiming things on a case-by-case basis as needed, one can even use the same memory-management paradigm that primitive, functionally obsolete languages like C++ mandate you to use. Even if you do that, you can still perform occasional invocations of manual GC cycles, and log error messages if anything got garbage collected, and your program will detect its own memory leaks.

About the only rationale I can think of for not having GC at all is that one is writing some sort of embedded code on hardware so limited that there is not memory or CPU cycles available for it. That’s almost certainly a tiny fraction of all programming tasks.

Fscking Spammers

Published at 20:54 on 20 August 2012

It seems as if one of my recent posts has attracted the attention of search engines, probably because in relating how I solved a Macintosh frustration, the information has proved helpful to others.

So far, so good. The bad news is that’s attracted the attention of spammers. No, they’re not getting any spam posted: I have several lines of defense against that. But they are getting through the first line of defense: the captcha on the comments form.

They’re probably doing that with the free porn scam, in which one writes some back-end software to impersonate a browser (not hard to do; I’ve done so many times for legitimate purposes), and presents the captcha image to someone who wants to be rewarded by viewing some porn for free if they solve it. The front-end that displays the porn then passes on the solution to the back-end, which uses the information to send back a form response containing the spam.

It’s a pretty minor irritation, but an irritation nonetheless. Maybe I’ll get motivated to go through my server logs and start reporting them to those responsible for the IP addresses the requests are coming from.

iTunes Video: A Complete Ripoff

Published at 09:23 on 18 August 2012

Note to all: avoid iTunes videos that you must pay for like the plague.

I had been wanting to watch some Portlandia episodes , and last night tried to with iTunes video. Big, big mistake. After charging me $2.99 and commencing the download, iTunes sneeringly informed me that I could not watch said video on my computer, and then launched into a paragraph of arcane technobabble that even I could not understand at first.

Apparently, some lame copy-protection scheme mandated by the Hollywood studios considers all but a select few Macs a piracy threat, presumably because the digital video signal going between the system unit and the monitor could be used to create a decrypted, free copy of the video.

Of course, that’s no excuse for iTunes’ bait-and-switch behavior. iTunes could obviously tell if the system it was running on was unacceptable to Hollywood (hence the message); there’s no reason whatsoever for not sending it before you pay for a video and start the download. None except pure greed on Apple’s part, that is.

While researching the issue, I came across a comment in passing that mentioned BitTorrent and pirated copies of videos. A light went on. I downloaded BitTorrent, downloaded an AVI video player, typed in a few Google keywords, and within a matter of minutes BitTorrent was merrily downloading the content Apple had previously defrauded me for. Content which actually played.

And the BitTorrent download proceeded far faster than the iTunes download had. Just for yucks, I tried it again with another episode and that one arrived promptly and without issue, too.

Way to go Apple and Hollywood: you’ve successfully made it so difficult and risky for customers to pay for content that they opt for the easier option of pirating it instead.

An Executive Summary of Ruby

Published at 10:06 on 15 June 2012

I’m having to learn it for work purposes, and have already studied the language enough to be able to offer the following brief executive summary:

Ruby is a merger of an elegant, Scheme-like language which offers functional programming and metaprogramming with an ugly Perl-like syntax and design philosophy.

Avoid the Motorola SBG901

Published at 15:16 on 20 May 2012

If you’re in the market for a DOCSIS 2.0 cable modem, I suggest you avoid the Motorola SBG901. Based on my experience, they’re pieces of unreliable junk.

I’ve now tried two, and they both exhibit the same symptom of continually rebooting themselves (causing a lost connection) every few minutes. The modem I’m presently renting from my broadband provider, the Ambit U10C018, almost never does this, so it’s not an issue of my signal from the cable company being weak or unreliable.

Given that two completely different samples have behaved in the same way, I would also have to say that the odds of this being two random defects are pretty low. It appears to be a design defect of this product. A Google search on “motorola sbg901 keeps rebooting” comes up with more than a few matches of others who have run into my problem, which provides further  evidence of a design defect.

It’s a pity, as the Motorola product has the desirable feature of combining a wireless access point with a cable modem in one box.

What’s the iPad Good For?

Published at 00:13 on 7 April 2012

Having just received one as a generous and unexpected gift (witness previous entry), I’m trying to puzzle that out for myself.

It’s significantly bulkier and heavier than my Slingshot Organizer or the scraps of paper I write shopping lists on, so I cannot see it replacing either.

It’s also significantly heavier than my paper journal book, though it ties it in bulk. However, typing on a “keyboard” that appears on a touch screen is every bit as slow and error-prone as it always seemed to me it would be, so it’s of limited utility as a journal-entering device. A keyboard would rectify this (and they are available), but then the result would be both heavier and bulkier than what it replaces.

It’s also much heavier and bulkier than my MP3 player, and it’s an awkward form factor to use as a camera.

That leaves a device suited primarily to the consumption of information in digital form, be it in the form of Web pages or e-books, one which can be pressed into service for entering text if that need should arise. It is definitely less heavy and bulky than the alternative of a laptop computer.

If you purchase an adapter, it also possible to download images from a digital camera into an iPad. The same advantages of less weight and bulk (compared to a laptop) apply in this case, too.

So, it’s a nice gift that will at times come in handy, but I also don’t expect to be carrying it with me routinely; the things it does better than the existing alternatives tend not to be things I do all that frequently away from home.

Test

Published at 14:50 on 6 April 2012

Test of creating a post from new iPad. Well, this confirms what I’ve always thought about touchscreen “keyboards”: they won’t ever put mechanical ones out of business.

Bad Web Design Example of the Day

Published at 12:08 on 3 February 2012

Just what is that fourth character, anyhow? A lower-case letter O that’s been stretched and distorted to the size of an upper-case one? An upper-case letter O? The numeral zero?

There’s no way to tell, of course, save to take a wild guess. A guess where you have 67% odds of guessing wrong (yes, it’s case-sensitive, so “O” is not recognized as “o”). And if you guess wrong, guess what? That’s right: you get presented with brand new CAPTCHA! Which, given the number of characters in it, odds say will probably contain at least one “C”, “c”, “O”, “o”, “P”, “p”, “V”, “v”, “W”, “w”, “X”, “x”, “Z”, “z”, or “0” character.

Charming. Simply charming.