Amazing what a kid can learn
Ok, I thought this would be an easy post, but apparently not. WordPress seems to choke wholehartedly on PHP code posted inside the TinyMCE editor. That is kinda rank. But I guess you get what you pay for, huh?
I posted about this entry at the PHP Developer's Network Forums. But I thought it was good enough to recall here.
So my 10 year old daughter asked me to teach her how to write programs 'like you do at work daddy'. So I brought her into the room, opened up and editor, had a brief discussion on servers and server-side language scripts, then explained what PHP is and how it works on the server, then had her write her first program.
So my 10 year old daughter asked me to teach her how to write programs 'like you do at work daddy'. So I brought her into the room, opened up and editor, had a brief discussion on servers and server-side language scripts, then explained what PHP is and how it works on the server, then had her write her first program.
< ?php echo 'hello world this is sarah'; ?>
This evolved into
< ?php $text = 'hello world this is sarah'; echo $text; ?>
At about this point my nine year old came and asked to participate along with us. So we got to throwing some stuff out and this is what we ended up with after about 20 minutes:
< ?php $text = 'hello world this is sarah'; $num = 10; $joiner = ' and I am '; if ($num == 10) { echo $text . $joiner . $num; } elseif ($num == 11) { echo 'I am 11'; } else { echo 'I am totally not 10'; } $counter = 0; $limit = 100; $inc = 10; while ($counter < $limit) { if (!($counter % 10)) { echo '10 is a modulator of ' . $counter . '!'; } else { echo 'I am only ' . $counter . '!'; } $counter += $inc; } $now = time(); echo date('l F jS, Y', $now); ?>
My daughters, in about 20 minutes, now understand how to declare and assign a variable, how to tell PHP what a string is and what an integer is, how to write a conditional (if/elseif/else), how to write a while loop, how to increment a counter, how to use a function (and what a function is) and how to read the PHP manual. Frickin amazing.
Me: How does PHP know when it is the end of the line?
They: The semicolon.
Me: What do the quotation marks on a variable value mean?
They: That the value is a string.
Me: If we loop do a while loop where a var is less than 100, what is the maximum value we'll see when echoing the increment value?
They: 99.
Me: And if we change the increment value to 10, what is the largest value we'll see?
They: 90.
Unbelievable. Even a 9 and 10 year old can get this pretty quickly.
/ apologizes for the blog like post, but I just wanted to encourage those folks that think this is too hard to pick up on. Start slow and it can be learned. Just ask my kids.
EDIT | I should note that they are by no means pros at this. But they have a strong understanding of the concepts, as evidenced by their ability to tell me what would appear on the screen as they read the code line by line.
Posts by Day
Subscribe
Subscribe via email
Meta
Categories
- American Idol (47)
- Apache Server (3)
- Bible Studies (4)
- Church (5)
- Cool Finds (26)
- CSS (6)
- Did you know? (2)
- Diet (46)
- Football (11)
- For the ladies (5)
- For the men (13)
- Funnies (93)
- Geek Stuff (131)
- General (195)
- Getting Out (15)
- Google (3)
- I have decided (1)
- Idiotic (1)
- Insanity (72)
- Javascript (1)
- John Joseph Huber (1)
- Kid Sayings (4)
- LAMP (2)
- Linux (12)
- Louisiana 2007 (8)
- Mark Up (3)
- Microsoft (8)
- My Business (7)
- My Poetry (1)
- My Thoughts (25)
- MySQL (6)
- Observations (19)
- On Business (3)
- On Children (44)
- On Christianity (12)
- On Education (1)
- On Faith (31)
- On Family (50)
- On Fatherhood (6)
- On Friendship (3)
- On Government (10)
- On Health (71)
- On Homeschooling (26)
- On Manhood (20)
- On Marriage (59)
- On Money (1)
- On Parenting (69)
- On Patriotism (15)
- On Politics (29)
- Open Source (4)
- Personal Messages (338)
- Photos (3)
- PHP (54)
- PHP Design Patterns (6)
- Prayer Requests (5)
- Programming (19)
- Quotes (1)
- Rants (192)
- Social Networking (3)
- This Blog (29)
- Understanding Men (2)
- Vacations (8)
- Videos (7)
- Web Browsers (2)
- Web Development (77)
- Web Hosting (1)
- Web Services (3)
- Web Sites (1)
- Web Technologies (8)
- Weight Loss (12)
- What was I thinking? (1)
- Wordpress (1)
Archives
- March 2012 (1)
- February 2012 (2)
- December 2011 (2)
- November 2011 (3)
- October 2011 (2)
- May 2011 (2)
- January 2011 (1)
- October 2010 (1)
- June 2010 (2)
- May 2010 (39)
- April 2010 (65)
- March 2010 (22)
- December 2009 (2)
- November 2009 (5)
- October 2009 (18)
- September 2009 (8)
- August 2009 (1)
- July 2009 (1)
- May 2009 (6)
- April 2009 (12)
- March 2009 (32)
- February 2009 (30)
- January 2009 (33)
- December 2008 (2)
- November 2008 (17)
- October 2008 (22)
- September 2008 (17)
- August 2008 (19)
- July 2008 (33)
- June 2008 (30)
- May 2008 (35)
- April 2008 (32)
- March 2008 (33)
- February 2008 (30)
- January 2008 (31)
- December 2007 (32)
- November 2007 (30)
- October 2007 (31)
- September 2007 (31)
- August 2007 (31)
- July 2007 (32)
- June 2007 (35)
- May 2007 (35)
- April 2007 (30)
- March 2007 (28)
- January 2007 (10)
- December 2006 (7)
- November 2006 (5)
- October 2006 (4)
- May 2006 (3)
- March 2006 (1)
- December 2005 (1)
- November 2005 (4)
- October 2005 (2)
- September 2005 (2)
- August 2005 (1)
- July 2005 (5)
Blogs
- Alicia Marie Lozano
- Andi Gutmans
- Ben Ramsey
- Bob Parsons
- Brian Solis
- Cal Evans
- Carl Daikeler
- Charles Thompson
- Chris Corbyn
- Chris Shiflett
- Davey Shafik
- David Sklar
- Elizabeth Naramore
- Huber Adventures
- Lisa Hoover
- Marcus Whitney
- Mark Beech
- Matthew W. O’Phinney
- MC2 Design
- Meg Fowler
- Ollie Saunders
- Paul M. Jones
- Paul Reinheimer
- Pádraic Brady
- Robert Armstrong
- Sandi Gonzalez
- Sarah Gonzalez
- Sean Smith
- Terry Chay
- The Gonzalez Family
- Tony Bibbs
- Workout Journey
Developer Tools
- ASP.NET
- HTML Purifier
- PHP Developers Network
- Programmer’s Resource
- Solar Framework
- Swiftmailer
- The Coding Forums
- The MySQL Manual
- The PHP Manual