Skip to main content

Posts

Tips for Reading Source Code

Reading time is longer than the writing time and most programmers will lose focus along the way (some even fall asleep) especially if they are reading monstrous legacy code. There are several reasons why, in no particular order, 1. Procrastination Programmer: [Wandering mind… Facebook… Twitter…] “Oh man, I have a brilliant idea, I’m going to read more on that… I’ll set aside this crap first and try to come up something innovative.” 2. Impatient Programmer: “I hate this crap, ugly legacy code, it sucks! Can I just have the documents and rewrite everything from scratch?” Project Manager: “Unfortunately, the source code is the only document we have.” 3. Interruptions Team mate: “Hey! Can I have 5 seconds from you? I’m getting a NullPointerException, this is weird, I had everything initialized!” Programmer: “Are you sure? Hold on, let me check that, you might have some methods returning nul...

Installing Go in Ubuntu Jaunty

Processor: x86 Operating System: Ubuntu Linux 9.04 Jaunty Jackalope 1. CONFIGURE THE ENVIRONMENT Set the necessary variables in your .bashrc that is if you are using bash. Assuming you have a 386-descendant processor and you want to keep the installation clean in an external disk (/media/disk). # Google Go Programming Language Settings export GOROOT=/media/disk/go export GOARCH=386 export GOOS=linux export GOBIN=/media/disk/go/bin 2. INSTALL MERCURIAL. Easy. $ sudo easy_install mercurial Install process, Searching for mercurial Reading http://pypi.python.org/simple/mercurial/ Reading http://www.selenic.com/mercurial Best match: mercurial 1.3.1 Downloading http://mercurial.selenic.com/release/mercurial-1.3.1.tar.gz Processing mercurial-1.3.1.tar.gz Running mercurial-1.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-a3YaRd/mercurial-1.3.1/egg-dist-tmp-VyNqd2 zip_safe flag not set; analyzing archive contents... mercurial.lsprof: module references __file__ mercurial.temp...

The Go Programming Language

Good day! Try out [The Go Programming Language] . As quoted from its home page, Go is … … simple package main import "fmt" func main() { fmt.Printf("Hello, 世界\n") } … fast Go compilers produce fast code fast. Typical builds take a fraction of a second yet the resulting programs run nearly as quickly as comparable C or C++ code. … safe Go is type safe and memory safe. Go has pointers but no pointer arithmetic. For random access, use slices, which know their limits. … concurrent Go promotes writing systems and servers as sets of lightweight communicating processes, called goroutines, with strong support from the language. Run thousands of goroutines if you want—and say good-bye to stack overflows. … fun Go has fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection. It feels like a dynamic language but has the speed and safety of a static language. It’s a joy to use. … open source Install Go! Click [h...