Archives for category: programming

A few months ago I published a post on keeping techie books entertaining, led by Why’s? poignant guide to Ruby. It seems the trend is catching on …

Already available in ebook format, and soon to be released is ‘The Land of Lisp’, a comic book guide to lispy languages. With the popularity of functional programming growing each day, (thanks to languages like Ruby, Clojure and Scala), this seems like an awesome way to get your head around a tricky subject.

The music video says it all!

As a massive geek I do have a softspot for vim.

Unfortunately, vim frequently clashes with your cool black terminal background, and causes blindness due to having dark writing on it’s equally dark background.

Good news everybody! It’s pretty darn easy to fix this.

Just create your ~/.vimrc file using your favourite text editor (vim of course).

And add the following lines :


:syn on

set background=dark

Now you’ll have nice shiny writing on your cool black background – awesome!

This year, on August 19, celebrate Whyday. Set aside that day to remember Why’s contributions to our community and culture by hacking just for the fun and joy of it.

  • See how far you can push some weird corner of Ruby (or some other language).
  • Choose a tight constraint (for example, 4 kilobytes of source code) and see what you can do with it.
  • Try that wild idea you’ve been sitting on because it’s too crazy.
  • You can work to maintain some of the software Why left us (although Why is more about creating beautiful new things than polishing old things).
  • On the other hand, Why is passionate about teaching programming to children. So improvements to Hackety Hack would be welcome.
  • Or take direct action along those lines, and teach Ruby to a child.

http://whyday.org/

Hmm I wonder what to do!!??

I’ve been looking for original tech tutorials on the net. I read _Why’s guide to Ruby some time ago and really loved the style, finding it a great approach to check out Ruby, and to learn in general.

Unfortunately most tutorials on the net are pretty dry in comparison, so I decided to try and hunt down more of these fun ‘books’.

_Why’s Poignant Guide to Ruby

_Why’s guide is an awesome introduction to Ruby. You’ve probably already heard of it (it’s world renown), and if not then you should definitely check it out. It’s how I first got into Ruby (and dynamic languages in general).

Unfortunately _Why has disappeared from the programming world for now, shutting down all his sites and code repositories last year. But his book lives on, and those who have read it await his return (kinda like Jesus).

Learn You a Haskell for Great Good

Now functional languages are well-known for being a bit abstract and ‘out there’. Not as straight forward as procedural code, and not as intuitive as the object-oriented paradigm, but arguably much more powerful, functional programming is well worth checking out.

A good place to start is Haskell and the guide ‘Learn You a Haskell for Great Good’. Inspired by _Why’s Ruby guide, it is really easy to understand, and a joy to read (doesn’t feel like learning at all!).

AES Encryption

The only other similarly styled tutorial I could find was one about the Advanced Encryption Standard (AES). A pretty heavy subject, but made easier by the stick man drawings.

Seven Languages in Seven Weeks

The pragmatic publishers produce some great books, and one on the cards for this summer is ‘Seven Languages in Seven Weeks’. This book will run through seven languages including Ruby and Haskell, teaching the basics of each in turn.

I think a great compliment to this book would be a collection of alternative tutorials, (we already have the two for Ruby and Haskell).


Any More?

So if you know of any other similar ‘alternative tutorials’ I’d love to check them out – please drop me a comment if you have any ideas!?

I saw this link when reading a book on Python – and think these are pretty good guidelines for any programming language, not just python.

I decided to include them here to remind myself of these principles frequently. You can find the original link at http://www.python.org/dev/peps/pep-0020/

  •  Beautiful is better than ugly.
  • Explicit is better than implicit.
  • Simple is better than complex.
  • Complex is better than complicated.
  • Flat is better than nested.
  • Sparse is better than dense.
  • Readability counts.
  • Special cases aren’t special enough to break the rules.
  • Although practicality beats purity.
  • Errors should never pass silently.
  • Unless explicitly silenced.
  • In the face of ambiguity, refuse the temptation to guess.
  • There should be one– and preferably only one –obvious way to do it.
  • Although that way may not be obvious at first unless you’re Dutch.
  • Now is better than never.
  • Although never is often better than *right* now.
  • If the implementation is hard to explain, it’s a bad idea.
  • If the implementation is easy to explain, it may be a good idea.
  • Namespaces are one honking great idea — let’s do more of those!

“Java has evolved from a groundbreaking, revolutionary language platform to something closer to a modern-day version of Cobol. In just 15 years”. (from Geriatric Java struggles to stay relevant)

As a Java developer myself I can totally appreciate this. In fact I remember saying exactly the same thing just a few months ago (to an ex-Sun developer), and it seems that everyone is coming to the same conclusion, if they hadn’t already.  After just a taste of some of the more ‘modern’ languages such as Ruby, I find myself struggling to come up with Java solutions anything close to the elegance that these ‘cooler’ languages provide – not to mention the order of magnitude reduction in the amount of code written.

So why has Java become so old and frustrating, when no so long ago it was the darling of the tech industry.

Old clunky syntax is surely a major part. Java’s power is in its library support, and not in its syntax which is frankly overly verbose, overly strict and generally inelegant. Admittedly the first two points mentioned make it a good language for newbie coders as everything has to be explicitly ‘put out there’ and you get your wrists slapped by the compiler if you try anything a little out of the box! But as far as expressiveness goes, this is where it fails. Its strictness is the death of creativity (Groovy builders / DSL’s anyone?).

Lack of closures, is closely related to the last point. Once you use closures in your coding, you’ll never be able to think the same again, they just give you so much more flexibility it’s ridiculous. Ok, so you can kind of achieve the same with inner classes, plus they’re being put in for the Java 7 release, but what are the odds they’ll be unnatural and forced, as generics were in Java 5.

Concurrency has been a major concern of mine for some time now. Chip makers, such as Intel, have given up on Moore’s law and are now using the tactic of multiple low powered cores in a processor, rather than a single high powered core. This means that all our single threaded Java apps will actually run slower on newer processors than ones from 2-3 years ago (as the single thread is confined to a single core). I’m sure if you’ve attempted concurrency in a Java app (without the use of a framework, such as the servlet framework) then you’ll appreciate how complex, and confusing it can be. This is one of Java’s big downfall’s, and a major problem for the future, whereas newer languages such as Scala, Clojure handle this quite elegantly with, for example, transactional memory.

So what is the future?

Well as I mentioned earlier, I believe Java’s power is not in the language, but in the JVM and libraries associated with it. Millions and millions of apps have been written for Java over the past 15 years, and it’s almost guaranteed that if you need to hook into another system there is already a library to do it. Need to write an app for a supermarket system, use JBarcode; need a machine learning library, look no further than Apache Mahout, etc.

To hook into this vast collection of code (without using Java itself), it will be the newer, cooler JVM languages that will carry on Java’s legacy, while the language itself quickly becomes the next Cobol, or Pascal. Any JVM language can interact with Java’s own bytecode, so none of this rich history is lost, nothing needs to be re-written, but we also don’t need to hang onto old syntax and conventions to achieve this.

… and what of the non-JVM languages. What are the cool contenders there? which languages will the young new hackers be using? I know which two are on my learning list,

any other recommendations?

Interesting Posts

The Struggle to Keep Java Relevant

Geriatric Java Struggles to Stay Relevant

Oracle Looks to Keep Java Interesting and Attract Young Developers

Follow

Get every new post delivered to your Inbox.