If you are stuck on Outlook 2002…

January 14th, 2010

Yeah, as the title says some corporations (albeit I hope there aren’t that many dysfunctional corps out there) are still stuck on Office 2002!

What does this mean for you as a contractor or employee of such a corporation? Basically: besides looking like Neanderthals to people outside the corporation you are sharing files with, you are locked out of some of the best plugins available for the Office suite.

One such plugin I desparately wanted to install was Xobni (Inbox spelled backward) which allows you to actually search and organize your Outlook Inbox! The default search that comes with Outlook 2002 is abhorrent, slow and literally takes over Outlook until it feels it’s done.

But guess what? Xobni and 99% of the other newer Office plugins out there won’t support any version of Office prior to 2003.

Enter Google Desktop, probably one of the best kept secrets for solving Outlook 2002’s poor search functionality. Simply install Google Desktop, setup up your preferences for which types of files you want indexed (Outlook being one of the types) and leave Outlook open for a while and Google will do it’s magic.

I’m sure your Corporation, if they are still using Office 2002, wouldn’t approve of installing “3rd party software” but really this one is worth the risk of getting caught.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

craig General

The reformed Microsoft and exFAT

December 13th, 2009

On my Windows 7 box, I added some hard drives. The formatting dialog box offered the option of formatting it as NTFS or exFAT (aka FAT64). I chose NTFS but was curious as to what exFAT. One wikipedia article later, I was enlightened: it’s basically and propriety and patented update to FAT useful for large disks and large files. As portable disks/flash cards are getting bigger (to support video cameras, etc), a suitable format had to replace the venerable, but limited, FAT.

Microsoft, and its defendants, have been claiming how reformed the software giant is, and is more open (with respect to interoperability and compatibility with competing systems and companies) and plays well with others now. Samba and its office formats are getting more open. The world is generally a better place, supposedly.

Except it seems the right hand of Microsoft doesn’t seem to know what the left hand is doing.

The most basic, fundamental way to interoperate with an OS is via shared disks. Floppies in the past, hard disks and flash drives now. If you want to interoperate with a PC desktop, that means interoperating with Windows, which means you can only choose formats it supports out of the box.

Microsoft, by virtue of this monopoly, gets to decide the successor to FAT. Making a lower-overhead, but scalable file system suitable for removable disks isn’t hard. There are many free and open solutions out there, and coming up with one from scratch isnt innovative or challenging, especially for Microsoft. So they did just that and called it exFAT.

The problem is, the new Microsoft has decided that it wants to cash in more on its technology licensing and patenting (see the story on the Register), and has decided to heavily license (charge a pretty penny for) exFAT users. These users include flash disk makers, camera/device makers and of course, competing operating systems. Linux in particular is going to be in a grey area, as its hard to extract per-user fees out of something that’s often freely downloaded.

exFAT isn’t impressive technology. It’s not innovative or game changing, and not worth licensing for the technology itself. If anyone else came up with it, it’s be ignored and forgotten. But since it’s Microsoft, people will have to use (and thus pay for it) to be able to talk to Windows. To use an analogy, the electric company is charging vacuum makers to make cords that can plug into their sockets.

Microsoft, yet again, is leveraging their desktop operating system monopoly into other areas and profit centers, stifling competition. The leopard can’t change its stripes, despite its PR. Is anyone actually surprised?

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

alex Alex

How I setup my git repos

October 3rd, 2009

I have a directory on my linux box for git repositories and as often as not I need to share these with my fellow developers. Here are the steps I take in setting up a new developer and project.

Setup a new git developer

I have a group setup on my computer called “git-user”. My /git directory has been chgrp’d to git-user (that’s important). I then setup a developer account on my machine like so:

Setup the group:

sudo addgroup git-user

Setup the user:

sudo adduser --shell /usr/bin/git-shell --ingroup git-user [username]

Of course, replace [username] with the username for the dev you want to share your repo with. You’ll notice that I set their login shell to be git-shell. This is so you don’t have to worry about them logging into your box and using it as a torrent seeder (or basically using it for anything other than git) :)

Setup ssh keys for the user

I don’t want my user to have to login with a password. For a few reasons a) I don’t want to have to manage their password b) I want to make it as easy as I can for them. To have them be able to login without a password you need them to generate (if that haven’t already) a public/private keyset and they must give you the public key.

To generate the keyset have them follow these steps:

ssh-keygen -t dsa -f ~/.ssh/id_dsa -C "username@emailhere.com"
(note, you could use rsa as well if you are so inclined)

Have your dev send you the file that’s in their ~/.ssh/ directory called id_dsa.pub (or id_rsa.pub if they chose -t rsa).

You’re job will be to create a .ssh/authorized_keys file in your developers home directory, and copy the contents of that public key they sent you into it. You do that like so:

sudo mkdir /home/username/.ssh
sudo chown username:username /home/username/.ssh
sudo chmod 700 /home/username/.ssh
sudo cat id_dsa.pub > /home/username/.ssh/authorized_keys
sudo chown username:username /home/username/.ssh/authorized_keys

Setup the repo

Put your repo wherever you’d like, but it has to be reachable by users within the git-user group. So for instance I did the following:

mkdir /git
sudo chgrp git-user /git

Then, to setup the repository for my project:

cd /git
mkdir myproj
sudo chgrp git-user myproj
cd myproj
git init --bare --shared=group

Note: It’s worth it to mention that in some older versions of git, issuing the git init command with the --shared=group would not properly set the group for the “objects” directory (I believe). The version I used in this tutorial was 1.6.1.3 and it seems to work fine now.

Put code in your repo

  1. backup your local project somewhere
  2. change into the directory of your local project
  3. type: git init
  4. type: git remote add origin username@tataryn.net:/git/myproj
  5. type: git pull origin master
  6. ls -al your local directory to make sure your files are still there and confirm there is a .gitignore file present
  7. type: git add .
  8. type: git commit -a -m "initial import of my proj"
  9. type: git push
  10. The last step may or may not work, it all depends on whether you have code already in the repo at the time you originally pulled. If this doesn’t work try: git push origin master

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • Google
    • description
    • Reddit

    craig Craig

Controlling the Storm

July 7th, 2009

Was reading Jason’s blog post on Brainstorming Done Wrong, I agree completely. Brainstorming is dangerous if not done properly. Simply put, people tend to loose focus and get overwhelmed and confused. What I find typically happens is you’ll be in a meeting and a certain person or set of people are by virtue of their own accord brain stormers. They essentially think out loud. This has the unfortunate side effect of hijacking the meeting with a tonne of tangential ideas and by the end of the meeting people feel unsatisfied because there is nothing to take away other than confusion and more questions.The Mindmap

A typical scenario of brainstorming gone wrong is the meeting wanting to find out what time it is. Someone starts telling us how a watch is made, another disagrees and says how he/she prefers how a watch is made. Several people debate digital versus analog watches, etc… At the end of the meeting not only do we not know what time it is, we don’t have a working blue print for a watch, just a bunch of random ideas.

One thing I’ve been implementing personally for my own private brainstorming sessions is to write my brainstorm down as a mind map. So I start with a circle in the middle with the main topic printed inside. Then I start thinking on it, each thought related directly to the main thought gets a branch with and any tangential ideas branch off from those sub branches. This technique makes it really nice to organize your thoughts and produce something you can take away from a brainstorming session. Another benefit to mind mapping is it makes it really easy to “prune” the map of invalid ideas, or ideas you don’t want to take anywhere meaningful.

If you find your meetings getting out of control, and you “own” the meeting in that you can choose it’s direction, It’s not a bad idea to mosey up to the whiteboard right in the middle of a brainstorming session which went off the rails and say “I’m going to write down some of these ideas” and proceed to draw a mind map. 9/10 you’ll be asked what the heck it is you are doing, you can then explain that this will help the team keep on track. Neat trick because it’s a passive aggressive way of stating the fact the meeting was off track in the first place, less offensive than saying “you’re all a bunch of scatterbrains!” ;)

Mind Maps are great for capturing the natural way your brain problem solves and plans. Without this technique a lot of your “branches” are lost as they fall out of short-term memory and a lot of the times the “meaningless” branches, when looked back upon actually add a lot of value to your end goal.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

craig Craig, General

Joel and Jeff - TDD is Relevant

July 3rd, 2009

I’m a big fan of the site Stack Overflow, albeit I find it tough with my schedule to fully contribute to the site but before the site was even live I was a faithful listener to their podcast.

stackoverflowlogoI listened to them a lot when I was traveling last year, this was when Jeff and the gang were creating Stack Overflow. I’m done traveling and hadn’t really made the time in my life to catch up on podcasts until now. And it’s kind of nice doing it this way because you get “full seasons” of podcasts and don’t have to wait eagerly for the next. That’s how I watch TV for the most part, watching one episode a week is for the dogs. So although I’m still a few episodes behind, I managed to get through two I feel need a “rebuttal” of sorts. The two I speak of are episode 38 and episode 41

Episode 38

In this episode it’s Joel and Jeff talk about Test Driven Development and how they don’t get why it’s so useful because really if you are a software company you should just hire awesome programmers who don’t need to write unit tests. This position is pretty much born out of ignorance, and I’m not being a jerk here, I love Jeff and Joel, I just recognize their ignorance for what it is.


For instance, Joel says at one point:

It doesn’t seem like you could actually get any code written if you’re spending all your time writing 8,000,000 unit tests, and every single dinky little class that you need to split a URL into four parts becomes an engineering project worthy of making a bridge, where you spend six months defining 1000 little interfaces. They’ve just gone off the deep end, and I don’t think these people write very much code if they’re coming up with these principles, to be honest, it doesn’t even make sense.

Joel essentially explains that TDD is akin to the Object Oriented Architect who is operating up in his ivory tower, dictating what should be a really good idea in theory, but essentially is impractical in the real world and should be left to the academics to debate.

Episode 41

Episode 38 spawned a rebuttal from “Uncle Bob” — one of the pioneers of the Agile methodology — he’s also a big proponent of TDD. The episode includes Uncle Bob himself, however he’s unable to convince Joel and Jeff that TDD is for the real world and the episode essentially re-iterates Joel and Jeff’s stance that if you just hire “awesome programmers”, these time-wasting unit tests aren’t worth it.

I must admit I was left disappointed, I really thought Uncle Bob would give them the what-for, show them that TDD is alive and well outside their island code base. Uncle Bob, in my opinion doesn’t do a super job trying to convince them of why TDD make sense. I got the feeling that he didn’t want to bring into question Joel and Jeff’s coding practices. For instance, Joel brings up several times how “there is lots of code in the UI layer that you simply can’t unit test”. That should signal alarm bells for the astute programmer who has grown accustom to the Model View Controller paradigm (or Separation of Concerns in general). I really think the problem is that .NET people (I was one briefly) are trapped in the Vendor Vacuum which is Microsoft. If Microsoft doesn’t have a unit testing framework that is bundled in with .NET, then it’s probably something not worth looking into is the mantra. I base this opinion primarily on what I hear Jeff talk about during the podcasts, specifically how early on in development of Stack Overflow they weren’t sure if they were going to implement the site using this new “MVC” thing. For a person like me that’s been doing MVC web development since the 1.x versions of Struts (circa 2000), I cringed. It all goes back to Joel’s comment about all the little pieces of logic in the UI, that just shouldn’t be the case. I won’t go on about it ad nauseum, I’ll just hug Wicket and let others experience the pains of <% logic here %> programming (or “bee sting” tag programming as Jeff might say) in the UI until they too have their “ahah” moment (or until Microsoft has it for them).

On “A Hah!” moments…

I’ve done what they’ve done though; forming opinion on things that I have no experience with. I did it with the Mac, Sushi and of course technical things like distributed source control. I’ve taken a position now that if I haven’t tried it, I probably don’t have an opinion on it that is worth a hill of beans. I got the feeling that after all was said and done Joel and Jeff still weren’t convinced that TDD was for people who “really coded”…

The "ahah" moment, usually happens for me in the shower...
There are just some things like DSCM and TDD that you just have to try for yourself to get that “ah hah” moment. Without that moment, you really have to be a special person to grasp firstly the concept and secondly why it’s important and useful. When I first discovered git (thanks to fellow basementcoders Marc and Alex) I didn’t really know why this was any better than svn. Then I started using it, and discovered how much more agile I could be, for instance I could be merrily working away on some future feature of a software app and instantly be able to code an emergency fix for a released branch. I can do all that without switching directories and without loosing any work I was doing on my feature.

Make Unit tests, not User testers

The funny thing is, in later episodes Jeff laments about a certain Stack Overflow badge for which faulty logic caused the badge to be awarded to users when it shouldn’t have been. Instead of making his users be his unit testers, he could have caught this up front with a set of unit tests for the badging system.

It’s actually, when you think of it, pretty surprising that Stack Overflow works as well as it does. This is primarily due to the community which supports and makes Stack Overflow a success, they find the bugs early enough and the bugs get fixed fast enough that on a whole the site works. But there will come a day where the site becomes a complex set of features which start to become coupled to one another. Jeff or one of his partners will change some innocuous piece of code, and because of the lack of unit tests to support regression testing, 5 other bugs will be introduced. That’s not a “maybe it will come to that”, it’s pretty much a fact and users will only put up with so many bugs before they’ll get frustrated.

Cover your ass - the blame game goes away…

Cover your ass

Cover your ass

This is where Uncle Bob, I think, kinda dropped the ball. What’s one of the worst situations to be in on a project? I would say it’s when someone changes code and that change breaks the functionality you are responsible for. Who gets blamed? You do, because to the others on the team, QA, Business people, it looks to them like your stuff doesn’t work.

This is precisely the problem that lead me to have my “a hah” moment with TDD: it’s inherit ability to “cover your ass”. What you do is you build up a set of programmatic tests which exercise the functionality of your unit (most likely a service, or set of services). You then set your build system to execute these unit tests anytime your program is built. If the unit tests fail, the build fails. If the build fails, it means the last change set you made “broke the build”. That is the key, you must enforce a protocol upon your developers that states “before you check *anything* into SCM, you build it and run the unit tests. If the build fails for any reason, unit test failures included, you fix it before you check in.
You break it, you bought it bubThis needs to be a commandment of your development process that is enforced with extreme prejudice. I learned that from Jeff Genender, the hard way a few times. If you checked in code that broke the build, he came down on you like a sack of hammers.

The accountability comes into play if you also incorporate Continuous Integration tools. For instance any time we checked in source code at Leap Frog, Jason Whaley had our Continuous Integration server automatically build the code and run our unit tests. If a unit tests or compilation failed a big nasty email went around to the team, and to the directors stating “${name_of_jerk} broke the build“.

It also really helped that we had top notch QA personal, Chas Schley and Brad Epranian would not tolerate source code which wasn’t properly unit tested. They themselves were writing a series of automated testing against various parts of the system and it pissed them off to no end when all of a sudden their tests weren’t working anymore because of your change.

Knowledge Transfer

The fact of the matter is, disregarding everything else, TDD makes you better at understanding your program. If some developer on your team doesn’t know anything about how the “badging system” works, I guarantee you if you pointed him to a set of unit tests which exercise the ins and outs of badging complete with the happy paths and corner cases, he’ll have a much better chance at understanding it and being able to contribute fixes and new functionality than if you just set him loose on the code base itself.

Conclusion

I really hope I’ve made my point and I hope this helps somebody, somewhere (if not Joel and Jeff), to understand why TDD isn’t just an academic pursuit or a masochistic technique that only “obsessive compulsive” programmers partake in (as Joel might say). It adds real value, and real quality while broadening your team’s understanding of your product.

To Joel and Jeff….

I don’t know if Joel and Jeff are sick of this topic, maybe it’s been beaten into the ground too much already, but I’d love if either they would join us on our podcast or us on theirs to rehash some of the issues. So Joel/Jeff if you are up for it, let me know, I’d love to talk further.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

craig Craig, General , ,

Why Windows isn’t ready for the desktop

May 24th, 2009

Slashdot recently ran a story on yet another “Why Linux isn’t ready for the desktop.”

This one was rather nice. It contained a nice technical analysis with only a few errors. It’s not this one that I’ll be complaining about today, it’s the millions of others of these types of articles that seem to be written by long-time Windows users that just happened to have tried Linux and need something to blog about.

Most of the time these users list install issues or driver support as their biggest issue, then conclude that because Photoshop or some other specific applications aren’t available (and assume never will be) that Linux is doomed and its users should just give up.

Unfortunately, these arguments are flawed on several fronts. First, Linux can’t do anything about the lack of availability of certain commercial applications. This is just a fact of smaller market share. As market share increases, these applications will come on board. Linux can be the perfect operating system, but if it only has 1% of the market share, your specialized accounting application that you bought five years ago still isn’t going to run (ignoring wine and virtualization solutions here). Linux is sometimes able to offer you alternatives (for example, the GIMP), but if you really need Photoshop then yeah, Linux isn’t an option to you. Only Adobe can rectify this.

Second, no one ever has to install Windows - it comes with their computers. The hardware maker has already made sure everything (hardware-wise) works out of the box. Testing and judging Linux’s install process but not Windows’ seems unfair.

As a full-time Linux user and programmer, I can’t ignore Windows and still must boot it up occasionally to compile and test my software. Every time I go back to Windows to do this work, I’m constantly reminded of the flaws Windows has, flaws that are probably ignored and invisible to the veteran Windows-only user. In fact, the flaws are so glaring, that I sometimes wonder how this crappy operating system became (and stays) the leader (answer: momentum: PC builder support and 3rd party software support). After I’m done a typical session, I snidely conclude that Windows (XP in this case, lets not get started on Vista) isn’t yet ready for the desktop, and here’s why:

Poor installer - not usable by average users (luckily they don’t have to). Lacks drivers and poor auto-detection of hardware, often leaves the computer installed without network, sound or 3D video card support. Had to go to another computer with network access to download network card drivers for the first machine. Have to search the backwater download areas of various sites, running random (and dangerous) executable installers hoping that I have the right one for my particular hardware adapter. Lots of reboots between driver installed wasting boatloads of time. Older hardware often completely unsupported in new versions of operating systems. No live CD. Unfriendly to non-Windows partitions.

Auto upgrades seems slow. Asks a lot of questions, and is very intrusive. Tries to sneak in and install additional software (WGA, IE, etc). Sometimes forgets previous refusals and nags some more. Can scare new users easily, especially when asking about installing new software or displaying EULAs. No nice (central, Internet) package management system. Add/remove programs panel in Control panel sometimes doesn’t work and doesn’t include all software. Updater sometimes reboots the computer automatically, abruptly terminating any running programs that the user may have delivery left running.

No central upgrading system for 3rd party software. Why doesn’t the add/remove program window in control do this? 3rd party (or even 1st party Microsoft like Media player) seems to do their own updating, constantly nagging the user with update and restart requests. New users can be surprised by these queries. Highly intrusive. Upgrades can easily break stuff (no proper dependency tracking) as upgrades may not just include version patches, but completely new versions of software. Not user friendly at all.

Requires virus scanner. Base operating system demands it, yet doesn’t provide one. Can be disabled though. Virus scanner makes computer much slower. Without such a scanner though, machine is highly vulnerable, especially since many required utilisation and software packages come from the Internet via the web browser as executables - not the safest delivery vector. Some kind of chmod +x system should be required - software should come in packages and/or package repositories.

No nice repository for additional software. Must find them developer’s web sites. This however can be dangerous as if you aren’t familiar with the developer, there is a risk of getting malware. There is some kind of signing system for executables, but the user can (too) easily dismiss the queries/warnings, rendering the system ineffective.

The default web browser, IE, is still quite insecure, has (had) poor web standards support and still supports ActiveX, an insane idea (from a security standpoint).

Lacks lots of basic software. PDF viewer, ssh clients, GUI ftp client, torrent client, decent zip-client, decent photo editing, CD/DVD burning software, CD-to-MP3 ripping, etc. Some stuff can be downloaded from Microsoft’s site, but this requires knowing about it, finding it and other hassles. Sometimes add-on software can wreck havoc, like after-market firewall or wifi network management software. New users would need the advice of experienced users to avoid installing malware, who have set up realistic-looking mock sites to trap and ensnare users.

Lacking lots of codecs out of the box (like DivX) with no obvious method of getting them. Media player won’t rip to MP3 by default, insisting on WMA, even though MP3 is the de-facto standard (to be fair, iTunes is guilty of this too)

The basic software that is there is not polished. The picture viewer doesn’t do EXIF rotation. Notepad doesn’t support UNIX or mac line endings. WebDAV client support is just broken.

Very unfriendly environment to developers or system admins (and other such power users). Poor command line (shell), no ssh system, non standard build tools (like make), no scripting languages out of the box, lacks many basic command line utilities. This would seem easy to fix, but Microsoft seems to like to make Windows drastically different (i.e. dislikes anything command line related or anything it didn’t invent) in this respect. This results in Windows being a difficult platform to use when working with many open source projects or languages. Developers pretty much have to be using full IDEs and packages, but even in those cases, assembling libraries and build systems is still a pain with lots of trial and error. Cygwin is a half-solution at best. A Microsoft sanctioned shell, ssh client/server and collection of utilities would be best. Apple seemed to have done it, why can’t Microsoft?

Not very customizable or tunable by hardware makers, making it an ill fated choice for netbooks. Depending on how the netbook market goes, this may or may not resolve itself. If netbooks get more powerful for the same price, then they can more easily handle Microsoft’s operating systems. However, if they get cheaper by using even lower cost components (ARM CPUs, for example), then Microsoft’s operating system will be completely shut out.

Windows, on the surface, seems like it would be a complete failure as a desktop operating system. However, it has the world’s momentum behind it. All system builds prep their products for it, all corporate technicians are trained to care and feed Microsoft’s offerings, a large software ecosystem is ready to fill its gaps and everyone has just plain gotten used to its quirks. This tolerance for crappy software is often misconstrued as being easy to use, when in fact it’s simply the devil-you-know vs the devil-you-don’t phenomena. People don’t so much think Windows is easy to use as they’re just used to its crapulence and don’t want to bother with anything else. They might even know it’s a crappy system, but at least they’re comforted in knowing that their system isn’t any crappier than their neighbours - everyone’s in the same boat.

Suffice to say, there will be no distinct “year of the Linux desktop”. It’ll be a gradual process, as Linux slowly grows into markets (netbooks, corporate desktops, servers, devices) and slowly encroaches into general desktops. Linux lacks all kinds of software, but every year, it gets a few more (free and commercial) apps (or the apps move to the web) and a few more converts.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

alex Alex, General

Scala, a cursory glance

April 8th, 2009

Recently, the Scala language was brought to my attention.

Now, I’ve been around the language block a few times, having seen my share of languages. I’m aware and suspicious of the siren-like call new languages have for programmers. They tickle our programming curiosities to the core, offering silver-bullet, paradigm-shifting opportunities for increased productivity. Unfortunately, they require lots of commitment, community, support libraries and momentum to become useful, so one has to be pragmatic when adopting new languages. I tend to error more on the conservative side, but Scala beckoned me to have a closer look. These are my cursory observations.

What first drew me to Scala was its offering of type-safe and concise programming models, based on generics and functional programming. Although the key reason I use C++ is performance, it’s the type safety and concise power of templates that keeps me there. I find type-safe languages provide for more readable and maintainable code bases, something that is critical for large and aging projects. Scala seems to push for some of these same ideals.

The first benefit of Scala is immediate: it compiles to Java byte code and is able to utilize Java libraries. This means you can integrate with your existing Java code, use the plethora of existing Java libraries and reuse the man-centuries of work that went into Java VMs. This is somewhat analogous to how C++ can use C. However, C code can (mostly) be compiled as C++ code, Scala code is not anywhere near valid Java code. Although this affords the Scala designers more freedom, it creates another learning curve for Java programmers.

I may have overestimated Scala’s intended integration with Java though, as they also have a preliminary link up with .NET working. This could be interesting, or it could split its community focus.

The language itself is very functional and recursive. Functions are first class objects, specialization/type searching is handled via a powerful pattern-matching system and generics seem to be on the right track. This kind of stuff lets you build very interesting DSLs (domain specific languages), something that I think will vital for the future. This means you can build stuff like C#’s LINQ SQL query system into a programming language, without having to update the language — all done as a library. New web presentation mark-up languages, mini-programming/scripting languages, XML query/processing, etc. could all be done as libraries. Neat stuff.

My very cursory inspections with “javap”, the Java class disassembler, shows that Scala is not doing the type specific in-lining I thought it would be (for example, instantiating functions for each specific type T that is used). This means I won’t get my performance wishes out of Scala, which is too bad, since that would be more interesting that providing yet another deferred-to-runtime type system (even if it has a nice type-safe compile time checker).

It’s an interesting project, and I wish them the best of luck. Programming languages require large investments in time, community and libraries, and they’re just beginning this long road and still have a ways to go before I’d commit any large projects to them. This segways into my final, not-really-Scala observation:

Why are the Twitter guys all hot for it?

Twitter (via programmer Alex Payne) seem to be claiming that their notorious problems with scalability and reliability can be traced back to Ruby on Rails. RoR haxxor Obie Fernandez attempts to refute this. Whether RoR can handle the load or the Twitter programmers just don’t know how to use it, I don’t know or care. What I do know is that if you’re going to switch to something else, especially for your critical messaging queuing core, don’t jump to something even more obscure and untested.

Alex Payne says Scala is fun and gives him the fuzzies, which is all fine and dandy, but for god’s sake man, think about the business here and not the Scala book you’re penning. You need something scalable and tested, which usually means old and boring. That’s just business. Make Twitter work, sell it, and get (even more?) rich.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

alex Alex, General , , , ,

Creating an FBJS Widget

April 2nd, 2009

Those of us who have created more than our fair share of javascript widgets, who have grown to love their favourite frameworks like jQuery, prototype and script.acul.us, think we’ll simply whip off a widget for our Facebook application in no time flat. Hell, we’ll probably just use some existing ones, add a few tweaks and be off to the races. Then we come up against a daunting reality…. FBJS is Javascript, but it’s Javascript running within the framework of a Sandbox

Read more…

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

craig Craig, General ,

Five Days of Wicket!

March 11th, 2009

Wicket Logo

Checkout this series of articles I’m involved in over at Mystic Coders called The Five Days of Wicket. The purpose of the article is to show how to create a properly layered Wicket application complete with complimentary frameworks such as Spring and Hibernate.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

craig Craig, General

Stupid C++ Tricks

March 7th, 2009

I recently came across this C++ Soup post, which demonstrates some cute C++ tricks. Now by cute, I mean stupid, similar to Dave Letterman’s segment “stupid pet tricks” (you can google that if you’ve never seen this). It’s a useless language exercise with little practical application except to show how obfuscated one can make C++. Are there any benefit to these tricks? Lets explore.

Now all C++ programmers do this (myself included) just to see if they understand template programming, so keep in mind that this is NOT a critique of this particular author, who I’m sure is a C++ Ninja. It’s just a recent example that triggered this rant. No, just have a look at half the boost libraries to see this thinking taken to the extreme. Or even the C++ standard library; does anyone really use the cumbersome std::for_each function or any of that bind stuff? They all feel like they’re unfinished ideas: they’re onto something, but they’re not quite there yet.

These (what I’m calling) C++ tricks are often segments of templated C++ code that push generic programming to solve some kind of basic problem, that is typically solved using simpler (but more verbose) code. A trick author is often amazed (and proud) at how small or flexible the code is, but hopefully realizes that the amount of work or expertise required to make the trick outweighs most benefits. The code is then shelved. Lets cut this silliness out.

Furthermore, most application developers will steer clear (or be ignorant) of such tricks, and popular C++ libraries do well to not require such expertise from their users.

Is there any benefit to these tricks? Yes, only to show what could be possible with C++.

C++ is an extremely powerful language, giving you compile time dynamic/generic programming with no loss of runtime performance. No other language does this so fully and completely, and C++ is still the only language option in many demanding areas.

However, the language needs to grow, and it needs to grow fast. We must look at what these tricks are trying to do, and then think how we can change the language to do the same thing in a sane, logical fashion. C++0x is working on this with lambdas, type inference, better error reporting and some other niceties. But we needed these features yesterday, and get people using them. Lets steal more features from other languages. Lets turn up the meta programming capabilities so we can extend the language without meta-compilers and preprocessors, which until now provide the bulk of the useful new language extensions.

There is no reason why C++ can’t offer easy to use and powerful compile-time dynamic programming, resulting in code that looks like a dynamic scripting language, but with safer types and kick-ass performance, memory use and code size.

Lets get to work :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit

alex Alex ,