I'm sorry for the inconvenience, but I've decided to migrate away from blogger.com.
My new site is jimbojw.com
Thanks in advance for your patients during this time of transition.
-- Jim
2006-12-21
2006-10-21
Simply Explained - Oracle Application Server 10g Clustering
I'm sorry for the inconvenience, but this content has moved. -- Jim
2006-10-18
Clearing the Air - More Languages that Suck
In response to criticism of a previous article on languages that suck, this new study aims to put the issue to rest - establishing definitively which programming languages suck the most, accounting for relative popularity among other factors.
Turns out (despite previous reports) that Perl does not suck the most, JavaScript does. Also, Ruby is by far the hackiest language on the planet ... keep reading to see why.
Methodology
As in the first study, all data were collected from search results retrieved via Google's Code Search. For each target language, three pieces of information were initially gathered:
Total Files
Hacks
Sucks
When choosing between two queries, the one with the larger number of hits is kept. For example, there are approximately 4.4 million hits for lang:c, and 4.53 million hits for lang:"c". In this case, the latter number is retained.
Collected Data
Popular Languages:
Unpopular Languages:
Each of these languages have a footprint of less than 1,000 total files. These statistically insignificant outliers will not be considered during subsequent analysis.
* Values for starred entries were collected as follows:
Inferred Data
To analyze this data, the following metrics are helpful:
Hack Ratio
Suck Ratio
For example, the Hack Ratio of PHP is 14,200 * 1,000 / 580,000 = 24.48.
Languages Sorted by Hack Ratio
Languages Sorted by Suck Ratio
Analysis
Graphing Suck Ratio as a function of Hack Ratio gives us an estimate of the value of hackiness as a measure of suckiness in a language (click for larger image).
Clearly there is generally a positive trend between the two metrics. Languages with higher Hack Ratios tend to also have higher Suck Ratios.
This means one can expect a language with a low Hack Ratio to tend not to suck, and likewise, a language with a low Suck Ratio will probably require fewer hacks.
However, as the ratios increase, the strength of the relationship decreases. This leads to notable exceptions such as C++, which has a high Suck Ratio, but comparitively low Hack Ratio.
Conclusions
It would seem that the foregone conclusions in the previous study were premature. With a Suck Ratio of 4.41, JavaScript is over twice as sucky as Perl, which has a Suck Ratio of just 1.92.
According to these findings, Ruby is the hackiest language of all, with a Hack Ratio of 128.21. In fact, it's nearly twice as hacky as its nearest competitor, Perl (with a Hack Ratio of just 68.27).
There's clearly a need for more research in this area, as the field of "statistical inference of the relative virtues of programming languages" is still in its infancy.
dzone this article
Turns out (despite previous reports) that Perl does not suck the most, JavaScript does. Also, Ruby is by far the hackiest language on the planet ... keep reading to see why.
Methodology
As in the first study, all data were collected from search results retrieved via Google's Code Search. For each target language, three pieces of information were initially gathered:
Total Files
An approximation of the language's footprint in Google's database (and thus its popularity). Determined by one of the following queries: lang:<language-name>, lang:"<language-name>", or file:.*\.ext where ext is the file extension of that language's source code files.
Hacks
Measure of a languages hackiness. Determined by one of the following: lang:<language-name> hack or lang:"<language-name>" hack
Sucks
Measure of a languages suckiness. Determined by one of the following:lang:<language-name> sucks or lang:"<language-name>" sucks
When choosing between two queries, the one with the larger number of hits is kept. For example, there are approximately 4.4 million hits for lang:c, and 4.53 million hits for lang:"c". In this case, the latter number is retained.
Collected Data
Popular Languages:
Language | Total Files | Hacks | Sucks |
---|---|---|---|
C | 4,530,000 | 224,000 | 11,300 |
C++ | 847,000 | * 2,700 | 3,000 |
C# | 120,000 | 2,000 | 50 |
Fortran | 115,000 | 400 | 20 |
Java | 830,000 | 10,400 | 500 |
JavaScript | * 22,700 | 600 | 100 |
Lisp | * 36,000 | 600 | 100 |
Perl | 208,000 | 14,200 | 400 |
PHP | 580,000 | 14,200 | 300 |
Python | 326,000 | 400 | 300 |
Ruby | 15,600 | 2,000 | 50 |
Shell | 80,600 | 4,000 | 50 |
Visual Basic | * 29,900 | 400 | 50 |
Unpopular Languages:
Each of these languages have a footprint of less than 1,000 total files. These statistically insignificant outliers will not be considered during subsequent analysis.
Language | Total Files | Hacks | Sucks |
---|---|---|---|
ADA | 100 | 50 | 0 |
COBOL | 150 | 0 | 0 |
Pascal | * 600 | 100 | 3 |
SmallTalk | * 400 | 100 | 6 |
* Values for starred entries were collected as follows:
- C++ Hacks: This value is a composite of three queries each starting with lang:"c++" - little\shack (300), dirty\shack (400), and ugly\shack (2,000).
- JavaScript: Searching for lang:"javascript" returns only 200 results, while lang:"javascript" div returns 22,700.
- Lisp file count: Like JS, to get a reasonable count, used lang:"lisp" off instead of lang:"lisp" (only 400).
- Pascal: lang:pascal has only 300 hits, while lang:pascal const has 300.
- SmallTalk: lang:smalltalk has only 100 hits, while lang:smalltalk dir has 400.
- Visual Basic: lang:basic has only 400 hits while lang:basic def has 29,900 hits.
Inferred Data
To analyze this data, the following metrics are helpful:
Hack Ratio
The number of "hack" results multiplied by 1,000 and divided by the total number of files.
Suck Ratio
The number of "sucks" results multiplied by 1,000 and divided by the total number of files.
For example, the Hack Ratio of PHP is 14,200 * 1,000 / 580,000 = 24.48.
Languages Sorted by Hack Ratio
Rank | Language | Hack Ratio |
---|---|---|
1 | Ruby | 128.21 |
2 | Perl | 68.27 |
3 | Shell | 49.63 |
4 | C | 49.45 |
5 | JavaScript | 26.43 |
6 | PHP | 24.48 |
7 | C# | 16.67 |
8 | Lisp | 16.67 |
9 | Visual Basic | 13.38 |
10 | Java | 12.53 |
11 | Fortran | 3.48 |
12 | C++ | 3.19 |
13 | Python | 1.23 |
Languages Sorted by Suck Ratio
Rank | Language | Suck Ratio |
---|---|---|
1 | JavaScript | 4.41 |
2 | C++ | 3.54 |
3 | Ruby | 3.21 |
4 | Lisp | 2.78 |
5 | C | 2.49 |
6 | Perl | 1.92 |
7 | Visual Basic | 1.67 |
8 | Python | 0.92 |
9 | Shell | 0.62 |
10 | Java | 0.6 |
11 | PHP | 0.52 |
12 | C# | 0.42 |
13 | Fortran | 0.17 |
Analysis
Graphing Suck Ratio as a function of Hack Ratio gives us an estimate of the value of hackiness as a measure of suckiness in a language (click for larger image).
Clearly there is generally a positive trend between the two metrics. Languages with higher Hack Ratios tend to also have higher Suck Ratios.
This means one can expect a language with a low Hack Ratio to tend not to suck, and likewise, a language with a low Suck Ratio will probably require fewer hacks.
However, as the ratios increase, the strength of the relationship decreases. This leads to notable exceptions such as C++, which has a high Suck Ratio, but comparitively low Hack Ratio.
Conclusions
It would seem that the foregone conclusions in the previous study were premature. With a Suck Ratio of 4.41, JavaScript is over twice as sucky as Perl, which has a Suck Ratio of just 1.92.
According to these findings, Ruby is the hackiest language of all, with a Hack Ratio of 128.21. In fact, it's nearly twice as hacky as its nearest competitor, Perl (with a Hack Ratio of just 68.27).
There's clearly a need for more research in this area, as the field of "statistical inference of the relative virtues of programming languages" is still in its infancy.
dzone this article
2006-10-14
Mano a Mano - Notepad++ vs Textpad
I'm sorry for the inconvenience, but this content has moved. -- Jim
2006-10-13
Innovations - Google Code Search Autocomplete
Google's new Code Search is all the rage these days. Here I present Google Code Search Autocomplete - my contribution to this already great service.
Think of it as adding functionality similar to what Google Suggest adds to the normal Google search.
Download
To get the autocompleter, you must:
Start typing in the search box to see the drop-down list of suggestions.
Developer Notes
This script does its dirty work by issuing an Ajax query behind the scenes for whatever you've typed so far plus the string "\w*". So if you had typed "google", the Ajax call would query for "google\w*". For readers unfamiliar with regular expressions, this basically means "google*" where * can be any number of "word" characters (A-Z, a-z and _).
The resulting page is then parsed for all instances of <b> tags with class="hl". These contain the query matches. Once collected, terms are then sorted and displayed to the user via the drop-down div below the search field.
Due to these design constraints, some of the script's behavior may seem strange at first. For example you may get only a handful of hits for "goo", but many for "google". This has to do with the number of redundant hits returned during the transparent Ajax request. The more reduntent matches there are, the fewer drop-down options there will be.
Also, since an entire page request is being made behind the scenes, the drop-down may feel slow to update. Especially if you're on a slower connection.
Summary
This article builds on concepts developed in a previous blog entry, in which I describe the process of incorporating the Scriptaculous library into Greasemonkey userscripts. Check it out if you'd like to learn more about the underlying mechanics of this script.
I hope you've found this useful or interesting. Drop me a line and let me know what you think!
digg this article
Think of it as adding functionality similar to what Google Suggest adds to the normal Google search.
Download
To get the autocompleter, you must:
- Install the latest versions of Firefox and Greasemonkey (if you haven't already)
- Once in Firefox, navigate to the Google Code Search Autocomplete Userscript
- Install it as you would any userscript by clicking the "Install" button in the upper right-hand corner of the screen.
Start typing in the search box to see the drop-down list of suggestions.
Developer Notes
This script does its dirty work by issuing an Ajax query behind the scenes for whatever you've typed so far plus the string "\w*". So if you had typed "google", the Ajax call would query for "google\w*". For readers unfamiliar with regular expressions, this basically means "google*" where * can be any number of "word" characters (A-Z, a-z and _).
The resulting page is then parsed for all instances of <b> tags with class="hl". These contain the query matches. Once collected, terms are then sorted and displayed to the user via the drop-down div below the search field.
Due to these design constraints, some of the script's behavior may seem strange at first. For example you may get only a handful of hits for "goo", but many for "google". This has to do with the number of redundant hits returned during the transparent Ajax request. The more reduntent matches there are, the fewer drop-down options there will be.
Also, since an entire page request is being made behind the scenes, the drop-down may feel slow to update. Especially if you're on a slower connection.
Summary
This article builds on concepts developed in a previous blog entry, in which I describe the process of incorporating the Scriptaculous library into Greasemonkey userscripts. Check it out if you'd like to learn more about the underlying mechanics of this script.
I hope you've found this useful or interesting. Drop me a line and let me know what you think!
digg this article
2006-10-12
Clearing the Air - Languages that Suck
New! Check out the follow-up article More Languages that Suck.Everyone knows that programming languages suck, but which sucks the most?
I have conducted a scientific study to answer this question, and humbly present my findings below.
Methodology
All data for this report were collected from search results done through Google's Code Search, by searching for the phrase "<language> sucks" (without quotes) where <language> was one of these 10: C, C++, Java, JavaScript, Visual Basic, Python, Ruby, Perl, PHP and Lisp.
Occasionally, two similar searches would turn up different numbers of hits. For example, "C sucks" results in 35,900 hits while "c sucks" results in 49,600 hits. Where this is the case, the query with the greater number of hits is kept.
Results
The results seem to confirm conventional wisdom: Perl sucks the most, Ruby sucks least and all other languages fall somewhere in between.
It was surprising however to find that Visual Basic sucks less than JavaScript - I'd have thought it would be the other way around.
Rank | Language | Query | Hits |
---|---|---|---|
1 | Perl | perl sucks | 58,900 |
2 | C | c sucks | 49,600 |
3 | C++ | c++ sucks | 39,900 |
4 | Java | java sucks | 27,900 |
5 | Lisp | Lisp sucks | 19,100 |
6 | JavaScript | JS sucks | 13,400 |
7 | Visual Basic | VB sucks | 8,000 |
8 | PHP | php sucks | 3,000 |
9 | Python | python sucks | 2,000 |
10 | Ruby | ruby sucks | 500 |
Here's a graph of the above data (click to view larger version):
Operating Systems That Suck
Out of curiosity, I also tested for operating systems which suck. Again conventional wisdom proved correct: although Windows, Mac and Linux all suck, Windows definitely sucks the most.
Rank | Language | Query | Hits |
---|---|---|---|
1 | Windows | windows sucks | 60,000 |
2 | Mac | mac sucks | 58,200 |
3 | Linux | linux sucks | 49,600 |
Honorable Mentions
Surprisingly, a search for "C# sucks" returns only one result. I took this to be a statisitically insignificant outlier, suggesting that either C# sucks so badly that nobody uses it, or that those who do use it dare not openly challange the .NET regime.
Also, searching for files with COBOL's file extension (.CBL) reveals about 100 hits. Unsurprisingly, the query "cobol sucks" (no quotes) also has about 100 hits. I leave it as an excersize to the reader to interpret this result.
Conclusion
All programming languages suck, some just suck more than others. Thank you.
(If you liked that, keep reading...)
digg this article, dzone this article
2006-10-08
Killer Combos - Greasemonkey & Scriptaculous
I'm sorry for the inconvenience, but this content has moved. -- Jim
2006-10-07
2006-10-04
Must Have Software - OpenGrok
If you're a code monkey like me, then you've probably had to search through a source tree at one time or another - whether you're just a cog, or the whole machine.
Enter OpenGrok the "wicked fast source code browser".
From the project site:
Here's how it works: First you set loose OpenGrok's indexer on your codebase. This can take anywhere from a few minutes to several hours depending on code volume. When finished, you configure your WAR to point at the index and fire it up on your favorite J2EEish container (Tomcat worked great for me).
Here are some more features of OpenGrok:
There are a few very desirable pieces missing from OpenGrok at present, which I hope to provide in future posts. Stay tuned.
Enter OpenGrok the "wicked fast source code browser".
From the project site:
OpenGrok is a fast and usable source code search and cross reference engine. It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like SCCS, RCS, CVS and Subversion. In other words it lets you grok (profoundly understand) the open source, hence the name OpenGrok. It is written in Java.To see it in action:
- Visit the OpenSolaris Source Browser
- Search for "grok" via the Full Search field.
- Watch your results come back lightning fast!
Here's how it works: First you set loose OpenGrok's indexer on your codebase. This can take anywhere from a few minutes to several hours depending on code volume. When finished, you configure your WAR to point at the index and fire it up on your favorite J2EEish container (Tomcat worked great for me).
Here are some more features of OpenGrok:
- Syntax Highlighting - Source code for recognized languages is syntax highlighted for ease of viewing.
- Source Browsing - It's easy to walk up and down the directory structure of your code via /xref.
- Project Descriptions - In the search results, notice the green italicized text next to the project names. These descriptions are configured via an optional CSV file.
- Line Number Links - On the right hand side in the search results, line links take you directly to the matching line of the source code file.
There are a few very desirable pieces missing from OpenGrok at present, which I hope to provide in future posts. Stay tuned.
2006-10-03
Prologue
No one will ever read this - or at least, no one will find it interesting. Nevertheless I am compelled to write. The blank page is a formidable foe, one which I am determined to overcome. But with what? Who knows.
No matter. Words will find their place, as all things eventually do. Wo bu zhi dao.
No matter. Words will find their place, as all things eventually do. Wo bu zhi dao.
Subscribe to:
Posts (Atom)