Why (some) programming languages are actually designed well
I came across this article on twitter, "Why Aren't Computer Programming Languages Designed Better?"
Which say's:
According to findings by researchers from Southern Illinois University, this reaction isn’t just because you’re a n00b: they found that Perl, a major programming language used by untold zillions of developers, is no more intuitive to novices than a language with a randomly generated syntax.
and
So why aren’t all programming languages designed this way? "I doubt that most language designers meant for their languages to be hard to understand or use," Stefik says. "The problem is that programming languages are created either by committee or by extreme technical wizards with magical math powers. The broad computer science academic community has not paid a tremendous amount of attention to programming language usability. I think that our discipline mostly uses anecdotes to argue about programming languages. As such, it is no wonder that the arguments get heated."
...
Why shouldn’t those "interfaces" be as humanely designed as the ones we tap and swipe?
First, it's no real surprise that perl would be more difficult to learn than a randomly generated language. Perl is often regarded as one of the most difficult languages to maintain. I am not going to rehash all of the commentry against perl again, you can read this excelent article for that. A few extracts:
One of the first things I discovered I didn't like was the syntax. It's very complex and there are lots of operators and special syntaxes. This means that you get short, but complex code with many syntax errors that take some time to sort out.
However, even this isn't really bad. The Perl Journal has conducted an Obfuscated Perl contest. The winners are here . Be warned, though. These programs gives the word unreadable entirely new and previously unimagined meanings. (And no, this isn't an argument for Perl being unreadable, but mainly included as a funny and curious item.)
Programmers and readability
Some people reading this have complained that 'But anyone can write unreadable code in any language!' and this is certainly true. However, some languages seem to encourage hard-to-read code, while others seem to discourage it.
If we were comparing Perl & Python, i would say that Perl is actually the more 'Human' language (But more difficult) Why?
Because perl was designed like a language the inventor was actually a trained linguist, see this :
Multiple ways to say the same thing
This one is more of an anthropological feature. People not only learn as they go, but come from different backgrounds, and will learn a different subset of the language first. It's Officially Okay in the Perl realm to program in the subset of Perl corresponding to sed, or awk, or C, or shell, or BASIC, or Lisp, or Python. Or FORTRAN, even. Just because Perl is the melting pot of computer languages doesn't mean you have to stir.
All of these 'features' of perl, make it difficult to learn, difficult to read, and difficult to maintain. People who program in perl actually see it as a matter of pride to write Obfuscated code. It can also be used for Art.
Now, lets compare this to Python:
- It forces you to write readable code, by using whitespace as part of the language
- There is usually only one way to do something, avoiding confusion , ensuring you get expected results, resulting in reliability
- See a like for like comparison between perl python and ruby
- There are too many advantages to list
From the history of python blog (Highly recommended for an inside look by Guido on the design of python)
Although I will discuss more of ABC's influence on Python a little later, I’d like to mention one readability rule specifically: punctuation characters should be used conservatively, in line with their common use in written English or high-school algebra. Exceptions are made when a particular notation is a long-standing tradition in programming languages, such as “x*y” for multiplication, “a[i]” for array subscription, or “x.foo” for attribute selection, but Python does not use “$” to indicate variables, nor “!” to indicate operations with side effects.
Python was created first and foremost with usability in mind.
While i agree, languages should be more 'usable' to make things easier for non coders to pickup, it should not be easy at the expense of flexability and features.
There is nothing wrong with a language designed by a mathematician as it follows the principals of logic, which is the only language computers speak. They should not be designed to be more 'Human', as you could end up with programming languages that look like spoken languages such as Perl.
Optimizing mobile device detection for your mobile site
Just read this on RWW, on how FaceBook optimized their mobile applications.
The cornerstone of this is detecting what your phone is going to be able to do. Capabilities, then you can start the right experience. You guys heard of WURFL at all? Wireless Universal Resource File? This is one of the projects out there that attempts to map a user to a user-agent set of capabilities. You know, what is your screen size? What is your JS? Can it do cookies? These are all pernicious, nasty problems that need to be solved. And the use-agent, as you guys can tell, doesn't do the job. So, you need an open database for manufacturers and concerned citizens to be able to tell you what is up. We sponsored this project and this project is continuing to evolve as an open source data site.
Last year while we were working on a mobile project based on the django framework (We were sub contracted so cant mention the client Hint: International Takeaway franchisor ;).
We needed to do some mobile device detection and change the templates based on features the device supported i.e Javascript.
We implemented the a solution based on WURFL, PYwurfl and the mobile.sniffer libraries. Other than some strange side effects on caching caused by django template switching based on a user agent everything worked fine for the most part(I may cover how we resolved this in a later post).
However, due to how some of these libraries were implemented, there was a significant hit in responsiveness & increase in memory usage when mobile device detection was enabled.
We did optimize this and get around the issue, however in January i presented this as a problem to MIGSA 2011 (Mathematics in industry Study Group) at WITS University. You can find the paper below.
Also well done to the students involved.
Bait and switch + Social Media = not a good combination.
Hello World
Welcome to our new blog.
* Posts prior to this were imported in from other blogs we have posted to.
Has muti made a fundamental mistake in community management?
So muti in the last few days has been in flames. It all started when someone posted a link on muti to a screenshot from Coda of apparent spam from blueworld. Imod stirred the pot asking a few questions on his blog in response. Both the submissions to muti hit around 35 votes very quickly, but were then removed. (Following the link comes back with a 404)
Let me be clear, i am a fan of muti and find it extremely useful, i access it so many times a day i actually created a desktop application for it and the guys from blueworld seem to be doing a lot of cool things as well. Though i am going to ask the questions that need to be asked. Has muti made a fundamental mistake when it comes to community management?Granted that the noise being made may be a bit loud regarding the spam, though just recently the blogging community made a similar noise against deal-a-day email spam which hit muti as well. Charl is a respected member of the SA blogging community and they did come out with a response and the issue should have died there.However both the submissions were then subsequently pulled from muti, one at the request of Chris. The other i have no idea why? Coda then asked the question on why was the second post pulled? I find myself asking the same thing. Why?Once muti starts making decisions on censoring content of what people submit it's heading down a slippery slope. The thing is you can never please everyone. Google themselves refuse to censor search results. Even on Youtube, only content that is clearly hate speech is removed. So where does this leave muti?I think the guys at muti need to decide if they want to cater for a small group of people, all of whom have the same opinions and that way censoring of content that differs from the general group consensus is fine. However if muti wants to cater for a larger community, censoring and pulling submissions should only be done in extreme circumstances of Hate Speech. Also note, with previous submissions of hate speech the vote count was merely cleared, the spam posts however were completely deleted including comments and the discussions around it.We need to realize that since muti currently caters for large number of people, there are going to be differing view points and you really do not want to play the adjudicator, judge or take sides. Muti has clearly done this, and as the facilitator of the blogging community at large i believe this is a fundamental mistake.As an example this raises questions like:- Someone posts something that is factually incorrect and paints me in a bad light, could i request the post be removed?
- Or maybe this post could be pulled at the request of Yasser since it was clearly critical?
As you can see, the questions this action raises could go on and on, and you would never get to the end of it. This is a problem faced by many companies, Google, Facebook, Twitter. Even telecoms companies like Vodacom and Cell C where people complain falsely of harrasment via sms. Unless the community is extremely small it becomes increasingly difficult to be the judge, therefore the best response is to set clear guidelines on what is not accepted(i.e hate speech) and can be removed, anything that does not meet the criteria of unacceptable stays.
muti needs to 'grow up' and realise it does not just cater for a small group of people any longer with the same opinions, and with that nobody, no matter who they are (including shareholders) should be able to influence the content that gets removed. Let's just hope this is something that will not be repeated again and we can take away a lesson from this.Update: Mandy De Waal has a post regarding this as wellBusiness opportunity for SEO
Doing a search earlier i came across something interesting. If you search for "CellC Ussd Recharge" the top most link is MTN which is actually a direct competitor of Cell C. Jeremiah Owang say's Google is actually your coporate homepage. Considering that, do you really want to drive people doing searches for your brand to competitors?
This would make a good pitch for SEO business.
Twitter Business Model, Why google is scared
Read Write web recently ran a post on monetizing twitter with a business model using ads. The post was good, and i believe it makes sense However i believe they missed one key point. Twitter can be used from your mobile phone.
When Google launched image based mobile ads. i briefly covered what google mobile ads were missing and why context (what is the person doing?) is important. Twitter offers that context, add a location to that and your pretty much have killer mobile advertising. Its contextual to what the person is doing and localized.No one out there can offer advertising for mobile as relevant as that right now , not even Google. This is the reason Google was quick to snap up Jaiku, they realise that twitter is actually a threat to their mobile advertising business. Some people may have been confused about why i sent this tweet, it seems a far fetched but Twitter is actually a threat to Google mobile ads business, which according to reports could be a larger market then internet advertising.







