Close

Last month at Learn Something we tried something new, and it turned out really well!  Learn Something has always been a great place to get together and work on whatever everyone is interested in. Lately we’ve had a lot more inexperienced developers joining us and we wanted to make it easier for them to jump right in, contribute, and gain some skills. With that in mind, we decided to try something more structured that could involve everyone who was interested. We created a challenge to write an autocompletion algorithm. If given a .txt file and an input token, could they return the string that most commonly follows that input token in the .txt file? We split everyone up into two groups, each with an experienced developer leading.  One group chose to tackle the problem with JavaScript, while the other chose Ruby. Both successful solutions were done in just under 2 hours. The two solutions are as follows:

GROUP 1:

index.html
script.js

GROUP 2:

nomnom.rb
In future iterations, both groups could work to handle hyphenated phrases and preserve pre-processing to log all following words. That would allow returning the 2 next most probable words, or the % probability of the next word. Currently, it only returns the most likely next word.

The exercise wasn’t about finding the perfect solution but instead about the process of learning. Mixing experienced and inexperienced developers was a lot of fun. The beginners said they all learned something, and the more advanced devs got to explore a new language and engineer some creative solutions. Going forward, we will offer something more structured for those who attend but don’t have a specific plan for what to learn. If you aren’t interested in that topic, don’t worry, you can still work on whatever you want. Either way, come on out and Learn Something with us!

Go top