Posts tagged with: Python

Review – Introduction to Computer Science

The Introduction to Computer Science course on Udacity was a fun course to take. It has been a while since I completed the course so I don’t remember it in a lot of detail.  What I do remember is that none of the information was new.  I have been using Python for several years so I was familiar with the basics of Python programming.  Many of the videos I was able to skip through.  If you have previous Python programming experience then my recommendation is that you take a look at the videos and if they seem to easy then skip straight through to the Homework and Homework – Challenge sections of the class.

I have paid for this course yet because I am waiting for them to finish the nano-degrees.  At that time, I may pay for the class just to finish the nano-degree but we will see.


Review of Think Stats by Allen B. Downey published by O’Reilly Media

Think Stats Cover
So to be completely honest I picked up this book for review a couple of years ago. It has taken me a long time to getting it finished and get a review written up. Hopefully, you don’t interpret that as being a bad thing against the book. Actually the reason it took me so long because I really felt the need to sit down at a computer, go through the book and write out the examples. Generally I learn best by typing out the code rather than just downloading and running it. So that is why it took so long.

Now, as far as a review. This is an excellent book if you are a programmer that is looking to learn more about statistics. I have taken statistics classes, read statistics books, and tried online tutorials and there are some concepts that I have found to be difficult to understand. However, I have been programming for many years now and this was a nice easy transition into these statistical concepts using programming techniques. The author does a good job of highlighting some of the different techniques and providing helper classes for some of the functions.

Overall I enjoyed reading and completing the code in this book. I am not a statistics guru but I do feel a little more comfortable with the statistical concepts. And in the end, I have a reference I can go back to in the future.

You can find more information on this book over at O’Reilly’s catalog http://shop.oreilly.com/product/0636920020745.do


Daddy/Daughter Programming

My daughter, like many children, loves video games.  Moreover, she loves the idea of being able to create something on her own.  At the ripe old age of 7 she decided she is tired of not having access to something in her online games because her dad is to cheap to pay.  So she has very grandiose plans to create her own system that will be free to play.

I had previously played with Kodu Game Lab (http://fuse.microsoft.com/page/kodu) developed at Microsoft Fuse Labs.  She had a lot of fun with it but eventually got bored.  The biggest problem I had with it is that the tutorials went from simple to fairly complicated and she was having a hard time doing it on her own.  In addition, it covertly taught programming concepts and unless someone stopped to point them out you wouldn’t catch on.  Now maybe I didn’t give Kodu enough of a chance but after she lost interest I didn’t really continue playing with it.

Recently I received a recommendation for a different book to try.  Hello World! Computer Programming for Kids and Other Beginners  is a book designed for beginning programmers.  It starts off with the traditional Hello World! program and goes from there.  So far, my daughter is being a little impatient as she wants to start building her games but she finished the first chapter in one night.

The book uses Python 2.5 as the base for all of the code and the examples.  I think this is a great choice even though Python 2.5 is a little outdated.  My Python experience has been limited to data processing scripts so I am even excited to get to some of the GUI and Game examples in the book.  After the first chapter I can say that she definitely needs some help along the way but she can do most of it on her own.  I will make more posts as we get further into the book.


Choosing a Programming Language

OK before I get started on this I will give a little of my personal background.  I have been programming in one setting or another for nearly 10 years.  Technically I did a little programming before that but not enough that I really consider it worth discussing.  When I started I was working a night shift in a network operations center.  Our job at night was to make sure that nothing exploded on our watch which was fairly simple and required very little time.  To occupy myself, I started to look at how to program.  A coworker was working through PHP and I decided to do the same.

Over time I moved on to Perl, Java, C#, VB, Python, and other programming languages.  Often my choice of programming language was a requirement of the project I was working on.  However, over the years I have had the chance to work with many programming languages for a variety of different projects.  Although I have spent many hours in university computer labs and the computer science department, I do not hold any degrees in Computer Science.  I tried it and I just wasn’t all that interested.  Looking back on it now I probably should have just stuck it out but that is a discussion for a whole other post.

But the one thing I took away from my experience in the CS department is that many people treat their programming languages like other people treat their religion. You don’t dare point out that another programming language can do the same thing and maybe in a more efficient way and that some languages aren’t truly languages.

This post is meant to discuss this from my point of view and experience coming from outside the computer science realm.  It is full of my opinion and I encourage others to post their opinion as well.  The end goal is that we compile a list of questions to ask when a person is deciding on a programming language.

First let’s discuss a few myths that exist about programming languages.  As I stated earlier, these are from my personal experience but I am certain that others have run into the same myths:

  1. There is one language and it is the best.  It will fill every programming need I have ever had or ever will have. — This is simply not true.  Every programming language has its advantages and disadvantages.  Some languages are faster while others are more robust.  Some are built for web applications and other are meant for building desktop applications.  Deciding on a programming language requires some knowledge and expertise about each language in question.  If you do not have the expertise necessary for a specific language you can find plenty of expert opinions on the Internet.
  2. Scripting languages are not actually programming languages. — Again this is simply not true.  This is something I ran into a lot.  I started with PHP and Perl and whenever I would speak with someone in the CS department my choice of languages were second class citizens in the programming world if they were allowed to be citizens at all.

So now we have to ask ourselves a few questions to help in the decision process:

  1. What are the requirements of the project?
    • Every project has certain requirements.  For example, it has to be a web application or desktop application.  Maybe it will need to be both on the web and installed on the desktop.  It has to interface with a database or use XML as a storage medium.  It has to run on Windows, Mac, Linux or maybe all three.  These are all specifications that you need to be aware of when you are deciding on your choice of language.
    • Does it need to run on the web or on the desktop or both? — Some programming languages are designed to work on a web server while others are meant to be used to build desktop applications.  This is an important question even though more and more languages are being built to run on both mediums.  The Flex/AIR family is  a great example of this.  Technically using Flex/AIR does not allow you to build a web application and desktop application without a little bit of effort but the effort is minimal.  (This may have to be a future blog post.)
    • Does it need to work on Windows, Mac, Linux, or maybe a mobile operating system? — Depending on the audience of your application you may be able to build an application that runs on one operating system.  However, if you are building a general purpose application you will probably have to plan for supporting multiple operating systems. Programming languages like Java and AIR were designed to resolve this problem.  They utilize a runtime that is developed by the company and is installed on the computer that allows the developer to program for multiple operating systems.  If you choose to work with a programming language that does not have a runtime then you will need to compile the application for each operating system.
    • What data sources does it need to connect to? — This is really a question of ease of programming.  I know of very few programming languages that can’t connect to a database or parse XML.  But some programming languages are easier than others for this type of data source consumption.
    • Does it need to interface with or be utilized within another piece of software? — The one and only time I have used Lua was to write a component that interfaced with Adobe Lightroom.  At the time this was the only way to create components that interfaced with Lightroom. So sometimes there just won’t be much choice in the matter.
  2. What languages are you already familiar with and how much time do you have to learn a new language?
    • I have always found that learning a new language is fun and exciting.  However, it is not always appropriate for a given project.  For example, when I was working on my Masters project I had to process a considerable amount of data that was in CSV format.  The important part of what I had to do was to perform various statistic analyses to reach a conclusion.  A colleague of mine suggested I use R because it has many of the analysis algorithms built-in or available as modules.  However, I also had to do some pre-processing of the data.  The same colleague suggested that I look into using Python because one of its strengths is processing large amounts of data; in addition, it has a module that allows a script to directly interface with R.In this case, learning a new language caused a reduction in overall time to perform the analysis.  However, I spent a lot of time learning the programming languages.  If you are in the corporate world and have to give updates on the status of a project not all managers are happy to hear that you are on day 3 of learning a new programming language.  You may be better off working with something you are already familiar with.
  3. What is the deadline for the project?
    • If time is a problem then you may need to choose a programming language that you are already familiar with or are proficient with.  If you are proficient in multiple languages that meet all other requirements then you may have to get down to which requires the least amount of development time while providing the best programming and user experience.

These are not the only questions that you can ask when it comes to choosing a programming language but it is a start.  This is purely based in my experience in the development world.  What are your experiences?  What is your favorite programming language?