Sunday, August 30, 2009

How to get a programming job

The FizzBuzz program is used by some employers to test the programming abilities of the workers that they are attempting to hire. FizzBuzz is a simple program that loops through numbers 1-100 and prints out "Fizz" if the number is a multiple of 3, "Buzz" if the number is a multiple of 5 and "FizzBuzz" if the number is a multiple of both 3 and 5.

Ready, set, go!


The FizzBuzz program took me a total of 5 minutes to complete including the time it took to write comments. Below is the code that I implemented:
  1. /**
  2. *FizzBuzz Program
  3. *@author Scott Wong
  4. *@date 8/30/3009
  5. *@bugs none
  6. */
  7. public class FizzBuzz{
  8. public static void main(String args[]){
  9. for(int i = 1; i <= 100; i ++){
  10. System.out.println(check(i));
  11. }
  12. }
  13. /**
  14. * Determines if the number is a "Fizz", "Buzz", "FizzBuzz" or just a number
  15. * @param the number to check
  16. * @return what the number is
  17. */
  18. public static string check(int x){
  19. if(i % 15 == 0){ //if the number is a multiple of both 5 and 3
  20. return "FizzBuzz";
  21. }else if(i % 3 == 0){ //if the number is a multiple of 3
  22. return "Fizz";
  23. }else if(i % 5 == 0){ //if the number is a multiple of 5
  24. return "Buzz";
  25. }else{ //else print out the current number
  26. return Integer.toString(i);
  27. }
  28. }
  29. }

Errors

Unfortunately I ran into errors with Eclipse during this project. It started with Eclipse taking close to 2 minutes to open and eventually to its current state where it will not even boot up. Because I had no time to spare while doing this project I hastily tried uninstalling and reinstalling Eclipse with no change in its behavior so I turned to the next best thing and used a program called Notepad ++ to code my FizzBuzz. While this is a lot harder than using a compiler as it does not correct your coding should there be an error, it is manageable with such a small program as this one. I will continue to work on solving this problem and hopefully will have Eclipse up and running again by the end of tonight.

Lessons learned

Through this experience I have learned that there is no substitute for a good compiler as it makes coding and testing a java file easier since the compiler will tell you when you have an error in your code and you can also test the file in the compiler instead of using the command line.


Surfing with Dooble

Dooble is an open source web browser available through sourceforge.net (http://sourceforge.net/projects/dooble/) or at Dooble's website (http://dooble.sourceforge.net/). According to the description of the program Dooble focuses on user privacy and security and comes with a instant messaging program as well as an email program. However with this strong focus on security, is this web browser still able to meet the 3 prime directives?

System Functionality?

The first directive asks if the program was about to accomplish a useful task. After testing Dooble on a variety of websites containing different I am somewhat disappointed with its performance. Dooble has no problem surfing regular websites such as google or gamespot, however the problems start when Dooble attempts to navigate to secured sites. As an example I attempted to connect to paypal's web site, but Dooble will not display the page stating it has run into a network error. I then tried to connect to my bank's website but got the same error. So it seems that Dooble is unable to connect to sites that have security certificates, which I find ironic since this browser stresses security. I also ran into problems while attempting to play flash files. It seems that Dooble does not support Adobe Flash which means that watching online content such as TV episodes is not possible with this browser. Overall I enjoyed this browser while just surfing, but when it comes down to it, I would not be able to use this browser as it does not support secured websites as well as Adobe's Flash Player.

Ease of setup?

The second directive asks if a user can successfully install and use the system. Dooble successfully meets this directive from download to the actual running of the browser. Downloading from sourceforge was easy, the installation was simple and only asked where to install the program and the running of the program was simple, fast and easy. The only issue I would have with the installation is that the default installation location is not defaulted like most programs to C:\Program Files but instead is defaulted to the user's account, so in my case C:\Users\Scott Wong. This is a minor inconvenience if I wanted to access or edit the files as I am used to looking in C:\Program Files for the installed files.

Want to help develop Dooble?

The third directive asks if an external developer can successfully understand and enhance the system. This area is unfortunately another area in which Dooble runs into problems. While looking through the Dooble source code I noted two things. First of all the coding format itself is very neat and organized with appropriate indenting and spacing which made the code easy to read and follow. However the second thing I noticed was that the source code had almost no comments in most source code files or had sporadic commenting in other source code files. This is disappointing since my ICS teachers have always stressed the use of comments to allow others to understand my code. This also made the code hard to follow as I was unsure of what most of the code was trying to accomplish. Perhaps someone with a history of software development would be able to understand the code without comments, but seeing as I lack that experience I feel that this system does not meet the third directive.

To sum things up Dooble is a great way to surf the web if you have no intention of accessing secured sites or watching flash web content. The ease of downloading, installing and running Dooble enhances the experience and is a definite plus. However I believe that it will be a long and hard process if you intend to edit the source code as the lack of comments might leave you wondering what function you are really editing.