Monthly Archives: January 2015

Agile Principles, Patterns, and Practices in C#

Agile Principles, Patterns, and Practices in C# (Robert Martin)

Agile Principles, Patterns, and Practices in C# by Uncle Bob is the best book about modern Software Development I have ever read.

First section (chapters 1-6) is an Overview of Agile, Extreme Programming (XP), and TDD. Very good introduction to modern software development. Chapter 6. shows all these techniques by example, by creating “The Bowling Game” application.

Section 2. is dedicated to SOLID principles, and UML diagrams. Former is described very succinctly, while latter is non-detailed overview of the most important parts with advises how to treat UML diagrams: not as documentation, but rather as a tool for explaining and expressing our thoughts to others (e.g. during the meetings on white board).

Section 3. and 4. is an overview (with examples and very good explanations) of design patterns, and case study of sample Payroll System application. In the case study, authors shows how to use TDD, UML, SOLID principles, and design patterns in the development process.

I really enjoyed this book. Even I knew most of the topics (UML, SOLID, design patterns), this book helped my to systematize my knowledge, and ensure that TDD is NOT dead.

I think this book should be required book for Software Engineering course at every college.

I strongly recommend this book. It is going to my favorite books list.


voiceCmdr – voice commands in the Browser

voice recognition

Recently I discovered Web Speech API. I was already talking to the browser using Google Hangout and Google Translator, but I have never thought about adding voice support to my own website.

I did some research, and I found a demo. Based on that I put up simple demo website (say: “show website blog”, and it will take you directly to the sub page that can be also approached with 3 mouse clicks). For now speech recognition works only in Google Chrome and Safari. In Chrome it is not SpeechRecognition API, but webkitSpeechRegognition API. I hope, in the near future, other browsers will also implement it. Especially Spartan, which is integrated with Cortana.

I noticed that while the API is flexible, it is not easy to use. I think, for most common scenarios, developer would like to be able to add commands associated with function callbacks, and control recognition state with start/stop actions.

I created a JavaScript library voiceCmdr. It is a single .js file without any dependencies. You can install it with npm or bower (check README on github).

You can add commands:

voiceCmdr.addCommand("go home", function () {
  // go to home page
});

Callback function can have parameter, which is everything you said after command. E.g.:

voiceCmdr.addCommand("search", function (param) {
  // search for phrase specified in param
});

You can also remove commands:

voiceCmdr.removeCommand("go home");

In order to start listening for commands:

voiceCmdr.start();

To stop listening:

voiceCmdr.stop();

You can also invoke listening for single command:

voiceCmdr.getCommand();

Check examples, and be aware that Web Speech API works only through http, and https (it will not work if you open static html file). The easiest way to run server is to use python SimpleHTTPServer:

python -m SimpleHTTPServer 8080

This can also go another way (by browser talking to you) with Web Synthesis API.

I am curious what do you think. Are we ready for voice commands in the browser? Are you concerned about your privacy (check Scott Hanselman’s tweet)?


10 things you should learn at the University

I graduated last year, and I would like to summarize things I learnt. In the StackOverflow Podcast #36Eric Sink said: 

The best students learn Computer Science in class and programming on their own.

I remember when back in days my friends from the University were talking about their first job, and 9/10 of them were saying something like that: “During this one month Internship I learnt more than for 3 years in College”. I couldn’t say that about my job. At the beginning I thought that they probably got much better job or internship than me. It took me 3 years to understand this phenomena…and it wasn’t phenomena. They thought, they learnt a lot, because they were able to get something done using some framework that did magic in the background (like creating simple CRUD web application with database configuring everything automatically). However, there is a lot of stuff between framework and hardware. I noticed, that lot of Developers don’t care about it. Moreover, you can live without it. Like taxi driver doesn’t need to know the city, as long as he has GPS. I think it is good to know the fundamentals.

There are some courses, which can help you to learn things, about which you probably will not bother once you get a job. In the same time, they are worth to learn, will help you to understand how computers work, and in my opinion will help in your future job.

Here is my top 10 things/courses you should learn at University (which is the best time for it):

  1. Computer Architecture: to know how computer works, how they represent data (Two’s complement system, IEEE 754). There are two books good books about that: Computer Architecture: A Quantitative Approach and The Elements of Computing Systems.
  2. Compilers: sort of supplement to computer architecture. It is connector between Software and Hardware. Classic book about compilers is Compilers: Principles, Techniques, and Tools (AKA Dragon Book).
  3. Algorithms and Complexity (O notation): this is hard and challenging topic. Require a lot of practice, but pays off in the future. The bible for algorithms and computational complexity is Cormen’s book: Introduction to Algorithms.
  4. Automatas (DFA, NFA, Turing Machine, etc.): “Recognizing the strings in a language is a formal way of expressing any problem”. This is fundamental of Computer Science, as a Science, on top of which all software and hardware is built.
  5. Assembly Language: it helps to understand concurrent applications, and bugs occurring in them e.g. caused by instruction reorder.
  6. System programming: in the world of Cloud Computing and Virtual Machines, this is still useful subject that can gives you an insight into how software communicate with the hardware.
  7. Embedded devices: the Internet of Things is the future. Additionally it is fun (check Jon Gallant blog post who joined Internet of Thing team at Microsoft).
  8. Artificial Intelligence: every year devices are more intelligent (from your phone, through medical devices to Google Car). According to Bill Gates AI will explode in next 10 years. University is great place to learn AI fundamentals.
  9. Computer Networks: it is good to learn about networks, how data is flowing in the wires (packets), what is DNS, CDN, what challenges, and limitations do we have in fast and reliable data exchange. Recommended book: Computer Networks (by A. Tanenbaum).
  10. Computer Security: everyone would like to be a hacker. First, you need to know the basics, and be aware that this topic is changing every year (sha1 is being replaced by sha2, because it is not “secure enough” anymore). Because it is changing so fast, there is no universal book that is up to date. However Practical Internet and Unix Security book is still very valuable. To be up to date with security issues, I strongly recommend you to follow Troy Hunt’s blog (in my opinion: one of the best blogs in the Internet).

One can say: “Turing Machine? Would I need it for something?…Probably not.”. But again, I am talking about Computer Science, not programming. You can live without that knowledge, and do amazing things. Like mentioned taxi driver, who can take customers from place A to place B. But…what he will do, when GPS run out of battery or GPS will be wrong? What if there are two streets with the same name? Maybe GPS will indicate it, maybe not. Additionally, good taxi driver knows which way is faster, and where he will stuck in traffic on certain hours better than GPS.

Very often we do not appreciate the knowledge gained at the University, but it helps us in everyday job in the same way like swimming and running helps the boxer in his fight.

What is cool nowadays, you can learn Computer Science online for free.

At the end, it is totally up to you if you want to learn about Computer Science, or just learn how to program. I think it is good to know both. What do you think? Would you add/remove something to/from my top 10 list?