The future is Go’s to lose…

Go Language GopherIt would be hard to miss the splash the Go programming language has made in the software engineering community in the last year.  I’ve worked with it over the last several months and am pretty impressed by it, particularly for how new it is.  That being said though, it would be dishonest to claim that most of the buzz on Go isn’t hype right now and like any new technology headed for the trough of disillusionment, it has a lot of work to do if it’s going to stabilize into something that’s going to deliver on it’s promise.    Go is moving fast and given the state of languages out the right now, it has a unique opportunity to firm up a few things and become what people want it to be.  In other words, this is Go’s game to lose right now.

None of this is new, and the following may not be either but I thought I’d be one of the many voices tossing out some of the things I think Go urgently needs to change to take advantage of the opportunity it currently has.  So in no particular order…

Runes are going to ruin us…

For some reason Go decided to forgo a char (character) type in favor of a byte base Rune.  I’m not a character set guy so I’m sure there are good reasons in somewhere in the multi-byte or composing vs non-composing character bushes, but at the end of the day Runes are characters or at least people want to use them that way.  Getting esoteric with what should be such a fundamentally simple concept just seems like a bad idea to me.  Go does a great job of dealing with things on the byte level so I get the thinking behind Runes but the work it takes to treat a Rune like a char, which is most of the use cases, makes it feel like the language is getting the way to me.

Go Get needs to be more long sighted...

I seems kind of neat at first that you can import a go library using it’s GitHub or bitbucket path and import it with the Go Get command but I can’t imagine how this is going to be a good idea in the long run.  Linking a fundamental feature like imports into a low level language to current fads in repository practices seems like such an amazingly bad idea to me.  What happens in 3 years when we’re all onto the next new social coding platform or any number of other things change.  Go Get is neat but a poor (and dangerous) substitute for a a real dependency management system.  Nobody want’s to recreate maven, but maybe something akin to python’s pip would be a big step forward.

Better Collections and Generics

Anyone working with Go has heard this a million times so I wont go into it too much.  Slices, arrays and maps do generally work in my experience, so much so that the mantra of the community is that if you think you need lists, then you’re probably wrong.   Most of the features I find in common collection types from other languages can be built using these low level data types and the experience of doing it is a nice refresher in what is going on at a language level in many collections. That said though I think it’s sometimes confusing and having to explicitly manage slices gets tedious after awhile, mimicking sets out of ‘map[string]bool’ seems strange as does overuse of use the “interface{}” declaration.  The community debate on this is an interesting one and seems to come down to people expressing a desire for common language features either for clarity or convenience.   As you’ll see in my next point, I think we need to do a better job as a language community at valuing clarity. openness and learning and the division over collections is a small example of this divide to me.

Good community needs to be a core principle

As a new language and a community full of early adopters, which way the personality of the go community is going to trend is still very much in the air.    For my part I really hope to see Go follow the python community model to push openness (doing well there), diversity (hmm not so much) and develop a friendly and welcoming base (jury still out).  A trip to any of the Go communities is a very schizophrenic experience right now and while the culture is shaping up to be generally positive and helpful (play.golang.org is a huge help here), we should be mindful that cultivating a strong community is a very purposeful act.  There are spots where grumpy engineers hang out still, wasting the energy to give snarky answers about wasting their energy that it can drive some people away.  Also the entrenchment around issues like Runes or Collections can quickly escalate debates on that topic to something nobody wants to follow.  I threw out the idea of a community code of conduct similar to the one the python community uses and was immediately attacked by parts of the community.    Who adopts Go and what they bring to the community, at this early stage of language and community development, is going to be almost as important to the future of the language as the evolution of the language itself.  Like the social evolution brought on by GitHub, I hope to see Go bring a similar evolution of the more hard core engineering community and open it up to new and diverse engineers in the community and in turn I hope that evolution helps us all become better engineers.

What’s your take on Go, where it needs to develop or improve or do you think it’s perfect where it is?

Posted in Uncategorized. Tagged .

Enabling Vagrant SSH on Windows

Picture of old shoesDevOps tools like VirtualBox and Vagrant are the kind of tools that can make you feel like we’re able to cast off the boundaries of mortal realities and take our place among the stars.  That giddy feeling quickly wares-off however when you try your new powers on a window machine and, not so surprisingly, things don’t quiet work as smoothly as they do on Linux or OS X.

VirtualBox and Vagrant themselves install just fine on my Window 8 rig, and building a box and bringing it up works just fine as well, but things come to a screeching halt when you need to SSH into your running VM as windows just doesn’t have a functional SSH client at command line.  As most windows users will likely guess here comes Putty to the rescue, but it will need a bit of work.

My robot masters at Google eventually let me to a chain of threads that helped me work out how to connect Putty to vagrant and use the SSH key.   The gist of what needs to be done is:

  • The vagrant multi-putty plugin needs to be installed.
  • The directory with the Putty executable needs to be added to the Windows Path.
  • The vagrant private key in your %HOME%/.vagrant.d/insecure_private_key needs to be converted and saved to ppk format and with the ppk extension by puttygen.

So quickly

Install the vagrant multi-putty plugin, from your windows cmd line type:

> vagrant plugin install vagrant-multi-putty

Then add the directory with your putty executable to your PATH (Google it hippies)

Then vagrant generates a private key to use for ‘vagrant ssh’ in your user directory under %HOME%/.vagrant.d/insecure_private_key.  You need to download and open puttygen.exe and select ‘load’, navigating to the directory above and opening the key.  It will convert it to *.ppk format and you need to save the private key with the .ppk extension.

After that just ‘vagrant up’ on whatever box you want and type:

> vagrant putty

and you should be in!

RailsTutorial and Failing Dropdown Menus

Rails on Mac ImageI’m working my way through the very excellent RailsTutorials by Michael Hartl and ran into a problem I thought I’d not here related to gem versions and the 3.2 version of the book.

Throughout the book I was having problems with the twitter bootstrap dropdown menus not working.   It doesn’t become a problem until user sessions later on but when I got there I tried a little troubleshooting.

Checking out the javascript console I found the error:

cannot read property 'webkit' of undefined bootstrap

Which the nice folks over on StackOverflow point out is a version change in query that no longer supports the way one of the methods are called.  If you use a current version of the jquery-rails gem this means bootstrap dropdowns don’t work. the recommended version from the book is 2.0.0 but that has been pulled due to bugs.

To a Ruby and Rails Noob like me (RoobNoob?) it’s not apparent but using the line in your Gemfile

gem 'jquery-rails', '~> 2.0.0'

Will automatically load the latest bug fix in the 2.0.x line, which is 2.0.3 at the time of this post.  Presumably using current versions of jquery-rails and bootstrap-sass would get around this problem but I want to complete the full tutorial before I do much off-roading.

Normalizing Decency in the Development Community.

Adria Richards posted some very disheartening experiences she had at the recent PyCon, dealing with some awkwardly sexual bro-grammers in the audience.    I think everyone with an interest in developer communities or management should read it as it’s a great expression of what I think could be a too common experience.

I don’t want to rehash the whole issue here but there are a few things that specifically jump out at me as I read her experience that I think are worth noting.

I was struck by how much energy she felt she had to put into the descriptions of the incidents and her perception to feel she was justified in feeling outraged and how utterly draining that has to be to women in the development community.  This seems like one of those things that people should just get intuitively and wouldn’t require more than a tweet to illicit the appropriate WTF reaction I think it should.  This poor women has to essentially open a veign and bleed out all over her blog just to get to the point of feeling justified and from the reaction around the twitterverse, even then some people still have their doubts.

That people can act so inappropriately in large groups without some trigger for regulating it always a chilling thing to me.  In this instance a trigger did work in terms of the wonderful PyCon staff but the threshold for activation was just too high to call ourselves and inclusive community.  Active triggers are almost always a last resort option and form a more inclusive community we’re going to have to aspire to more passive triggers to become a self regulating community.

Why is this important to me?

As a profession, our job is essentially to make conceptual models real for people to use.   We have too much of a mono-culture in programming and that hurts our ability to create better conceptual models.  Diversity of background, thinking and personalities is an important tool for improving our set of conceptual models to solve problems in a diverse world. Anything we do to increase diversity and break the monoculture improves the profession.   Do more of that and don’t want for someone else to ask you to.

Why wont RPG Publishers a dopt an Open Data policy?

I often wonder how much of the decline of Tabletop RPGs is due to the failure of publishers to adopt an Open Data model surrounding their IP. Like most of my fellow old-school geeks, I’ve watched the dwindling of games like DnD and Rolemaster with a fair bit of melancholy. Sure, competition from other entertainment sources is a big reason for this but I think we don’t acknowledge the impact the closed nature of publishers and IP managers on the hobby.    Too tight control and an attempt at trying to force what is basically a subscription model  has a greater impact on making the hobby less relevant than we give it credit for.

Running a tabletop roleplaying game is a derivative work by its very nature, with a fair bit of work being injected by the GM and players.  We live in arguably the most accessible period in human history for creating derivative works yet tools and resources are stagnant in the community, I believe largely because of a failure of RPG publishers to make datasets for their game easily available.   Most games present a player or GM with table after table of numbers to look-up, calculate or reference during gameplay but almost none of them make that data available in a way the community can manipulate or build on.  Fans faced with a desire to create tools for the game are forced to hand type large datasets on their own, often wondering if going to all that work will get slammed by the publisher for a violation of their copyright, or made irrelevant with the inevitable next edition of the game where they’ll have to retype the entire dataset again.

Overall I think this lack of openness further wears away at an already eroding potential fanbase and publishers would do well to find ways to further enable the community.  Instead of trying to strictly control the player experience they should be releasing information to facilitate players building deeper experiences and sharing that with other potential fans.   It could be the ship has already sailed for this hobby and nothing can arrest the continued attrition in the community but I can’t quiet give up hope for a tabletop Renascence as there has been for board games.  I just hope if that time arrives for the hobby that publishers will be ready to meet the opportunity as open partners rather than theme park vendors.

Posted in Uncategorized. Tagged .

Windows 8 USB Fix for GRUB 2 Dual Boot

Computer Boot ScreenI recently upgraded my desktop to Windows 8 and set it up to dual boot Ubuntu 12.10 with GRUB 2. To my chagrin doing so seemed to disable USB devices (including keyboard and mouse) when trying to boot to Windows.

The root problem seems to be with how EFI BIOS interact with GRUB 2 and non EFI Operating systems and the general answer lies in enabling the right combination of legacy drivers for USB devices in BIOS.

My own flavor of BIOS is an ASUS EFI BIOS and I after trying various combinations came up with one that works for my system. Posting it here in case it helps anyone else:

  • Legacy USB Support: Auto
  • Legacy USB3.0 Support: Enabled
  • EHCI Hand Off: Enabled

I tried several other combinations of these and none worked but the above did. Makes sense if you think about it, when the drivers fail to load it falls through to the legacy drivers.

Fixed me up and I’m dual booting comfortably.

Channels in Go

One of the really intesting features of Go are ‘go routines’ and channels.

Go Routines are the primary way to deal with concurrency in Go.  They’re similar to threads or coprocesses but manage themselves a bit more elegantly.

Channels are essentially references (pointers) that can recieve or sent values and help syncronize communication across Go Routines and serve as blocking calls to values.

Combined together they can be very powerful, allowing for an engineer to let parts of the code run over in their own Go Routine happily chugging away until it needs to interact with the rest of the application and then it can do so via channels.

Enough Talk.  Use this example code and it should show a bit better what is going on with go routines and channels.  You can also view this on my GitHub project.

// Small script file that gives an example of channels in multiple
// go routines.
package main

import (
	"fmt"
	"time"
	)

// Broadcast to channel.
func chanBroadcast(ch chan string) {
	for {
		time.Sleep(time.Second * 3)
		ch <- "Broadcast!"
	}
}

// Listen on a channel for broadcast.
// Demonstrates blocking nature of channels.
func chanListen(ch chan string) {
	for {
		fmt.Println("... listening ...")
		c := <- ch
		fmt.Println(c)
	}
}

// Another technique uses range to assign.
// This is a great technique if you don't need to do something
// before recieving C.
func chanListenTwo(ch chan string) {
	for c := range ch {
		fmt.Println("......... HUH? ....")
		fmt.Println(c + " Two!")
	}
}

// Setup the go routines and run it all.  Pressing any key ends it.
func main() {
	fmt.Println("PRESS ANY KEY TO EXIT")

	ch := make(chan string)

	go chanBroadcast(ch)
	go chanListen(ch)
	go chanListenTwo(ch)

	var input string
	fmt.Scanln(&input)
	fmt.Println("closed...")

}
Posted in Uncategorized. Tagged .

Away I Go

Silly Walk PictureWith the recent announcement that the Go Programming Language reached 1.0 status I thought I’d pick up a bit of it to see what it’s all about and have been pretty impressed so far.

I came into programming via Perl->ASP->PHP->Java->Ruby->Python or there abouts so I don’t have the experience with pointers, channels and all that fun stuff that a lot of people have coming into the industry through C and such.  So I thought it would be a great learning experience for me to pickup Go.

I’ll be posting examples here as I play, particularly of things that were confusing for me at first in hopes it’ll encourage other people to pick up the language as well.  As a newcomer Go is going to be an interesting little project for me.

Like most people, conceptual models are very important for me and as I play with Go I’ll be posting code examples I’ll use to give myself better conceptual models in hopes it’s helpful to someone out there.

Having used it for a bit now I do hope to see it take hold in the community but nobody can really predict these things.  It’s open source from the start, seems to provide all the strength of C or Java without the bloat and with less complexity, is more focused in behaviors than objects and starts with cloud and networking firmly in mind.

Eventually I’d like to put together a MUD with Go for fun that but that is probably a way off.

Wish me luck.

Posted in Uncategorized. Tagged .

Setting up WordPress 3.x for SSH2 Updates

I ran into a problem I haddn’t previously encountered trying to use AutoUpdate on a WordPress 3.3 installation that required a bit more fixing than I expected.  Overall I’m having a great experience using Rackspace for various staging server needs but the minimal nature of the installs means I’m tweaking server setups and disk images more than I have in the past.

One of the latest tweaks involed getting a WordPress site to work with AutoUpdate after I had been recieving a a “Failed to Connect to FTP server..” error message at the top of the page when trying to update.  So after making sure my permissions were set correctly I looked into the connection type options for auto-updating in wordpress.

The only options I was presented with were FTP (Bad idea for security reasons) and FTPS (different than SFTP, there were a number of comments on this confusion so I thought I’d note it here for anyoen reading.), but what I wanted to to enable SSH2 for updates.

The root issue I discovered is really in the PHP setup and not in wordpress itself.  After reading Kevin van Zonneveld’s post “Make SSH connections with PHP” it was fairly straight forward to get it to work.

Essentially I had to enable ssh2 in PHP by installing the correct libraries.  On my Ubuntu installation that was just by:

sudo apt-get install libssh2-1-dev libssh2-php

which I confirm is installed correctly (as Kevin directs) with:

php -m | grep ssh2

After that I want to setup password based authentication in my case instead of key based so I modify ‘/etc/ssh/sshd_config’ and change the value for ‘PasswordAuthentication’ to ‘yes’

After that I restart ssh via:

sudo service ssh restart

Gong back to my wordpress admin page I select the link to update wordpress, use the userid and password values as needed and leave the key fields blank.

If you can’t talk, you can’t program

Thanks to Danielle Thesis for pointing out this excellent article pointing out the advantage of cities in growing social skills.

Where the Skills Are

Human progress, to a large degree, has depended on the continual expansion of social networks, which enable faster sharing and shaping of ideas. And humanity’s greatest social innovation remains the city. As our cities grow larger, the synapses that connect them—people with exceptional social skills—are becoming ever more essential to economic growth.

As a software engineering manager at a University I often lament that we have no technical challenges, only relationship challenges.  While not entirely true it’s true enough and more often than not the big obstacles we run into have more to do with our ability to communicate, related on a project.

Software is no different from many careers in that it’s a victim of automation.  Gone are the days where a programmer could pull down 60 or 70k a year writing login pages for their institution and that leaves is in a place where software engineers are focused on real technical challenges of a project.  More challenging still is that project owner usually only come to a software engineer when software doesn’t exist that already solves their problem.  So what we most often end up with are people talking to one another with varying degrees of certainty about what they want, often only knowing it’s different but unable to explain exactly how.  In these situations, social skills are arguably more important than programming skills or at the very least more immediately important because if you can’t bootstrap a conversation you’ll never be able to get enough information on what needs to be done.

In these situations it’s also incredibly important to maintain relationships over time.  As Agile proponents love to point out, needs change and software engineering projects need to stay flexible to make sure they’re addressing the real needs of a project and play a major role in helping project owners better realize what those needs are as they see working software.  In this way it’s a highly interactive environment where each conversation, interaction, software release and discussion evolves and advances the overall direction of the project, sometimes in very significant ways.

For me a big litmus test of how well developed the social skills of a project team are comes when I observe how they handle “Gee, I don’t know” or “Wow I was totally wrong about that”.   A team with a high level of trust and well developed social skills are going to take those moments and use them to do something great with the project.  Teams with poorly developed social skills are going to get stuck.  It’s often as simple as that.