[GEEKY] JavaScript – Universal Language of the Future

JavaScript is the language of the future. Why do I say this?

I love Ruby, I respect Java, and I am jealous of Python. And of course I have a warm spot in my heart for C++. Think about it. JavaScript is unique among all those languages:

  • Any computer you can get your hands on nowadays has a working, and probably very fast JavaScript compiler/interpreter. Laptops, Desktops, Servers, Mac, Pc, Linux, Phone, Tablet. ALL OF THEM.  You can’t say that of any of the other languages.
  • Because of the browser wars, and probably spurred on by Google and Chrome, there has been enormous investment in JavaScript performance so that it is now respected as a viable high performance language for server side apps.
  • As a language, it’s not shabby. Most people don’t think about JavaScript as a full fledged programming language, but it does have some great characteristics.

If you don’t believe me, here’s another person who comes to the same conclusion by a slightly different route:

“Web servers, rich web client libraries, HTML5, databases, even JavaScript-based languages: I see JavaScript everywhere. If you have avoided JavaScript, this is the year to learn it. There’s no excuse — and if you don’t, you risk being left behind.” (from “Why a JavaScript Hater thinks everyone needs to learn JavaScript in the next year.”)

So, go learn JavaScript. You will need it for your next job.

[GEEKY] Poker AI

An interesting article about how to think about designing Artificial Intelligence for playing poker. It’s high level but gives you a good feel about how this writer went about the design. You also learn the basics of Poker at the same time:

“It is very important in this type of project, for any AI project really, to fully understand the rules of the game and the tactics typically used to win. So when I worked on poker I spent a fair amount of time reading the best books and playing the game, both against existing AI and real humans of various levels of experience.” (from Poker AI: A Starting Point)

And here’s a follow up article on the same topic: “Aces High: Numerical Techniques in Poker AI

[GEEKY] Interesting collection of algorithms and great Ruby tutorial

Over the last several months I’ve been following a series of blog postings by Jamis Buck on the esoteric and quirky topic of writing programs to design mazes.

For reasons that are not clear, Jamis developed an obsession with mazes and has collected a series of articles detailing many different algorithms, their tradeoffs and concepts and writing them up beautifully.

Today in his final installment he summarized the project:

Over the last six weeks I documented eleven different maze generation algorithms. It’s been a blast. I’ve had so much fun researching and implementing these! It’s been great to see some of you taking my advice and applying these to learning a new programming language, as well; I really believe there is a lot of value to be had, there. (from Maze Generation: Algorithm Recap)

If you like programming, or like algorithms, or want to improve your Ruby skills, I strongly recommend this series: Maze Generation: Algorithm Recap

A great article about scientific discourse

This article is called “Fact and Folklore In Software Engineering” and while it is about that, the part that was more interesting to me was the first section talking about Scientific Discourse:

“This article is about why some “facts” refuse to die, and about how to avoid being fooled by opinion disguised as scientific “fact”. We start, therefore, with some observations on science and facts.” (from “Fact and Folklore In Software Engineering”)

Here he goes on to describe “The messy workings of scientific discourse”. It’s clarifying explanation of a process that we understand intuitively but actually has a rigorous process:

“Bruno Latour is one of the keenest observers I know of the work that scientists really do, and one of the most punctilious in clearing away the myths and misconceptions about how science is in fact done. I have found good use in some of the tools he created to assess the status of an ongoingdebate about a matter that falls within the purview of science, one that hasn’t been settled – what he calls a controversy.” (from “Fact and Folklore In Software Engineering”)

After lots of further interesting detail about this idea, he finally comes back to the question: “So what is known about programmer productivity?”:

“We can now circle back to this widely circulated “fact” of the software profession, according to which “programmer productivity varies by a factor of 10 (or 5, or 20) between the best and worst individuals”. This is a remarkable statement, not least because of its implications: for instance, programmer compensation does not vary accordingly.” (from “Fact and Folklore In Software Engineering”)

After this introduction he goes on to thoroughly take apart this concept as nothing more than unsubstantiated, oft-repeated folklore, based in some really old, actually inapplicable, and incorrectly cited studies.

But they stick because there is a grain of truth in them. The problem is that it’s just a grain of truth. It’s a wonderful article. Read “Fact and Folklore In Software.

Great article about ‘lean’

I recommend this article, “Fatboy in A Lean World”, (by Gordon Guthrie) if you are interested in ‘lean’ as in Lean Startups, Lean Production.

About why lean production is becoming so hot among us software entrepreneurs:

The great transformation of the industry over the last 10 years has been the availability of already-written (and battle tested) software which has slashed the size of a team that can build a functioning product and the crash in price of hardware. (from Fatboy in a Lean World)

About Y-Combinator’s philosophy:

The YCombinator slogan is build things people want. Lean production is the double negative of that: don’t build things people don’t want. (fromFatboy in a Lean World)

About one of the key concepts of lean, the “minimum viable product” or MVP:

“Like all hot concepts there is a lifecycle of hype. When people realise it is useful they first start by re-categorising everything they all ready do as the flavour de jour. Then it blooms and blooms and starts being applied quite wildly.

An example of this would be the rise of paper prototypes as MVP’s. Paper prototypes are a great and cheap way of working out design and interface issues but they need to be tempered with capability.

I could knock up a paper prototype of an iPhone teleportation app and get great customer stats (‘96% of 14-25 year olds would def-in-et-ely pay $1,000 for this app, right here, right now!’). But without capability it is just piss and wind.

Patrick Vlaskovits and Eric Ries would define an MVP loosely as ‘enough product to test a hypothesis’ – and would insist that if it isn’t testing a hypothesis, then it isn’t an MVP.

I am all in favour of testing hypothesis by the cheapest mechanisms possible, but my gut instinct is that you probably should not call it an MVP unless it is a product – a product that you are actually trying to sell, right here, right now. An MVP, after all, is a Minimum Viable Product. If your users are not your users (but your product) you should be thinking how do I get enough users to ‘sell’ to whoever your customers are (lead generation, advertisers, market information, whatever). (from Fatboy in a Lean World

Read the article: Fatboy in a Lean World and also check out the links in the footnotes. More good stuff.

[GEEKY] Resfulie GEM for Rails and RESˇ

This is really nice: Restfulie – Rest from Scratch. It’s a package of code for creating REST clients and servers with built in content type negotiation and other goodies. Watch the fun tour-do-force video too:


“Rest from scratch” with Rails and Restfulie – part 1 from Caelum on Vimeo.

[Geeky] RubyConf Summary (updated 2)

RubyConf 2010 was excellent. It was my first and probably not my last. Some general thoughts and then a master list of links (the real meat.)

  • Unlike most all ‘business’ type conferences and talks I have gone to, the RubyConf style of presentation (and perhaps the Rails or Ruby community — I don’t know where it stops) is beautifully minimalist. Very few words on slides, large and impactful photographs. Is it because no one uses PowerPoint and few even use Keynote? I don’t know. But there were no text heavy, bullet heavy word slides. And also, lots and lots of code (that part is definitely a geek thing.)

Here is a loosely organized set of links to the things that hit me most at RubyConf this year. It’s random and idiosyncratic (same thing?) but it reflects my real-time notes and feelings. These were all new to me but they might be old news to you, of course.

These are my top links:

  • nicksieger’s warbler at master – GitHub – This was one of my top 5 talks. Warbler is a tool to package a Ruby and/or Rails application into a single .jar or .war file to be run on any other computer that has a Java VM installed. If this works as advertised it is a very important bit of technology. I am going to try it out
  • MacRuby: The Definitive Guide – Another one of my favorite talks, about MacRuby, a Mac OS X implementation of Ruby. From what I saw it looks very real, with good integration with all the Mac OS X libraries, and running on top of the Objective C runtime. It wasn’t totally clear what Apple’s posture is relative to MacRuby, but I hope it is positive.
  • mattmatt’s showoff at master – GitHub – Showoff is a very neat presentation tool. It’s not an app like Keynote its actually a gem which processes a minimalist markup and serves it up in a local Sinatra server. Also easily lets you deploy your presentation to Heroku. Hmm. Is it mattmatt’s or schacon’s showoff at master – GitHub???
  • Git Wrangling – This was an intense and complex talk about Git. There is as we know, so much more in Git than most people use, and this talk touched into it. Also, Scott Chacon had a funny (but I think he was serious about it) interlude about how to be a gentleman. It includes the recommendation that a gentleman will always rise when a lady enters the room. Also check out these links with further details about the slides (really, they are good!).
  • Ruby Mendicant University – A really inspiring talk by Greg Brown about his vision and mission to teach people about Ruby and programming. But this is not a fly by night little course, Greg has a big vision and is pursuing this in a comprehensive and highly innovative manner. I was very impressed and will follow and support Greg’s work. A great guy!

And here are many more really good ones:

  • https://github.com/sconover/wrong – And this is the lightening talk that never happened but I saw mentioned in an email. Apparently there was not sufficient time allowed, and some great talks never happened. This one is about a gem called wrong that defines (can you believe it?) yet another way to express expectations (like assert_ and expect_ and etc etc.) But it’s really nice and minimalist. I think it’s a good addition to the canon!
  • DNS Simple – This looks important to me, and I think I could really use it. Except… I wish I understood better where DNS Simple fits in my scheme of things. Does it mean that I could ditch GoDaddy as the keeper of my own set of domain names? Would it cost less? Would I be able to cloak my personal name and address like I do with GoDaddy? What are the plusses and minusses? (N.B. See the detailed responses to all these points in the comments)
  • The GO language – I hadn’t heard of this language, although it’s pretty (really) old after all it’s only about 1 year old. Worth looking at for its support of co-routines.
  • http://www.kanbanpad.com/ – A nicely executed very lightweight project planning ‘virtual whiteboard’, for the new/old Kanban methodology.
  • Ticketmaster – A tool or platform to connect project/ticket tracking systems together. I post to my ticket tracker, and TicketMaster forwards the new ticket to one or more other ticket trackers (e.g. those my client uses.) This is a tricky problem – how do you handle deletes, and do changes to tickets flow both ways? I didn’t look how well TicketMaster tries to solve those problems.
  • Hipster – A bit of 2010 Culture that I hadn’t seen before. Ok. Culture is stretching it.
  • http://dl.dropbox.com/u/163257/macruby_2010.pdf – PDF of the Mac Ruby Presentation
  • Apigee | Free and Enterprise API Management Products and Infrastructure – This is a super cool tool to test and experiment with web apis. Interestingly this comes from the guy who build Swivel.com.
  • rabbit | RubyGems.org | your community gem host – Another presentation tool, analogous to showoff.
  • Stop procrastination: Introducing the noprocrast gem – rfw.posterous.com – Proof that I am not the only one that gets distracted while working. Here a fellow designed a little utility to cut him off from the net while he is trying to focus. This is called self-binding. Check out this other article which I have pointed to before about the concept of self-binding (it’s not as kinky as it sounds.)
  • RubyConf 2010 | SpeakerRate – We are a community who loves building tools. Here’s a tool that lets listeners at any conference rate speakers. Very cool building block.
  • http://blog.danieljackoway.com/rubyconf-2010.html – Daniel presented about Ruboto, a tool allowing us to write Android applications in Ruby. One nice thing that Jack covers, and I saw this in many of the presentation, is a forthright summary of other tools and solutions that one might consider in addition to Ruboto.
  • Redcar – An all-ruby programmers editor — TextMate written in Ruby. This was a very popular talk and it generated a lot of conversation. It is a work in progress but is very promising. The demonstrations of writing custom commands in Ruby on the fly were impressive. For me personally, I still prefer a full IDE especially one with a visual debugger. I am actually surprised that Rubyists as far as I can tell don’t use an interactive debugger (see this survey)
  • http://tmm1.net/debugging-ruby-systems.pdf – A really good presentation. This pdf (after a bunch of photos at the beginning) is chock full of specific utilities and techniques for advanced profiling and analysis of your ruby and Rails code.
  • ZOMG WHY IS THIS CODE SO SLOW – A presentation that unfortunately I missed, but so good that the slides stand on their own. Lots of specific tips around Rails and Ruby Performance
  • bfts’s minitest-2.0.0 Documentation – A small replacement for Test::Unit. I thought I heard that it was part of Ruby 1.9, but I might have misunderstood.
  • tmm1’s perftools.rb at master – GitHub – An interesting package of performance tools on Git
  • MIRAH – An interesting little language, it looks like Ruby (but it’s NOT Ruby). It is statically typed and compiles directly into efficient JVM byte code.
  • schacon’s grit at master – GitHub – One of several gems to access Git and Github functionality from Ruby
  • libgit2’s ribbit at master – GitHub Another one of several gems to access Git and Github functionality from Ruby
  • BusyConf – Making Great Conferences Even Better – A promising service for conferences. From what you can see so far, there will be a nice and detailed conference schedule. But I can imagine many additional bits of functionality.
  • Rc2010 refinements – A presentation by Shugo Maeda, close confidant of Matz and a Ruby Committer. The presentation contemplates some rather exotic additions to the Ruby language to overcome some problems that are encountered by large systems built in Ruby. Coyly described as features that might be in Ruby 2.0, which is on an unknown schedule.
  • RabbitMQ – Messaging that just works – A highly touted message queueing platform, usable with Ruby and Rails and other systems.
  • collectiveidea’s delayed_job at master – GitHub – Delayed job is a popular Ruby based background job product.
  • markbates’s dj_remixes at master – GitHub – Mark Bates adds some great additional functionality to Delayed Job
  • slagyr’s solari at master – GitHub – A very cute Raffling applications used when you have to raffle something to a big crowd. Very cute, looks great, sound effects and so on.
  • robey’s kestrel at master – GitHub – Kestrel is the follow on to Starling, which is a message queueing platform, originally from Twitter.
  • Home — JRuby.org – JRuby is JRuby. I haven’t tried it yet. But my sense is that it’s definitely worth using in many situations. You can access the huge collection of Java libraries, and, because of the highly optimized JVM, you often will have better performance than MRI (the original and still default Ruby VM)
  • Rails Talk Ruby CSS Parser – I was thinking back to some of my own projects, and one is to create a CSS simplifier/optimizer. Here’s a Ruby based CSS parser.

[GEEKY] CSS Deep Thoughts

I feel that I am finally mastering CSS and in doing so I am seeing some interesting patterns. It seems to me that it’s very easy to get into a situation where you have too many CSS rules that overlap and override each other in ways that are more complex than necessary.

It seems like there could and should be a tool to ‘simplify’ or ‘clean up’ css and reduce the rules to the minimum necessary set to accomplish what you want. Clearly the browser when it applies CSS, no matter how messy and redundant, figures it out and does the right thing.

Here are some of the cases that I can see:

  • two or more css rules with exactly the same selector in different part of a file
  • two or more css files which are there for historical reasons but could be merged into one
  • two or more css rules which can be ‘refactored’ into fewer rules by noticing repeating patterns between them and within the context of all the rules.
  • And so on.

So this is not pretty printing or link-like processing, this is more like ‘compiling’ a set of css files and then emitting a minimal clean and logical css back out. Is this a legitimate way to think about things and are there tools to do this, or has this been tried and turned out to be technically intractable? Seems to me like it should be possible.