Developers harness the power of Google Code Search... and look up dirty words

Google has unleashed its latest free search product onto the unsuspecting public: Google Code Search. What new wonders will come from combining this powerful new tool with the software development community? Will we use our knowledge to spot hidden bugs in one another’s software, eliminating software crashes and possibly saving the lives of those that depend on our programs? Or will coders around the world enter a new era of greater collaboration, creating amazing new software that transforms the the way people live?

Or we could, you know, look up dirty words in each others code: Fucks per programming language and license. [:)]

According to Google Code Search PHP developers are the most profane while Python, Java and C# (my language of choice) come out the cleanest. C# ends up winning (or losing depending on your perspective) by a nose. Take that fuckers.

More seriously, I don't see Google Code Search changing the world when it comes to the reuse of existing code. Expressing what you are looking for in a class or library in a regex that searches over code is something that strikes me as being very hard to do. I believe the majority of the time you would be better off using plain old English in Google's regular search to find what you’re looking for.

Google Code Search isn't without merit however. A place where I can see it being quite useful is when working with an API for the first time. If you're unsure of the way a specific property or method works, and the code example in the MSDN reference isn't any help, Google Code Search provides a means to get a list of real world examples to learn from.

Finally, and I guess since it is Google I shouldn't be surprised, but Google Code Search has managed to find and include the code I've written and made public on this site, despite being zipped! If anyone deserves a P/E of 60, it's Google.

Starting at Intergen

 

As alluded to earlier I have have shifted jobs, and have started at a place called Intergen. It is a bit of a culture shock going from 5 people working on one project to over 100 people working on more things than I can count.

So far the highlight at Intergen for me has definitely been the people. Besides all being very nice and a lot of fun to work with, Intergen has many of the best .NET developers in the country, including two MVPs and one of New Zealand's Microsoft Regional Directors.

Intergenite cast:

  • John-Daniel Trask - New Zealand .NET Blog of the Year winner. Also known for crazy antics.
  • Jeremy Norman - EPiServer expert and a very good Halo 2 player. I'm (currently) very bad so we often end up on the same team [:)]
  • Trey Guinn - When we first met, for a second there, he had me believing that we were long lost friends. Americans!
  • Nick Urry - Intergen developer and content management expert extraordinaire.
  • Jeremy Boyd - New Zealand Microsoft Regional Director and MVP for SQL Server 2005.
  • John Lewis - Part of the Intergen creative studio.

And many more who have not yet hopped on the blogging bandwagon. Thanks for making me feel welcome [:)]

How to increase traffic to your blog - the Spolsky way

Although I don't always agree with some of his opinions on programming, Joel Spolsky's marketing skills have to be admired. In his most recent post Language Wars, Joel argues that when it comes to picking a computer language for a project you are best off picking the mainstream language you know best. Nothing revolutionary there.

Along the way however he slams LISP and criticizes Ruby for not being suitable for commercial programming, citing failed projects, maturity and performance. As probably anyone who reads this knows, programmers can become extremely devoted to their language of choice (which is silly because .NET is obviously the best) and so they tend to get very fired up when their beloved is insulted. The beauty of Joel's post is he then cleverly baits those that he has annoyed by saying that his company has created its own in house language, something that runs completely against picking a safe choice he argued earlier. Subtle tongue in cheek most likely (at least I hope), but at the same time not entirely impossible. Either way Joel doesn't try to explain or justify this paradox in his post and so combines the aggrieved LISP and Ruby developers with ammunition to counter-attack, creating a feeding frenzy of posts, links and hits.

I've come across a number of posts listing ways to increase traffic to a blog recently but none have described anything like this. Joel, I salute you! [Y]

Update:

Update Part Deux:

Oracle Peeves

I'm changing jobs soon and after nearly 3 years of working with Oracle, and little chance of my using it in the near future, I'd like to share (vent) some of my top Oracle peeves.

I'd like to state up front that I don't hate Oracle, and I haven't had enough experience with other databases to know exactly how good or bad Oracle is in comparison. These are just some little things (hopefully valid) that have irked me over the years [:)]

30 character name limits

I'm not a fan of Hungarian notation or most abbreviations (we spend far more time reading code than writing it so any time saved typing will be lost deciphering, besides auto-complete anyone?) so Oracles 30 character limit on names has annoyed me to no end. It usually isn't a problem with table or column names but when you have a foreign key naming standard that is comprised of the table the key is coming from and going to, things start to get hairy:

E_S_SEC_E_PROC_SUB_TYPE_FK1 [^o)]

select * from dual

Why Oracle why?

To be honest I've always found the dual table kind of facinating although Oracle's limitation does make some do crazy things.

SQL statements automatically handling no_data_found

In PL/SQL when you want to populate a variable with a value from a table you use "select into". The select into statement has to return one row. If none are returned then you get a no_data_found exception. If more than one is returned then you get an aptly named too_many_rows exception. Sound fairly simple? The gotcha is that if the exception is thrown by a function being used inside a SQL statement then it is automatically caught. The hows and whys of this behavior confused the bejesus out of me until I came across this Ask Tom question.

Varchar2

A general grab-bag of aggravating issues around strings in Oracle:

  • Apparently Oracle promotes the use of varchar2, rather than varchar, because it wants to avoid problems if the SQL standard is ever changed so that possible new varchar behavior doesn't cause bugs in existing code. DBAs are big on backwards compatibility so a change like that seems a pretty big if to me. Personally I think Oracle should have just stuck with varchar. If the standard ever changed in a way that caused bugs with existing code either used a database flag to turn it on or off or at that point introduce a varchar2 with the new behavior.
  • By default the length on a varchar2 column specifies byte length, not the number of characters. Most commonly used English text is single byte but it can be a bug lying in waiting if you are unaware of it.
  • Empty strings are considered null. '' = ''? Not in Oracle!
  • The string concatenation operator in Oracle is ||. Yuck. To be fair to Oracle this is the operator specified in the ANSI SQL standard.

Memory UsageOracle likes it's RAM. Having a dedicated database machine (at least if you're writing, running and debugging .NET applications from Visual Studio) is pretty much compulsory. Oracle having Java embedded inside it can't help.

Select Into

In PL/SQL you can't use the result from a select in an expression. Instead you have to declare the variable, select into the variable (don't forget no_data_found and too_many_rows error handling!) and only then use the variable in an if test or whatever. Painful.

Package Headers

Packages are a Good Thing™ and I have a feeling I'll miss them in SQL Server land but separate headers to control external visibility is so 1990. Having to modify the header signature along with the body is annoying.

Declaring all variables at the top of a procedure/function

Woah. Sixth Form Certificate programming class Pascal flashback.

Installing Oracle on Linux

10g or 9i? R1 or R2? x86 or x86-64? Redhat Enterprise Linux, Fedora Core, SUSE Enterprise Linux or something else?

There are a lot of permutations and luckily for you there are instructions for all of them because Oracle installs on each of them differently. Hurrah!

When you do find the guide you are looking for don't worry, you are halfway there! Only 21 pages of instructions to follow...

Oracle .NET client size

209 megabytes. Compressed.

Update:

To be fair to Oracle, its quirks and WTFs can't compare with the silly things some developers do with it.