Categories
programming project management

Source Code: never distribute an app as “source code”

I just ran into a 2004 piece of FREE software that I wanted to use, but can’t, because of poor choices by the original author. I’m posting this because I think the ideological reasons behind those choices are now “of historical interest only” and I’m liable to forget them completely a few years from now – but the underlying issues remain.

Especially in a world where Android, on a marketing platform of “openness”, is competing with iPhone, on a platform of “all users are lazy or idiots”.

(As a user, I hate being treated like an idiot. Except when it means a computer does all the work for me. Fair? Reasonable? Nope! When it comes to users … developers can’t win :) )

How should you distribute an application?

There used to be a raging debate, for decades, about the “correct” way to distribute applications. A bunch of well-meaning (but IMHO un-wise) Open Source programmers advocated:

“The only way to distribute a program … is as raw Source Code”

This was not about “is Open Source good?” – this was *in addition to* making source available. The question was: should you send people a copy of the source – or should you compile / package binaries (one-click applications) for people to download and “just run”?

The debate seems to be dead (finally), with the world coming down on the side of practicality, rather than theory/ideology. I’m not entirely happy with that – but it always felt obvious to me that it would go that way. I think the App Store in particular has gone a long way to “proving” it once and for all: people who want apps … want apps. They don’t want source code. Even if having the source would sometimes help.

2012: a worthy project that’s dead and useless

Today I ran into a tool that concretely demonstrates the futility of the “only source code is correct” argument: SLOCcount

The project as it stands is unusable unless you happen to be running one of the two linux distros where people have built the binary – or you’re willing to waste anything from “hours” to “days” of time “configuring” the app.

(with a normal app, that “hours of time” is replaced by “0.1 seconds it takes to double-click the app icon”)

This is a simple command-line tool. To run it, you must:

  1. Download the source
  2. Read the usage instructions
  3. Ignore the usage instructions. Start again with the “installation” instructions
  4. Install “make” (takes 0.5-3 hours)
  5. Learn how to use “make” (takes 1-3 days, if you don’t already know it)
  6. Debug “make” (takes 0.5-3 hours)
  7. Re-write the config files for the project so that they will work with “make” (takes 0.5 hours)
  8. (probably) install a new compiler (takes 0.5 hours)
  9. (probably) install a new linker (takes 0.5 hours)
  10. Cross your fingers, pray to whatever Gods you believe in, sacrifice a lamb, etc
    • In case you’re unfamiliar with “make”: it typically doesn’t work on any computer except one identical to the one where it was originally tested, so you have to go through and keep tweaking and fixing until it works. Kind of. There’s no checks-and-balances – so you NEVER ACTUALLY KNOW if make has worked, you just have to hope.
    • Finally: go to Step 1 of the usage instructions, and try to use the app

No wonder people don’t use it. No wonder people don’t update it, even though it’s “Open Source”. No wonder this – otherwise useful tool – is effectively dead.

Fundamental problem?

OK, so the straw-man example above mainly comes down to:

“make” is the world’s worst configuration tool

SLOCcount was probably killed by the choice of bad tools, as much as anything else. But – how much choice did the author have, really?

The problem is – and this is the interesting point of this blog post:

(in general) Source Code does not fully describe a program; it merely describes “SOME OF the internals of a program”

To create an actual usable program you need something like (off the top of my head, I think this is correct?):

  1. Source code
  2. Programming language definition
  3. Operating System (OS)
  4. Compiler program
  5. Programming language libraries
  6. OS-specific Linker
  7. Launch wrapper

…where the final output of step 7 is collectively known as “an application” (or just “an app”).

The folks who used to argue that all code should be distributed as Source tended to use arguments about the “value” of Source Code, as if it were a valid substitute for all the above items. It was never a *substitute*, although getting the output AND the Source would have been better than the tradition of only receiving the output.

Of course, even better would have been: receive all 8 items above (all the things necessary to make the app, and the app itself).

A brighter future

And so … if you’ve ever wondered what’s inside package-management sytems … take that list of 7 items above, and go revisit your favourite system of choice.

And … bear in mind that all the above things can have complex version dependencies – e.g. “only works with library A, version greater than 2.3, but less than 2.6, or with library Aa version 7.99 exactly”. A package-manager has rather a lot to handle…

Categories
fixing your desktop Google? Doh!

Gmail NEVER LOADS in Firefox? Cookies cleared, still get a blank screen? Try this…

After trying 4 or 5 things from this several-years-old page on Firefox’s support forums, I finally hit upon one that worked:

“For the heck of it tonight I clicked on Gmail in my calendar and it finally went to my gmail inbox.”

In my case, I just went to Google Groups, and clicked the Gmail link from the top navbar. Lo and behold – it works!

(this is after a week of having no way to access Gmail from my main web browser)

Why?

Looking at the problems other people have had, my guess is that Google’s code for running Gmail has some illegal (i.e. breaks-the-standard) bits in there that try to get around the browser standards by doing silly things with caching. Some of those are … fragile, perhaps … and tend to break easily. Over time, Google has added more and more unnecessary “features” to that code (e.g. I often have to wait for “connecting to google chat”, even though I have google chat permanently disabled and will never EVER use it) … there’s a *lot* of code in there these days; lots that could go wrong!

Normally, a Refresh of a page would fix this – that’s how the WWW was designed in the first place, as a core feature – but Google’s (my guess) playing so fast-and-loose that they’re *also* (deliberately? or accidentally?) bypassing the refresh. I can imagine several well-meaning reasons they might do that, but in the end I’d rather they stuck to the standards, instead of creating these “breaks permanently” problems for people.

And, of course, there’s no Google support for this problem. Once it strikes you, GOOD LUCK! (you’ll need it)

Categories
fixing your desktop

iMac crashed; wouldn’t turn on! (black screen)

At 27″, it’s too big to “simply” take in to the Apple store. In desperation, I followed this support article from Apple that’s for older iMacs and officially no longer supported.

Which is a pity, because in typical Apple fashion, they’ve deprecated an article that’s still accurate and useful. Following the steps in that article (copy/pasted below in case Apple ever deletes the webpage – something they’ve a habit of doing, sadly), my fans roared to life and the iMac REVIVED!

Resetting the SMU can resolve some computer issues such as not starting up, not displaying video, sleep issues, fan noise issues, and so on. If your computer still exhibits these types of issues even after you’ve restarted the computer, try resetting the SMU. To reset the SMU on one of these iMacs:

Turn off the computer by choosing Shut Down from the Apple menu, or by holding the power button until the computer turns off.

[NOTE — in my case, OS X had crashed completely, so there was no “turning off” to do – I had to yank the power cable out, and after that, it wouldn’t switch on]

Unplug all cables from the computer, including the power cord.
Wait 10 seconds.
Plug in the power cord while simultaneously pressing and holding the power button on the back of the computer.
Let go of the power button.
Press the power button once more to start up your iMac.

I then had to repeat the process – but with a *fifteen second* wait, as per the support page that seems to supercede the article above – to get the fans to shut up.

Categories
games industry games publishing

Jon Blow: “almost no certification process for iOS”. LOLz.

Jon just published an interesting letter about the current state of cert processes for game consoles / platforms.

There are some real problems with certification today. Unfortunately, Jon’s post doesn’t really touch upon them, and seems to go instead after the IMHO untrue and unhelpful claim that iOS is better for having “almost no certification”. No, really:

“The certification processes of all these platform holders were based on the idea that all these steps they test are absolutely necessary for software to run robustly, and that software robustness is super-important for the health of their platform and its perception by customers.

But, look at iOS. There is almost no certification process for iOS, so by the Microsoft/Sony/Nintendo theory, the apps should be crashing all the time, everyone should think of iOS as sucky, etc. But in fact this is not what is happening. There is no public outcry for more testing and robustness of iOS software.”

Personally, I’d say that iOS has a certification process of comparable length to console cert, given the comparitive size/complexity/many-years of development in the apps, and for a couple of years it was considerably nastier than TRC’s because *it had no documentation*.

(my first hand experience: I created and maintained a large site that documented the app rejections by Apple, and interviewed the developers on what got rejected, why, what happened after the rejection, etc.)

Even with the nightmare of never knowing what the rules were, there was a positive net effect: many apps were forced to resubmit until they hit a minimum barrier of quality. Again – I know this for a fact, I had many conversations and interviews with developers about this, often getting to read their conversations with Apple. Even today, there are many apps being rejected every week for failing on basic quality / functionality / crashing / etc.

For me, that rather undermines his argument. Which is a pity, because there ARE major problems with cert – on all platforms, Apple included – and we should be focussing on them. But it’s not the idea of cert that’s at fault, it’s either the choice of items (e.g. Sony, where some of the rules come from PlayStation 1 era and are barely relevant today) or it’s the poor implementation of the process (e.g. Apple until 2011), or it’s the big chunks of stuff that SHOULD be part of cert but isn’t (…everyone…).

Categories
iphone startup advice web 2.0

Rise and fall of Microsoft’s hegemony over Apple

Building and Dismantling the Windows Advantage – a great article, telling the story in a mix of words and graphs.

“The consequences are dire for Microsoft. The wiping out of any platform advantage around Windows will render it vulnerable to direct competition. This is not something it had to worry about before. Windows will have to compete not only for users, but for developer talent, investment by enterprises and the implicit goodwill it has had for more than a decade.”

Categories
android community entrepreneurship facebook Google? Doh! marketing and PR startup advice

Google’s Strengths & Weaknesses in 2012

In the past, I’ve had terrible advice from brilliant people. The best way to avoid that is to be careful to research the brilliant person and tailor your questions to avoid their weaknesses.

Tomorrow I’ll be meeting a bunch of people at Google London’s open day. I started by writing down a list of known strengths/weaknesses based on my knowledge and experience of the company and the people. Earlier this year I had some in depth meetings with Facebook, which gave me a fresh perspective on the similarities and differences. I think the list itself is interesting – modulo: it’s only my personal impressions:

google strengths

[comments in brackets to clarify some non-obvious points for anyone reading this]

  • innovating on the Web
  • bringing native tech to Web and making it as good as native
  • software development
  • worlds biggest/most popular search engine
  • …? focus on curation ?… [Page ranking etc is subtle curation]
  • tech brand associated with “quality”
  • massive scale advertising
  • algorithms for automating heuristic tasks (imperfect, vague domains)
  • enormous scale data manipulation
  • throwing hardware at impossible problems to make them possible [Street View]

google weaknesses

  • community [in general, but also specifically: Google Groups]
  • consumer marketing [many Googlers have said “we don’t need to; the brand is enough”]
  • building products that people want, rather than products Google staff enjoy [Wave, Buzz, Google Voice]
  • understanding consumers [Android]
Categories
MMOG development

Dropbox tech scaling – some great, some not-so-great

“I was in charge of scaling Dropbox … from roughly 4,000 to 40,000,000 users. … Here are some suggestions on scaling”

The first section is a WTF – the guy advocates deliberately over-taxing your servers, without a good explanation. I’ve got some guesses at why they did it – but in the general case I’d say: never do this. Only do it when it’s obvious, because you have a specific reason to do so (and you really know what you’re doing).

The rest is a lot clearer, good advice there.

Also, IMHO worth reading for this part alone:

“Let’s say you’re trying to debug something in your webserver, and you want to know if maybe there’s been a spike of activity recently and all you have are the logs. Having graphing for that webserver would be great,

[ADAM: but … often you don’t have the right set of graphs set up, and it takes a while to do that – no use if the server is in trouble *right now*]

Apr 8 2012 14:33:59 POST …
Apr 8 2012 14:34:00 GET …
Apr 8 2012 14:34:00 GET …
Apr 8 2012 14:34:01 POST …

You could use your shell like this:

cut -d’ ’ -f1-4 log.txt | xargs -L1 -I_ date +%s -d_ | uniq -c | (echo “plot ‘-’ using 2:1 with lines”; cat) | gnuplot

Boom! Very quickly you have a nice graph of what’s going on, and you can tailor it easily (select only one URL, certain time frames, change to a histogram, etc.).”

Categories
iphone photos

Exquisite drawing of London – exhibition in Ealing this Summer

Matteo Pericoli spent 3 years drawing central London from the Thames. His artwork is a 30-foot-long tapestry (that you can buy as a fold-out book).

There’s an exhibition just opened today with the original artwork at Ealing Gallery. What’s amazing is when you see it up close just how tiny some of the hand-drawn details are.

e.g. look at the horizontal lines in the middle of this photo:

(that’s my finger at the bottom – the artwork is under a thick layer of glass, so it’s safe to touch!)

Also, if you go to the gallery, there’s an interactive projection of the artwork onto the walls. It’s running an iPad app we made last year (to complement the paper edition). The app lets you tap each of the buildings on the skyline and read about history, architecture, etc.

Categories
computer games

Game of Thrones modelled as a 3D world…

in Minecraft (“WesterosCraft”):

Categories
programming server admin

Unity: Git source control – a basic .gitignore

The most popular hit for “unity gitignore” is a post on the official Unity forums that was written by someone who doesn’t seem to fully understand how git works. Which was a little disappointing.

Before you commit anything to git, you MUST go into Unity’s menus and enable the “metadata” option (in settings, moves around a bit between versions). Without that, Unity’s internal data-bugs will corrupt your project if you ever merge (happens to us approx 1 time in 3 if we forget at start of project)

After a bit of trial and error, here’s a basic .gitignore for Unity that seems to work, and cut down the commit sizes by a factor of 4 immediately:

UPDATE: updated with a tried-and-tested gitignore that covers more things. Do please note the big WARNING though, or you’ll only have yourself to blame…

##################
# Unity ignores:
#
# !!! WARNING !!!
#
# … you MUST convert Unity to using Metafiles *before* you start using this .gitignore file,
# or you WILL lose data!
#
#####
#
# !!! WARNING !!!
#
# … don’t forget to [git add “*”] (quotes are required!) when adding new files, or git will silently ignore them
#

# OS X only (not needed on other platforms)
.DS_Store
*.swp
*.Trashes

# All platforms
Library
Temp
*.csproj
*.pidb
*.unityproj
*.sln
*.userprefs