As I am sure most people who read this already know, HTML is the file format that Internet browsers use. While it is certainly possible to create a web site in php, perl, python, jsp, or a myriad of other server-side languages; these languages ultimately send an HTML file to the browser. HTML 5 is currently a draft standard, which means it is still being developed. In fact, it probably won't be an official standard until 2012 so my starting to use HTML 5 might seem strange. I had planned to stick with Flash/Flex which requires a proprietary plug-in to work but is very widespread. Apple, Google, Opera, and Mozilla are pushing for the new standard and have support for many of the features already. Notice that Microsoft is absent from this list. While I personally don't like Internet Explorer, it is very commonly used. Thankfully, a lot of the HTML 5 features that are not supported directly by Microsoft have had open source implementations so it is possible to use these features. When I discovered ExplorerCanvas (http://excanvas.sourceforge.net/) last year, I figured it was time to start playing with HTML 5, or at least the canvas portion of the upcoming standard.
I remember how excited I was going to Star Wars Episode 1. I had seen the other Star Wars movies many times and was thrilled that a new Star Wars movie was finally coming out. While Episode 1 was not as bad as many old-school Star Wars fans claim, it certainly did not meet my overly-high expectations. This is the way I feel about the canvas tag. For general purpose drawing, it is really good. From a game developers perspective, however, it is lacking. The biggest flaw is there does not appear to be double buffering support. While it is possible to create off-screen buffers of pixels which let you manipulate each pixel individually, these buffers are glorified arrays and don't have any advanced drawing support. In most animated applications you do not want people seeing the frame being drawn which is why double buffering is used. Still, there are a number of ways around this problem so all is not lost.
I have not played around with this idea, but one way to emulate a double buffer would be to simply have a hidden canvas that all the drawing is done to and then the contents of that canvas get copied over to the visible canvas. I have heard of tricks like this being used before, and it would be a simple solution if it can be implemented in a cross-browser compatible way. Dirty rectangle algorithms could also be used, especially since there is really good clipping support built into the canvas class. I suppose writing some low level per-pixel drawing methods and doing the drawing inside the ImageData objects would work, but JavaScript is really slow so I can't see this being a good solution unless your game already has to do a lot of per-pixel work. A raycaster come to my mind immediately. Sadly, I suspect that flicker will be a part of a lot of future HTML 5 games, but computers are very fast now so lets hope this is one thing I am proven wrong about.
Sunday, March 14, 2010
Sunday, March 7, 2010
Programming, the Coming of Language
(Continued from Programming, the Early Years)
The thought was that if the languages would be more human like so it would be easy for people to create software then there would be no need for programmers. The earliest programming languages were created to allow scientists and researchers the ability to write programs themselves which is why FORTRAN is considered to be the first high-level programming language. The idea here being that The programs in these higher level languages would be run through a tool called a compiler which either converted the program into assembly language (which would then have to be ran through an assembler) or straight into machine language.
While higher level languages made it easier to create programs, learning how to program was still a chore. The fact that the programs were ran in batches so there was a long delay between writing code and seeing the results was the biggest culprit. Computers, thankfully, continued to grow in power to the point that there were a lot of waisted computer cycles. To better utilize the hardware, time-sharing systems and terminals started appearing. This lead to the obvious idea of having programming languages that were interactive in nature. By interpreting the code instead of compiling the code it was possible to write programs in real time. The downside to interpreters were that they were significantly slower than compilers.
Another issue that was becoming bothersome was the fact that every machine had a different machine language. Sure, you could simply write programs in high level languages and compile it for the different computers that the program had to be ran on, but different compilers for the same language would compile the code differently so idiosyncrasies were common place. The term for moving code from one computer to another is porting. The fact that a term was created to describe this problem (which still persists today) should tell you that it was not a trivial problem. UCSD Pascal solved this problem by compiling code to a virtual p-machine language. The computer would then interpret this virtual p-code. Because p-code was essentially machine language, the computer could interpret this code much faster than an interpreted language could be ran. Still, it was slower than code compiled for a particular machine. When micro-computers started taking off, the speed difference became a big factor in commercial software sales.
While it seemed that compiled code won, computers continued to grow faster to the point where they were more than fast enough to accomplish most common tasks. At the same time, the internet started taking off. Sites wanted to be more dynamic but had to be not only cross-platform but cross-browser compatible. Both interpreters (JavaScript) and virtual machines (Java) were used to accomplish this. To make the virtual machine fast enough, a new technique called Just-In-Time compiling was developed. The idea here is that the virtual machine code is compiled into native machine language as it is ran so code will run much faster.
The concept of a virtual machine running on the browser seemed to me to be the best solution. Sadly, for a variety of reasons Java never became the browser language of choice but instead ended up largely on the server. Flash is currently the virtual machine of choice for browser programming, but JavaScript is probably the most common choice for web development. The only thing holding JavaScript back is the lack of some of the Rich Internet Application features, but HTML 5 is pretty much solving those issues. It will be a few years before HTML 5 becomes the standard, but with Google, Apple, and Mozilla pushing for the standard it is possible to take advantage of a lot of HTML 5s features right now.
So we have gone from writing code in machine language to compiling the code into machine language to running the code in an interpreter. What is really interesting is that changes in hardware is what drove programming evolution. Computers are now so fast and have so much memory that programmers no longer need to concern themselves with writing efficient code. What matters now is that the code that is written is finished quickly. Sure, many programmers want to write efficient code but they only have to write efficient code in the increasingly rare case where the program runs too slow. What is worse is the fact that programming has moved further away from machine language that there are many programmers who don't really understand what the computer is actually doing. That, however, is a subject for another day.
The thought was that if the languages would be more human like so it would be easy for people to create software then there would be no need for programmers. The earliest programming languages were created to allow scientists and researchers the ability to write programs themselves which is why FORTRAN is considered to be the first high-level programming language. The idea here being that The programs in these higher level languages would be run through a tool called a compiler which either converted the program into assembly language (which would then have to be ran through an assembler) or straight into machine language.
While higher level languages made it easier to create programs, learning how to program was still a chore. The fact that the programs were ran in batches so there was a long delay between writing code and seeing the results was the biggest culprit. Computers, thankfully, continued to grow in power to the point that there were a lot of waisted computer cycles. To better utilize the hardware, time-sharing systems and terminals started appearing. This lead to the obvious idea of having programming languages that were interactive in nature. By interpreting the code instead of compiling the code it was possible to write programs in real time. The downside to interpreters were that they were significantly slower than compilers.
Another issue that was becoming bothersome was the fact that every machine had a different machine language. Sure, you could simply write programs in high level languages and compile it for the different computers that the program had to be ran on, but different compilers for the same language would compile the code differently so idiosyncrasies were common place. The term for moving code from one computer to another is porting. The fact that a term was created to describe this problem (which still persists today) should tell you that it was not a trivial problem. UCSD Pascal solved this problem by compiling code to a virtual p-machine language. The computer would then interpret this virtual p-code. Because p-code was essentially machine language, the computer could interpret this code much faster than an interpreted language could be ran. Still, it was slower than code compiled for a particular machine. When micro-computers started taking off, the speed difference became a big factor in commercial software sales.
While it seemed that compiled code won, computers continued to grow faster to the point where they were more than fast enough to accomplish most common tasks. At the same time, the internet started taking off. Sites wanted to be more dynamic but had to be not only cross-platform but cross-browser compatible. Both interpreters (JavaScript) and virtual machines (Java) were used to accomplish this. To make the virtual machine fast enough, a new technique called Just-In-Time compiling was developed. The idea here is that the virtual machine code is compiled into native machine language as it is ran so code will run much faster.
The concept of a virtual machine running on the browser seemed to me to be the best solution. Sadly, for a variety of reasons Java never became the browser language of choice but instead ended up largely on the server. Flash is currently the virtual machine of choice for browser programming, but JavaScript is probably the most common choice for web development. The only thing holding JavaScript back is the lack of some of the Rich Internet Application features, but HTML 5 is pretty much solving those issues. It will be a few years before HTML 5 becomes the standard, but with Google, Apple, and Mozilla pushing for the standard it is possible to take advantage of a lot of HTML 5s features right now.
So we have gone from writing code in machine language to compiling the code into machine language to running the code in an interpreter. What is really interesting is that changes in hardware is what drove programming evolution. Computers are now so fast and have so much memory that programmers no longer need to concern themselves with writing efficient code. What matters now is that the code that is written is finished quickly. Sure, many programmers want to write efficient code but they only have to write efficient code in the increasingly rare case where the program runs too slow. What is worse is the fact that programming has moved further away from machine language that there are many programmers who don't really understand what the computer is actually doing. That, however, is a subject for another day.
Sunday, February 28, 2010
Making Space Station Defence
The Space Station Defence game that has just been posted on Blazing Games is not the game that I planned to release in March. I was actually planning on releasing another episode of Dozen Days of Words, possibly both of the final episodes. After just starting work on episode 11, I came up with a concept for an arcade game. I figured I would take a few hours and build a quick prototype of this game. While assembling the prototype, I realized that the game would simply not be fun. Before dropping my prototype, I went for a walk as in the Okanagan Valley we are having an unusually warm winter with all our snow melted already. While some people may blame our warm weather on global warming, I know that the real reason is because I bought a bunch of exercise games for my Wii. While I have lost a lot of weight, I still have a way to go. My own long history of dieting has taught me that the only way I can lose weight and keep it off is by exercising. Now that I have audiobooks and podcasts to listen to while walking, I have drastically increased the amount of exercise I do. While this might not seem to have anything to do with game development, walking helps my mind sort through it's myriad of thoughts. A simple change turned a dead prototype into a released game.
The original concept was a shield game. The player would have a shield around their space station. This shield would slowly recover but could be rotated. As the player took damage, they would simply rotate the shield. In theory this sounds interesting. The problem is that actual game-play isn't much fun.
During my walk, I came up with two different solutions. The first would be to have a non-destructible shield but one that only protected a small portion of the space station. The other method was to slow down shield recharging and give the player missiles to shoot back. As the later idea sounded more fun I went with that. The game lasted too long with recharging shields, so in fine tuning I removed that feature. As I already had three different shield levels, I also opted to have three different difficulty levels. I think another pass or two would have been nice, but I simply have not had the time.
Does this mean that the eleventh episode of Dozen Days of Words is going to be released in April? To be honest, I don't know. I do want to start experimenting with HTML5 so I hope to have a game that takes advantage of the canvas element. This feature is already supported by most browsers, and there is a JavaScript library that adds canvas support to Internet Explorer. Microsoft seems to be exceedingly slow at adding HTML5 features to their browser. I suspect they are trying to shove Silverlight down everyone's throat. HTML5 would make Silverlight mostly irrelevant. To be honest, I am starting on my HTML5 migration much sooner than I ever anticipated largely due to Mozilla, Google and Apple's push for HTML5 features.
The original concept was a shield game. The player would have a shield around their space station. This shield would slowly recover but could be rotated. As the player took damage, they would simply rotate the shield. In theory this sounds interesting. The problem is that actual game-play isn't much fun.
During my walk, I came up with two different solutions. The first would be to have a non-destructible shield but one that only protected a small portion of the space station. The other method was to slow down shield recharging and give the player missiles to shoot back. As the later idea sounded more fun I went with that. The game lasted too long with recharging shields, so in fine tuning I removed that feature. As I already had three different shield levels, I also opted to have three different difficulty levels. I think another pass or two would have been nice, but I simply have not had the time.
Does this mean that the eleventh episode of Dozen Days of Words is going to be released in April? To be honest, I don't know. I do want to start experimenting with HTML5 so I hope to have a game that takes advantage of the canvas element. This feature is already supported by most browsers, and there is a JavaScript library that adds canvas support to Internet Explorer. Microsoft seems to be exceedingly slow at adding HTML5 features to their browser. I suspect they are trying to shove Silverlight down everyone's throat. HTML5 would make Silverlight mostly irrelevant. To be honest, I am starting on my HTML5 migration much sooner than I ever anticipated largely due to Mozilla, Google and Apple's push for HTML5 features.
Sunday, February 21, 2010
Programming, the Early Years
Efficient code is not as important as it use to be. What is worse is that the situation is getting worse not better. While the vital parts of a program are likely to be written efficiently, a growing percentage of the code is going to be quickly written and probably inefficient. Making this situation even worse is that the code being written is often going to be interpreted or ran on a virtual machine. To understand why this is the case and why things will get worse before they get better one just has to look at how programming has evolved over the years.
The earliest computers were programmed in machine language. In the very early days this was done by re-wiring machine components though this quickly changed to flipping switches and then into punched cards or paper tape. Computers were huge expensive machines so every second of machine time was precious. Programs were often ran in batches meaning that you would submit your cards or tape and wait (sometime days or weeks) to get your results. When you got your results, if there were problems then you would have to re-submit. As computer time was golden, sloppy code was frowned upon. Likewise, because there was a fair amount of time between tests, programmers had plenty of time to make sure their code was well written.
Computer programs were much simpler back then due to the fact that the machines had almost no memory and were slow. Memory in early computers were measured in Kilo-words with the number of bits in a word being machine specific though 18 seemed to be a common number. A gigabyte is 1,048,576 kilobytes or 1,073,741,824 bytes so to think back in terms of kilo-words is scary. Speed was in kilohertz. Yes, a gigahertz is 1,000,000 kilohertz. Still, programming in Machine Language would have been painful work. What most programmers did was write their programs in an English-like format where machine instructions were given simple names such as LOAD, STORE, JUMP. This code was then converted into the numbers that had to be put into the computer.
Hand coding machine language was a big waist of programmer time, but the cost of programmers was a lot less than the machines that were being programmed. I am sure that many early programmers came up with the idea of a tool that would take a human readable form of machine language and converting it into the actual machine language instructions. It wasn 't until the 1950s that such programs started being used. This made programming much more efficient. When a program was written in assembly language, it had to be run through a program called an assembler which converted a human-readable form of machine language into a machine-readable form of machine language. While this added an extra step to the process, the assembly step only had to be done once and the resulting output could then be used any number of times. The assembler resulted in boosted productivity for the programmers.
The cost of computers began to decline while the capabilities continued to grow. This resulted in computers becoming more common. Soon big business and research facilities all wanted to have their own computers. The problem with computers then became the requirement for programmers to write the programs in assembly language (which at this point was starting to be referred to as machine language even though technically speaking there is a difference). If only there was a way for "normal" people to write programs.
This article will continue in a couple of weeks as next week I will be writing about the March release on Blazing Games which is a game that came from a quick protoype I created. This game is an example of how plans for a game can drastically change.
The earliest computers were programmed in machine language. In the very early days this was done by re-wiring machine components though this quickly changed to flipping switches and then into punched cards or paper tape. Computers were huge expensive machines so every second of machine time was precious. Programs were often ran in batches meaning that you would submit your cards or tape and wait (sometime days or weeks) to get your results. When you got your results, if there were problems then you would have to re-submit. As computer time was golden, sloppy code was frowned upon. Likewise, because there was a fair amount of time between tests, programmers had plenty of time to make sure their code was well written.
Computer programs were much simpler back then due to the fact that the machines had almost no memory and were slow. Memory in early computers were measured in Kilo-words with the number of bits in a word being machine specific though 18 seemed to be a common number. A gigabyte is 1,048,576 kilobytes or 1,073,741,824 bytes so to think back in terms of kilo-words is scary. Speed was in kilohertz. Yes, a gigahertz is 1,000,000 kilohertz. Still, programming in Machine Language would have been painful work. What most programmers did was write their programs in an English-like format where machine instructions were given simple names such as LOAD, STORE, JUMP. This code was then converted into the numbers that had to be put into the computer.
Hand coding machine language was a big waist of programmer time, but the cost of programmers was a lot less than the machines that were being programmed. I am sure that many early programmers came up with the idea of a tool that would take a human readable form of machine language and converting it into the actual machine language instructions. It wasn 't until the 1950s that such programs started being used. This made programming much more efficient. When a program was written in assembly language, it had to be run through a program called an assembler which converted a human-readable form of machine language into a machine-readable form of machine language. While this added an extra step to the process, the assembly step only had to be done once and the resulting output could then be used any number of times. The assembler resulted in boosted productivity for the programmers.
The cost of computers began to decline while the capabilities continued to grow. This resulted in computers becoming more common. Soon big business and research facilities all wanted to have their own computers. The problem with computers then became the requirement for programmers to write the programs in assembly language (which at this point was starting to be referred to as machine language even though technically speaking there is a difference). If only there was a way for "normal" people to write programs.
This article will continue in a couple of weeks as next week I will be writing about the March release on Blazing Games which is a game that came from a quick protoype I created. This game is an example of how plans for a game can drastically change.
Sunday, February 14, 2010
Is Trivia Trivial?
The enhanced version of history bomb has been posted on Blazing Games. My rant on efficient programming will continue next week, this week I am going to talk a bit about trivia as the game just releases is a type of trivia game.
On the surface, trivia games seem to be something that is easy to create. As someone who has written a fair number of them, some for third parties, my knowledge of the subject is fairly high. Programming a trivia game is in fact very simple. The game logic for a trivia game is in fact trivial to write. The server-side database/score handling and the user interface were what took up the vast majority of time. This makes sense when you think about it as ultimately trivia is just a variation of the simplest of all computer games. That game being the pick-a-number game. The difference is that the numbers are answers and random numbers are used to scramble the potential answers. There is one thing that makes the trivia games on my site different from the third-party games that I have written. For the third-party games I wrote, I didn't have to come up with questions.
Coming up with the questions for a trivia game may sound simple but it is a fairly time-consuming process. First you need to come up with a subject that you think that the people playing the game will be interested in that you also have some knowledge of. Next you have to come up with a question. This would be similar to writing a question for a test, except the question has to fit a particular format. In Trivia Bomb it was a simple multiple-choice question. History Bomb, on the other hand, is a sorted list. I will say that multiple-choice is much easier to come up with questions as one only needs to make sure his or her answer is correct then come up with wrong answers. Sure, it is time consuming, but it is very flexible. Lists requires finding something that has a distinct order to it. Then verifying that order. In some cases, this meant not only researching the subject, but then having to do additional research on each item on the list.
The bright side, though, is that the extended version of History Bomb has no time limit for its development. When the game-in-a-day pressure is removed, researching questions was much more enjoyable though probably even more time consuming. What trivia-question-writers probably don't want you to know is that just diving into a subject to verify facts often leads to much further exploration of a topic. I suppose there is the obvious "looking for other potential questions" excuse.
While coming up with questions is not hard work, it is time consuming work. Still, when creating a trivia game, it is probably best to remember that the questions are going to have to be created (unless you do the low-life thing and steal questions from other people). When I play a trivia game in the future, I am going to remember that each question probably took far longer to create then I will ever spend answering it.
On the surface, trivia games seem to be something that is easy to create. As someone who has written a fair number of them, some for third parties, my knowledge of the subject is fairly high. Programming a trivia game is in fact very simple. The game logic for a trivia game is in fact trivial to write. The server-side database/score handling and the user interface were what took up the vast majority of time. This makes sense when you think about it as ultimately trivia is just a variation of the simplest of all computer games. That game being the pick-a-number game. The difference is that the numbers are answers and random numbers are used to scramble the potential answers. There is one thing that makes the trivia games on my site different from the third-party games that I have written. For the third-party games I wrote, I didn't have to come up with questions.
Coming up with the questions for a trivia game may sound simple but it is a fairly time-consuming process. First you need to come up with a subject that you think that the people playing the game will be interested in that you also have some knowledge of. Next you have to come up with a question. This would be similar to writing a question for a test, except the question has to fit a particular format. In Trivia Bomb it was a simple multiple-choice question. History Bomb, on the other hand, is a sorted list. I will say that multiple-choice is much easier to come up with questions as one only needs to make sure his or her answer is correct then come up with wrong answers. Sure, it is time consuming, but it is very flexible. Lists requires finding something that has a distinct order to it. Then verifying that order. In some cases, this meant not only researching the subject, but then having to do additional research on each item on the list.
The bright side, though, is that the extended version of History Bomb has no time limit for its development. When the game-in-a-day pressure is removed, researching questions was much more enjoyable though probably even more time consuming. What trivia-question-writers probably don't want you to know is that just diving into a subject to verify facts often leads to much further exploration of a topic. I suppose there is the obvious "looking for other potential questions" excuse.
While coming up with questions is not hard work, it is time consuming work. Still, when creating a trivia game, it is probably best to remember that the questions are going to have to be created (unless you do the low-life thing and steal questions from other people). When I play a trivia game in the future, I am going to remember that each question probably took far longer to create then I will ever spend answering it.
Friday, February 5, 2010
Is efficient code obsolete?
I was looking over some of my older code noting how inefficient some of my code was. There were a number of reasons for this. The biggest is my very short development time. In my case, the short schedules are the result of my desire to release a lot of material. I have tried to slow down my release schedule to allow for better content, but other things always seem to creep in to steal my spare time. Unrealistic schedules are far too common in the tech industry and is made worse by the fact that the vast majority of people in charge have no clue how software works or how much work is involved in its creation. Making this problem worse are the programmers themselves who often vastly under-estimate the work required to complete a project. Short development time leads to focusing on just getting the code to work not on getting the code to work as efficiently as possible.
Related to the short development time is the fact that often I will cut and paste similar code from earlier projects that I have worked on. I restrict myself to code that I have written, though there are many programmers who will cut and paste from other peoples' code. By tweaking existing code, you can implement something very quickly. The problem is that often the code you are borrowing may have stuff in it that you are not using within the new project but that was necessary in the original project. The fact that you are cutting and pasting code probably means you are in a hurry which means that the redundant and unnecessary code that is copied will remain resulting in both code bloat and inefficient code. Changing project specifications in the middle of a project, which is sadly far to common, also results in unnecessary code bloat for similar reasons.
A third common reason for my inefficient code is that the code in question is not going to be executed very often. This is related to the first reason due to the obvious fact that functions that are infrequently used are going to be written fairly quickly. Another reason that infrequently executed code tends to be inefficient is that there is very little incentive to optimize the code as the inefficiency of rarely executed code is not going to noticeably impact the overall speed of the program. Optimising a program takes time so that effort should be placed on the parts of a program that are executed frequently or that are most critical to the speed of a program.
Not all of my reasons are related to development time. I often will write code that I can easily understand instead of using more efficient code that was harder to grok. For example:
c = Math.min(a,b);
This code obviously sets c to be the lower of the values a or b. It is, however, making a function call which has overhead and if the function call uses floating point while the variables used are integer you have a number of type conversions as well. Many languages have generics and will inline small code blocks right into the code if compiler optimisation is enabled which can mitigate the speed difference. In the best case, the compiler would essentially convert the function call into the following statement:
c = (a < b) ? a : b;
If you were to use the second version of the code instead of the first, you would be guaranteed no function call or type conversion overhead. I find first version much easier to understand, but depending on your compiler it could be substantially slower than the second version. The difference is in the millionth of a second, though.
None of this even gets into the facts that the code being written is often going to be interpreted or ran on a virtual machine. Likewise, the speed of computers is not looked at. Worst of all, the fact that programmers are no longer familiar with low level programming so write code that doesn't compile efficiently is not addressed. Those are topics for another column or three. Still, the conclusion that I have come up with is the simple one that computer time is far cheaper than programmer time which is cheaper than time-to-market time so it is safe to say that while writing efficient code is still something to be aimed for, getting code out quickly is sadly the bigger priority.
Related to the short development time is the fact that often I will cut and paste similar code from earlier projects that I have worked on. I restrict myself to code that I have written, though there are many programmers who will cut and paste from other peoples' code. By tweaking existing code, you can implement something very quickly. The problem is that often the code you are borrowing may have stuff in it that you are not using within the new project but that was necessary in the original project. The fact that you are cutting and pasting code probably means you are in a hurry which means that the redundant and unnecessary code that is copied will remain resulting in both code bloat and inefficient code. Changing project specifications in the middle of a project, which is sadly far to common, also results in unnecessary code bloat for similar reasons.
A third common reason for my inefficient code is that the code in question is not going to be executed very often. This is related to the first reason due to the obvious fact that functions that are infrequently used are going to be written fairly quickly. Another reason that infrequently executed code tends to be inefficient is that there is very little incentive to optimize the code as the inefficiency of rarely executed code is not going to noticeably impact the overall speed of the program. Optimising a program takes time so that effort should be placed on the parts of a program that are executed frequently or that are most critical to the speed of a program.
Not all of my reasons are related to development time. I often will write code that I can easily understand instead of using more efficient code that was harder to grok. For example:
c = Math.min(a,b);
This code obviously sets c to be the lower of the values a or b. It is, however, making a function call which has overhead and if the function call uses floating point while the variables used are integer you have a number of type conversions as well. Many languages have generics and will inline small code blocks right into the code if compiler optimisation is enabled which can mitigate the speed difference. In the best case, the compiler would essentially convert the function call into the following statement:
c = (a < b) ? a : b;
If you were to use the second version of the code instead of the first, you would be guaranteed no function call or type conversion overhead. I find first version much easier to understand, but depending on your compiler it could be substantially slower than the second version. The difference is in the millionth of a second, though.
None of this even gets into the facts that the code being written is often going to be interpreted or ran on a virtual machine. Likewise, the speed of computers is not looked at. Worst of all, the fact that programmers are no longer familiar with low level programming so write code that doesn't compile efficiently is not addressed. Those are topics for another column or three. Still, the conclusion that I have come up with is the simple one that computer time is far cheaper than programmer time which is cheaper than time-to-market time so it is safe to say that while writing efficient code is still something to be aimed for, getting code out quickly is sadly the bigger priority.
Friday, January 29, 2010
History Bombs a couple days early
It has been a while. My plans were to continue posting every week or so, but things are busy here so I kind of kept forgetting. Things may continue to stay busy based on how well a proposal I am working on goes but I will try my best to post at least a short article every other week if not every week. To make up for my delay, here is a sneak preview of February's game. http://blazinggames.com/table/dozenDays/words/historyBomb.php.
Subscribe to:
Posts (Atom)
