I'm not sure if this is exactly the best forum, but being a PHP coder exclusively, my examples are most relevant to this forum.
Theres talk here and there round and about DIC regarding how young is too young for learning a programming language. Personally, I started learning HTML/CSS to modify my Neopets profile at the age of 7-8 and started learning PHP to modify my personal website's bulletin board at around 12. Looking back over six years now, I've helped out on many a project and written many a great snippet/function/library but never finished a product? Why?
Problem solving and attention span.
Kids, even kids thrilled with computers and the prospect of being a great programmer have the same attention span. At 15 years old do you think I was ready to tackle the challenge of writing a bulletin board to the degree forums like Invision Power Board, which i use an example because earlier versions were written by one programmer? I was looking at an enormous pile of code, packed full of everything imaginable, when I didn't even have the attention span to finish my homework on time?
Secondly, the main problem isproblem solving. Teenagers are notorious for dragging out and overcomplicated EVERY SINGLE aspect of their ENTIRE lives. Why would programming me any different? As a younger programmer I often thought, well that sounds like a complicated idea so obviously the code will be very complicated and in effect I looked over the simplest of solutions.
I'm going to use my latest code versus my old code from the aforementioned bulletin board code I wrote several years ago. I was writing a library for mySQL usage usage and wanted to eliminate automatic return of mysql errors so I could ultimately process any errors after initial operation into two functions depending on the level of functionality left in the application, or rather the depth of the malfunction. So my thought was, "Those errors are going to occur regardless" and thusly finding out if an error had been printed was the means of error reporting I chose by literally checking to see if anything had been printed. I used the following code, I included the full function for the sake of making a later point.
CODE
function query($sql)
{
global $STD;
ob_start();
$result = mysql_query($sql);
$error = ob_get_contents();
ob_end_flush();
if(strlen($error) > 0)
{
return($result);
} else {
$STD->error('There was a problem with the database');
}
}
?>
Which as you can tell by looking at it, didn't actually even work. Not to mention, wheres the actual functioning that makes the product worth buying? If I cut corners there, what else will I leave out to save time and get a half-ass product on the market.? My inability to semi-complex problems with simple solutions led me to a complete dead-in and then I later shot myself in the foot by not having the attention span or dedication to fix the problem or find another solution and later stripped error handling from my database handling library completely. Which in case your wondering, would ruin the professionalism of a product I actually intended on selling.
I gave up on coding for nearly 3 years and have just started again writing a freeware blogging software after fiddling with every major blog software both free and commercial and feeling as though the user interface was both terrible aesthetically and from a usability aspect. In my database handling class which went down on file a few days I used the following function:
CODE
function query($sql)
{
global $_FUNC;
$this->qcount++;
if($this->prefix != 'LMB_')
{
$sql = str_replace('LMB_', $this->prefix, $sql);
}
$qtime_start = explode(' ',microtime());
$starttime = $qtime_start[1].substr($qtime_start[0],1);
$this->result = @mysql_query($sql)
if(!$this->result)
{
$_FUNC->error(mysql_error());
}
$qtime_start = explode(' ',microtime());
$endtime = $qtime_start[1].substr($qtime_start[0],1);
$this->qtime = $this->qtime + bcsub($endtime, $starttime, 6);
}
Which not only works, but works in a much more efficient manner, and has many more of the features a professional product generally requires because I not only had the mindset to think "Theres always a simpler way" but by also having the attention span to sit there and think the whole function out rather than just winging it for the sake of quicker progress and blind-eying later headaches.
Its been 6 years since I started coding my first major application and I've gotten furthur in a couple days with my first big solo project than I ever have on projects I started earlier in life, which I believe is due to to the same points mentioned in this post. For the sake of reinteration, problem solving and attention span.
So in conclusion, how young is too young? Discuss.
This post has been edited by Jody LeCompte: 15 Dec, 2007 - 03:21 AM