Thursday, April 24, 2014

Review of the book "Think like a Programmer" by V. Anton Spraul



Creativity and problem solving is a very general skill set and can be applied in a multitude of applications. In Think Like a Programmer, an Introduction to Creative Problem Solving, V. Anton Spraul, a programming instructor, looks at how to approach computer programming through a lens of creativity. Written for new programmers or those just wanting to take their coding to the next level, this book takes a comprehensive look at the thought process that goes into writing a successful program.
Spraul is quick to point out that the hardest part of learning a new programming language is not the syntax (the text that you actually type), but rather the algorithms that go into making a program that gives you the results you actually want. While the book is chalk full of examples of more specific problems that a computer programmer might be asked to solve, Spraul continuously comes back to five main principles that a programmer must constantly keep in mind: having a plan, restating the problem, dividing the problem into smaller pieces, looking for analogies, and not getting frustrated.
There are a large number of different steps that can be taken to solve a problem, some of which can be wrong ones. When solving a problem, if no plan is formulated “you are simply hoping for a lucky break.” The best way to develop a plan is to restate the problem. In this way, the parameters become clear, and precise, calculated steps can be taken to solve the problem. As Spraul points out, “planning allows you to set intermediate goals” which are smaller and easier to solve.
Sometimes the formulation of a plan is not so clear. In this scenario, it is best to look for analogies. Many problems have similarities. For example, Spraul works through the solution to the classic “Fox, Goose, and Corn” problem, where a farmer must transport these three items across a river. Later on in the book, Spraul introduces a new problem that he created, the “Quarrasi Lock.” In the introduction statement, Spraul uses obscure names and an odd situation to try and throw the reader off. However, the problem is an exact analogy of the “Fox, Goose, and Corn” problem and can be solved in the same way. Recognizing analogies can save a lot of time and frustration.  
One thing Spraul does well in getting his point across is the layout of the book. Even though the book is intended for those whole are familiar with a programming language, anyone can benefit from the first chapter. It is in the first chapter that Spraul first introduces his five reoccurring themes mentioned above. No actual code is used in the first chapter; rather, Spraul focuses on the basics of algorithms and looking at problems in a more creative way.
As the book progresses, more and more programming knowledge is needed to comprehend the material. While the chronological order of the book is done well, one criticism I have of Spraul’s book is that it does progress rather fast. I could see a beginning programmer struggling to keep up with the level of algorithms used in the later chapters, syntax aside. For a beginner, supplemental materials are most likely necessary to complement this book. That being said, one nice thing about the book as a whole is that it can easily be fact checked. All one needs to do to test Spraul’s code is to compile and run it on a computer. This can also make it easier to follow Spraul’s logic as he works through the different example problems. 
As a student minoring in Computer Science, this book is very relevant to me now in my academics. While I know the basics of programming quite well, I am always looking for ways to improve the code that I write. There are many different ways to write a single program, and some are superior to others. Spraul has given me a lot to think about while trying to develop these greater algorithms, not only for my classwork, but also for programs I write for fun.
There is a lot I can take away from this book for my future career as well. My hope is to someday own my own consulting, research, and development company specializing in alternative energy. I think we face two main challenges in energy today: source and distribution. Finding a better, cleaner source of energy is where my Chemical Engineering degree will come into play. However, it is just as important that we can put systems in place to efficiently distribute energy. Computers and software will be an integral part of these distribution systems, and so my knowledge of programming will be of great use to me in my career. Starting to think more creative about the code I write now will hopefully make me that much more advanced in the future.
While my review has focused mainly on the programming applications of Think Like a Programmer, an Introduction to Creative Problem Solving, I do not think it does the book justice to limit it to one topic. Just as creativity can be applied in many ways, a programming mindset can in turn be used to look creatively at a wide array of problems. Approaching a problem while “thinking like a programmer” means approaching the problem in a logical fashion. It means looking at the problem in smaller, more manageable pieces, or looking for known patterns. One could argue that every thought process we go through while solving any type of problem is like an algorithm. As such, problem solving and programming thought process are necessarily linked. The better put together and more creative these thought processes or “algorithms” are, the better the results.

Wednesday, April 23, 2014

Video Related to My Recent Blog Post About AI



Personal Reflection for 25/04/2014: Artificial Intelligence

For my personal reflection this week, I'd like to talk about some recent things that we've discussed in my philosophy class about intelligence. So first of all, it's pretty hard to define intelligence. Some people think that intelligence is defined by self-awareness, some by the ability to mimic other intelligent life in such a way that it is impossible to differentiate between the real and the artificial, and yet some more think that it is defined by the ability to compute or access vast stores of information. Many scientists are trying to develop artificial intelligences. Some people think that these AI's will never be able to act "human" and others think that giving these machines intelligence will eventually lead to a robot uprising. Many of the earlier attempts to create these artificial intelligences simply meant packing a computer with as much processing power as it could hold. A more creative and probably more feasible approach is to wire processors in computers like those in the human brain. In theory, if you could copy every neuron in a brain, turn it into a bit (1's or 0's), and wire it like the neurons in the brain were wired, it should function the same way that they human brain does. This leaves us with the question: Is artificial intelligence a possibility for the future?

Tuesday, April 22, 2014

Personal Reflection #6

I know I always blog about coding... but I am going to do it again.

For our last project in my computer science class, we are making a program that evaluates a given hand of playing cards and outputs the different combinations that would be worth something (i.e. pair, full house). Sounds simple, right? The challenge of this projects stems from something called inheritance, which means different aspects of the program reuse code of other parts. While computer scientists are interested in writing programs that work, simplicity and efficiency are also of interest. All of the different ways of evaluating the hand have some things in common. Our job is to be creative and write code that reuses itself as much as possible. I am still looking over and rewriting my code until I get it to be as efficient as possible.

Monday, April 21, 2014

Class Reflection #6

Not a whole lot to say for this week, besides that I am really excited to do another team's challenge next week. I think ours should be pretty good as well. We tried to use a variety of clues/riddles to set up our challenge. I am glad that we got class time to work on it, as I have a lot of homework and studying to do in preparation for finals.

Final Project Preparation

It was really nice to have a class period dedicated to planning our final project for the class. It's so much easier to all coordinate and work on things when we don't have to work around our other busy schedules. I'm very excited about the scavenger hunt we've designed. I think it will be a lot of fun because each clue is different so if one group member doesn't like one clue, they may like another. I don't think it will be too challenging, but some of the clues will definitely take some thinking. Next week's class should be fun and I can't wait to see what other groups came up with!

Class Reflection for 25/04/2014: Final Project Planning!

Well, we're getting down there. We've got two weeks of class and then finals week which means next week is our final project/scavenger hunt for this class! Our group got straight to work today and I think that our scavenger hunt is going to be pretty awesome! I came in with some ideas for places to go to during the hunt and my groupmates did some mixing up and fleshing out of these ideas. Together we created a scavenger that was better than anything we could have created separately. I can't wait to do someone else's scavenger hunt next week so until then, good luck and have a good week!