def foo(bar)
# A comment
puts bar + ' a string '
end
Saturday, June 30, 2007
source code post test
Thursday, June 28, 2007
developer friendly
It is just assumed in MS developer land that everyone prefers heavy IDE and GUI based developer tools, even for the simplest of tasks. I'm not necessarily suggesting that IDE's are a bad thing, but just that I find it so productive to be able to do the simple easy things in a simple an easy way. Here some examples:
Show table names in a DB
- sqlite: .tables
- (it doesn't get easier then this!)
- mysql: show tables;
- (just about as easy as it gets)
- Microsoft land - (sqlcmd): select distinct table_name from information_schema.columns; go (note: go needs to be on a new line)
- (yuck, what a pain!)
Show column definitions(schema) in a table (foo)
- sqlite: .schema foo
- mysql: show columns from foo;
- Microsoft land sqlcmd (take 1): select * from information_schema.columns where table_name = 'foo'
- more yuck. Additionally, this returns more data then we probably want and it's difficult to see at a quick glance what we are after, so you probably want to refine the query to return just what you want.
- Microsoft land sqlcmd (take 2): select column_name, data_type, is_nullable, column_default from information_schema.columns where table_name = 'foo'
- better results, but double yuck on the effort
- subversion: svn status
- pretty simple, huh?
- MS VSS: ss status /r (Oddly enough, most developers I talk to that focus 100% of their time in the Microsoft only land don't know the ss.exe utility exist)
- However, the results aren't exactly the same as a svn status just based on the inherit differences in the source control mechanism (vss is an exclusive check-out based source control) Seeing as the MS VSS model generally is setup as a "exclusive checkout", which by its very nature makes the idea of local stats a bit different. The source safe database can give a list of what you have checked out, and show history for these items. But, doesn't really know what has been modified, added, etc. until it is checked back in. There is some tight integration with the VS IDE to help give some visual clues to where the new files are (they have a "plus" sign next to them in the IDE) and which files have been checked out (these have a "check mark" next to them.) But other then hunting through the IDE Solution Explorer how does one do this? The soure safe utility is one option. So once you get your environment variables set up right, you can use: ss status /r This gives you a list of which files within your working project source folder have been checked out. But, we don't really know if these have been modified. Also, there is no concept of deleted or added files at this point either. If we want to see if a particular file in the list has been actually modified, we can run a diff on that file like this: ss diff $ProjectName/Subfolder/File ProjectName\Subfolder\File This will give you line by line differences between your local working copy of the file and the latest version "checked in" to source safe. The typing can get quite long if you have some nested project structures just to see what files have been modified. You can also use a Diff on a the entire source folder as in: ss diff /r The output is pretty busy and on a large enough project you can be the judge if this is useful. When it comes to svn I'm generally a command line kind of dev, but for the most part when it comes to interacting with MS VSS, I usually give in and just play the visual IDE integration game.
The point here isn't text editors versus IDE's, or command lines versus GUI tools (i.e. VSS, SQL Management Studio). The point is simply that when developing back and forth between the OSS world, and the Microsoft world, one really develops a sense for just how developer friendly most things are in the OSS world. Simple things remain simple. If I want to drop out to a command and quickly look at a db table definition its just simple. I do it and I'm back in looking at my code in less time then it takes for my SQL Management Studio to open or my verbose sqlcmd command to show a simple table schema to get typed. There are many complex tasks that a powerful tool like SQL Management Studio, or the VS IDE can make easy. But, the easy tasks should just be easy without them. The Microsoft developer world seems to be full of a lot of GUI based "Rad" emphasis, but little emphasis on the simple easy friendly things that really keep developers happy.
JRuby at techvalley.rb
We also took a few minutes to collectively hack away at a problem one of the members was having in a Rails app.
If you are even close to the capital region of NY, aka Albany, aka, Techvalley, on the 4th Wednesday of any month and want to join a bunch of folks that love to talk ruby, we would love to have you stop by and say hello. Event information can be found on the website.
Saturday, June 16, 2007
An eye on OpenSolaris
During the early to mid 90's I was a student in a Computer Systems Engineering program. It might sound a little silly, but I don't think anything in the world has made me feel as much like a computer geek as working on projects that took place in the Solaris/SPARCstation lab on campus. There was just something special about it. I'm sure a big part of that special feeling was due to SPARC hardware. But, the fact remains that whenever I hear Solaris, I think of those days. The campus had a few of your standard mixed Windows/Mac labs where all the non-engineering types did what it was they used computers for in the early 90's, like writing term papers, blah. And then there was the Solaris/SPARCstation lab, ah...
Sadly, enough I haven't personally used a Solaris kernel since those days. I now make a living writing software, mainly web based business applications; but, that real engineering edge isn't as much a part of my current existence as it was when at school. I used HP Unix for a tiny short period after those school days, and I occasionally used some Linux (Red Hat distro). But, since those geeky cool days of working on CSE projects in the Solaris lab, my life has instead been filled almost exclusively with a lot of different Windows OS's, blah.
But, there is hope. I've been running Linux (Ubuntu distro) on and off since 2005, and now exclusively on my personal development machines (a laptop and a desktop) since the end of 2006. I still use Windows OS's on a contract project, but the tide is definitely turning for me. Why did I choose the Ubuntu distro? Well, because it was a walk in the park to get running. When I first toyed with the Ubuntu, probably sometime 2005, I was amazed at how easy it was to get up and running - really in no time. And booting from a single CD to see what it was all about was just too sweet. Slowly, it has infiltrated into my daily life, and as I mentioned, by the end of 2006, I've been personally Ubuntu exclusive.*
But, I would be lying if I said I'm not still longing for a bit more geek sex appeal then I get from something like a Ubuntu distro alone. So, I've been eying OpenSolaris on and off for a few months, thinking if I could only find a little spare time, I would love to give OpenSolaris a test drive. I want the technology; Dtrace, ZFS, etc. I want it for that feeling I remember sitting in the Solaris workstation lab, but I want it on my desktops/laptops. I want Solaris to become a part of my daily development life, and more then an occasional production deployment server that my code might be lucky enough to end up running on. But, I don't think the current “give it a try path” is really all that paved yet, or at least how to get to the path hasn't been all that clear to me.
I've been watching what Ian is doing and saying since joining Sun. I almost feel like he his is talking to me here. I don't exactly fit the demographic, but when he asks at the beginning “It's an operating system? The community version of Solaris? Right?” my hand went up to say, “ah, yeah thats what I thought”. I've probably poked around the Sun web site half a dozen times looking for a quick simple “here, try out OpenSolaris on this 1 easy click link”. I really feel silly now that I didn't realize myself that what I should have been looking for was maybe someone else's OpenSolaris distro, and maybe it would have helped to poke around at opensolaris and not necessarily looking for an OpenSolaris single click download from Sun; I mean talk about naive! I use Linux, I should have realized this, but it just didn't click. I'm hoping project Indiana will deliver and create a clearer path for us naive but curious Solaris seekers. I'm hoping for the walk in the park experience I've come to expect with Ubuntu. When Ian says
How many of you would take Solaris for a spin if doing so was as easy as, say, downloading the latest version of Ubuntu and installing it?my hand was up before I finished the sentence.
* I personally have been Ubuntu exclusive, but there are other OS's in my house beyond what I use for work: my wife is running a Windows Media Center release, oldest son a Mac, and two other children using XP.