Tuesday, August 30, 2011

FizzBuzz

The FizzBuzz program involves printing out the numbers 1-100, each number on its own line, and with the following conditions:
  • If the number is divisible by 3, print "Fizz" (and nothing else)
  • If the number is divisible by 5, print "Buzz" (and nothing else)
  • If the number is divisible by both 3 and 5, print "FizzBuzz" (and nothing else)
  • Otherwise, print the number
In implementing the FizzBuzz program in Java, I used the Eclipse IDE my tool of choice. It took me about a minute-and-a-half from the time I opened up Eclipse, and here is the outcome:



I did not run into any problems, with Java or Eclipse. However, I did realize the approach that I took in solving this problem. Although I knew the gist of how to write this program beforehand, instead of planning out the code, I just dove right in and started whacking away at my keyboard. Perhaps this was due to the pressure of "how fast could I do this", but I seem to recall following this same procedure before in other programs that I have made. Whether this approach is problematic or a technique, I am not so sure, but hopefully it will not be the cause of difficulties later. When you don't know where to start, sometimes it is good to just-- well-- start, and fix things up later as you gain more perspective of the program. However, the problem may lie in not getting to this last part, or changing the format or mindset mid-way through coding. These may definitely cause grave issues indeed...

I appreciate very much how Eclipse has autocompletion and autoformat features; they make coding so much quicker with a lot less room for error. Writing this out by hand or even with simple text editors like Notepad would take at least 2-3 times longer, and if I had forgotten what the exact syntax for some functions was, I would have been totally lost-- either having to try and remember what it was or looking it up in a reference. Luckily Eclipse does this all automatically and has references built into itself, thus speeding up the process significantly. I use a Vi keybinding plugin in Eclipse, thus speeding up the process even more, and the syntax highlighting is also very helpful in that the code is much more easily readible, again adding to the efficiency of the coding process.

From this assignment, I learned that Software Engineering involves using tools to your advantage. There are many different ways to do things, and each way has its faults, but some ways are far more superior to others. Using better tools can mean completing a project correctly and in less time, rather than taking longer in addition to writing bad code. I am eager to learn what this class has to offer in terms of giving me many more tools-- and better ones too-- in order to allow me to put more effort into being creative. In my experiences to come, I look forward to finding the best tools that are available, to become a more efficient and versatile programmer.

Sunday, August 28, 2011

Testing jg3d

In a quest to understand and gain respect for the Three Prime Directives for Open Source Software Engineering, I have chosen to download the project "jg3d" from the website http://sourceforge.net/projects/jg3d/files/jg3d.jar/download and evaluate its contents. Upon downloading this, I come to find that it is just the jar file itself, and does not contain any documentation. Thus I refer to the information on the sourceforge website that says that jg3d is "... an implementation of an interactive 3d graph rendering engine and editor..."

In terms of the first Prime Directive-- "successfully accomplishing a useful task"-- I can only assume that it works, and cannot be exactly sure for myself. The user interface is very simple with just a sample of interconnected nodes and edges which the user can grab and move one of the nodes, having the rest of the nodes follow with a moderate amount of elasticity:



While I am not able to make much sense from this and am not sure how to apply it to some actual graphic-creating application, but jg3d itself seems to be extremely responsive and well created. Unfortunately there are no examples of which I can actually render and test out, so I can do little more than just play around with the little balls. I suppose that this means that this product is useful in providing a little entertainment and amusement, but as far as accomplishing what it is actually meant to do, that cannot be determined without another piece of software and an actual manual of how to use the two together.

As for the second Prime Directive (the ability for an external user to use this system successfully), I can say that I was able to install the system successfully, since it required no installation at all; just downloading the jar file and executing it. When it came to using the application, however, I was not sure at all whether I was using it correctly or not. There was no sort of documentation at all, so no help could have been obtained without utilizing external sources. Therefore, I must say that jg3d fails to meet the expectations of the second Prime Directive.

Again, since there was no documentation at all, it would be extremely difficult for anyone without knowledge of the internal system to develop and enhance jg3d. There even lacks the Java source code for the program, making it not possible to even figure out how it works by analyzing the Java code. I felt that there was certainly no way that I could possibly alter the program to improve it or implement it a different way. It seems to be that jg3d, or at least this version of it was released as a stable version, with no need to fix any major bugs. However, it being an open source project, it should contain or at least provide a location to a place where the source code can be found so that it can be downloaded for modification. Since jg3d does not provide this, it fails to meet the third Prime Directive of Open Source Software Engineering.

In assessing the Open Source project "jg3d", I have found that jg3d does not meet all three of the Prime Directives of Open Source Software Engineering. In fact, it may not even meet one of the requirements because the task of the program is not clear. An end user cannot figure out much about how to use this program or even what it is for, and it does not provide any documentation either that could help in figuring out these things. It is not simple to release an Open Source project, but without these components, it would be difficult to make use of them and thus be rendered as useless to most users.