Recently in programming Category

Tackling the Technical Tome

» What is the best way to learn a new technology? I'm talking about the kinds that come printed like hieroglyphics on the pages of a hefty technical tome. What's the most effective way to assimilate this information? .. to master the technology .. in order to wield its Mojo. Like a Jedi does with his lightsaber.

Javascript's Javan RhinoI read somewhere how the average programmer reads less than one technical book per year. Surprising, no?

I enjoy learning about & mastering new technologies. Always have. The more powerful the better.

But you neednt read many technical books in order to understand why they're considerably more challenging than your average armchair novel.

Back in '07, after web-hacking my way thru the site for several years, I read this book on XHTML & CSS. Cover to cover.

What a difference that made! Night-n-day. Suddenly the mojo was mine. No more struggling to figure out why things werent working the way I expected.

That particular title weighed in at a respectable 650 pages. But it contained plenty of fluff. (I actually like that kind of fluff. Another big deal was learning the Unix shell .. for help with VPS server administration. Very powerful. Things that used to take hours, now take minutes.)

Javascript | The Definitive GuideWrestling the Rhino

But those 650 pages are nothing compared to the 1100-page behemoth sitting beside me here now.

I must admit » this thing looks intimidating. Formidable. Daunting. Sometimes I swear it snorts at me.

But heft alone is not my only reason for dismay. Each page comes chock full of technical terms, unwieldy jargon that must be mastered if I am to have any hope of accessing the power it contains.

How I would *love* to upload the contents of this monster (.. into my brain) .. all in one shot. You know, like they do in the Matrix. But that option doesnt seem feasible. So .. we're left with the old, standard method » reading. Ugh.

I've been working on this Javascript book, off-n-on now, for several months. So I have plenty of experience dealing with such adversity.

This is not a mountain, I've come to understand, that cannot be surmounted by sheer enthusiasm alone. I mean, if I could stay awake for a week and power thru this thing, I would. But that aint how it works. (At least, not for me.)

In a strange, counterintuitive way, pure passion actually seems a hindrance here. Because passion brings frustration. More passion » more frustration.

I get a running start (passionate, enthusiastic) .. before heading up the Javascript hill. Only to find myself soon running out of steam .. exhausted, having made pitiful little progress.

What's required here is not so much passion or enthusiasm, but rather sustained, steady effort. Methodical focus. You know » the tortoise and the hare.

Anyway, after getting gored by the rhino a few times, I started to glean a few insights .. strategies for dealing with an intimidating 1100-page tome. So I've had to regroup and reassess my approach.

» It has been only two months since I set my sights on learning Javascript .. shortly after I discovered that HTML5 is coming, and that HTML5 is all about » Javascript. I continue to make progress (.. reading Flanagan's 1100-page Definitive Guide) .. tho not nearly as rapidly as I'd like.

Learn Javascript with Flanagan's Definitive GuideI get bogged down, particularly, whenever sections discuss OOP (.. Object-Oriented Programming) cuz I never learned OOP when studying PHP. (OOP was covered in the next video tutorial, titled » Beyond the Basics.)

Reading the sections on OOP makes me feel like my feet are tramping thru mud. Muck. Slow-going. Tho even there I'm now starting to make progress.

At first, the impression I got about programming .. was that » it was very much about » SYNTAX (.. how to use periods, capitalization, semi-colons, spaces, curly braces, comments, key-words, etc). And certainly, that's where all programmers start.

Programming is About » Building Things

But now the idea I get .. is that programming is about » BUILDING THINGS. All these things I'm learning are for the purpose of building programs. (Hopefully cool ones.) It was a distinct shift in my thinking.

A cool shift, I might add. Cuz syntax suks. Nothing much creative about syntax. But programs let you do nothing without proper syntax.

if I omit a period or capitalization here using english, or mispel something, you'll still know what I mean But not so with a programming language. No sense of humor do they have when it comes to getting creative with syntax. ERROR is their only response.

But getting back to the notion of building things .. programming is very much about » methods to control complexity. No problem to code up a simple 'hello world' function. The problem, rather, comes as the program grows in size and scope. Anybody can build a doghouse. Skyscrapers are another story.

Programming is Nietzsche

» It surprised me to learn that .. Javascript (and most programming languages) require no spaces.

The Places We Live .. that have no space In other words, you can use all the spaces you like (.. to improve, for example, the readability of your code) ..

.. but programming languages themselves just ignore white space (.. especially when you use optional semicolons to separate your statements).

That torqued my cranium nicely. Tho not sure why. Maybe cuz it's clear that the Englishlanguageneedsspacessobadly.

Still plowing thru Javascript. Got a little sidetracked there, learning about Unicode, ASCII, UTF-8 (the 8-bit version of character encoding that all my new web pages use) and UTF-16 (the 16-bit UCS Transformation Format that Javascript uses). Surprising amount of info contained there .. for something most of us take for granted.

Friedrich NietzscheProgramming is Nietzsche (Values)

Another little curio I've stumbled upon is:

• Programming (it seems) is very much about » values.

Nietzsche (it seems) is very much about » values.

■ Therefore, ipso facto » Programming is Nietzsche. =)

Wouldnt Nietzsche make a good name for a programming language?

What are your values? Your highest values. Do you live your life in a manner that is congruent and consistent with them? (Do you dare?)

Nietzsche did. (And he went stark raving mad.)

PS - For months (.. as I've studied programming) I've been on-the-lookout-for parallels or intersections (connections) between's Nietzsche's values and Programming values. Tho I never found what I was looking for. Not even a loose thread. Frustrating.

Nietzsche's 'values' are really about » morals & priorities.

While Programming values are about things such as » numbers (.. 1,2,3), "strings" (.. of text), booleans (.. true/false), arrays (.. ordered lists), objects (.. unordered lists of property/value pairs) & functions (.. code that can accept an input (argument, parameter) and spit out a value).

In other words we're talking about » variables. Which are values that change.

Two totally different sets of semantics. So I'm surprised by how the non-existent connection finally played out. I mean, the syllogism was obviously meant as a joke. (I did have a class in Logic, which was one of the better uses of my college time.)

Move #26 & Javascript Curios

» This is the first entry I've ever written without an Internet connection. Feels weird. We're moving, so the ISP account was cancelled. Later I will find a connection and post this.

Moving truckEarly last night I was wandering the neighborhood, laptop in hand .. checking the strength of the various wireless signals I found there.

Lots of them. Only one was unsecured, but it's signal was too weak to sustain a connection.

So I started knocking on doors & ringing doorbells. You know .. like the neighbor who comes looking for a cup of sugar.

"Excuse me. I live right over there and we're moving next week, so our internet was canceled. Do you happen to have a wireless connection I could piggy-back on for a few days?"

Everybody seemed eager to help, but nobody could remember where they put their WEP password. I finally gave up waiting while they looked.

One guy said he gave his password to his neighbor. He called her to ask if she still had it, but she wasnt home, so he left a message. Lets hope.

Guess I could just run a 100-foot length of CAT5 network cabling over the fence from the neighbor's house. But I'm not that desperate. (Yet.)

None of the connections were very strong. And even the ones identified as 'good' (while standing in front of their house) .. would fluctuate.

Anyway, it feels weird to write this with no internet connection. I will not be able to search for and add related graphics & images. With writing, I've found .. you need to stay in practice .. to keep the gears oiled. Or they start to rust. So writing seems more important than posting. But an audience always adds the thrill of exposure.

Guinness Book of Records

I have moved (so far) 25 times since my 18th birthday. I grew up in the same house my whole life .. but after that » on the move. A rolling stone gathers no moss. This will be move 26.

Do you know anyone who has made more moves (.. since turning 18)? Nobody I know does.

I'm gonna call the folks at Guinness. Perhaps I qualify for an entry in their book of records. The Dog may have me beat, but the only 'Guinness' he cares about flows out of a chrome tap.

Every time I move, I gain more admiration for Gandhi .. who, when he died, had only 7 possessions. A bowl, a robe, a holy book, pair of sandals, bifocals and a couple other things.

Julie would limit her belongings to the things she could carry in 1 trip with her convertible VW bug (.. I thot that was cool) .. 'til she got that couch .. that green couch she loves.

The Time is Right to Learn JavaScript

» If you review the Intro to PHP at w3schools, you'll find Javascript listed as one of the items there under the heading » What You Should Already Know. That's interesting .. cuz you dont need to know Javascript in order to learn PHP.

JavaScript: The Definitive Guide, 6th edition, released May 2011 I know .. cuz I've been learning PHP, and I dont know JavaScript. (Rather, I know about JavaScript .. specifically its dot.syntax - from

[ Note the converse is not true. PHP is not listed as a prerequisite for learning JavaScript. (Only item listed is HTML. Heck, not even CSS.) ]

PHP code is executed on the web server. JavaScript, on the other hand, is executed on your local machine (.. in your browser). Two totally different environments.

Most web people, I'd imagine, learn Javascript (browser scripting) before they learn PHP (server-side scripting).

This seems to be the natural progression of things. In other words » first HTML (page structure & conent) » then CSS (presentation & styling) » JavaScript (behavior) » PHP/MySQL (server-side mojo).

HTML5 logo» HTML5 Makes This a Good Time

Recently I've been learning HTML5. The longer I look, the bigger HTML5 seems. From what I can see, it promises to be a major step forward for the Web.

The main reason for its geeky coolness (by far) is the new HTML5 API's. (I count 31 of them.) As Erik says, HTML5 means » more power to the browser as a programming platform.

And the language HTML5 uses to exercise this power? .. that's right » JavaScript.

In HTML 4, for example, you need to specify JavaScript as the language inside the script tag (i.e. » <script type="text/javascript"> ). In HTML 5, on the other hand, you neednt specify (rather merely » <script> ) .. cuz JavaScript is assumed (.. as the default scripting language for an HTML5 web page).

So it's clear, even from my limited vantage point .. as a non-professional web-hacker .. that the time for learning JavaScript has arrived.

Fibonacci & the Golden Ratio

» While exploring the world of computer programming, I kept running into references to a mathematical concept known as » Fibonacci numbers .. sometimes referred to as the "Fibonacci series" or a "Fibonacci sequence" (of numbers).

Leonardo FibonacciLeonardo Fibonacci (pronounced » fee-boh-'nah-chee) was an Italian mathematician, born in Pisa (.. that's right, home of the famous leaning tower, whose construction began several years after Leonardo's birth).

He was a true pisan, who lived from 1170 to 1250.

Leonardo's father was Guglielmo Bonacci. The name Fibonacci means 'Son of Bonacci' .. a shortening of the Latin "filius Bonacci" .. similar to the way the name Anderson means 'Son of Ander'.

[ I was surprised to learn that Leonardo never actually used the name Fibonacci. ]

Some references cite him as the "greatest European mathematician of the Middle Ages." His greatest contribution was the introduction to Europe of the Hindu-Arabic decimal number system that we use today, based on ten digits with a positional decimal point and a symbol for zero.

At the time, Europe was still using the clunky Roman Numeral system, which made calculation difficult.

The Fibonacci numbers (or Fibonacci series) were (was) originally derived from a problem to calculate the population growth of rabbits under ideal conditions.

Fibonacci colored blocksSee here:

A certain man put a pair of rabbits in a place surrounded on all sides by a wall. How many pairs of rabbits can be produced from that pair in a year if it is supposed that every month each pair begets a new pair which from the second month on becomes productive?

Starting with zero and one, you calculate the series by adding the previous two numbers to get the next. Specifically » 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, and so forth. In other words, the next number is always the sum of the previous two. Simple, no?

The Golden Ratio

Perhaps more interesting .. is how we derive a good approximation of the golden ratio by dividing one Fibonacci number by the next (.. either way, up or down).

The golden ratio is defined as roughly 1.618-to-1, or 0.618-to-1 .. which is close to a ratio of one-third to two-thirds (33-to-66), and is usually associated with the Greek letter phi φ.

[ Actually, 60-40 is a closer approximation than one-third, two-third. While 62-to-38 is very close. The actual golden-ratio number is a decimal that goes on forever, so everything is an approximation.

I've divved up the home page according to the golden ratio, with the blue-green sidebars taking roughly 38% of total page width .. at least, when you use the default text size .. seeing the current layout is a liquid-elastic hybrid. ]

Inside the Programming Castle

The more I learn about programming for the Web, the more it seems like everything is about the DATABASE. PHP just happens to be the tool we use to shuttle data back & forth .. to & from the database. PHP also lets you modify the data going back & forth .. in seemingly unlimited ways.

Castle of Computer ProgrammingEvery once in a while, I catch a glimpse of the power available in learning to wield programming languages. Very brief glimpses, cuz I am just a beginner.

Interestingly, these glimpses always come while I'm learning how to use PHP to access and manipulate data going into or coming out of a relational database (MySQL).

The coolest part of these glimpses .. is that they really do give me the sense that the power available in programming is truly UNLIMITED (.. limited only by your imagination).

I mean, computer programming is designed to use (work on) a computer. By that I mean » a CPU and memory, which itself mimics how the human brain & human memory works. So there's this self-reflexive thing going on in the background (or underneath) .. which is itself a little trippy. What are the limits of the human mind?

Hard to describe, cuz I'm still just a programming n00b (.. tho I continue to make progress). But the promise of unlimited creative power is very seductive. Can hear it calling my name.

The programming gods however, do not freely surrender the keys to this unlimited creative power. No, sir. There's a price to be paid.

In researching how our brains learn, it seems we find it easier to learn new-things that we can relate to things we already-know.

The problem (I've found) is that learning how to program does not readily lend itself to other things we might already-know. Rather, it's like having to build a whole new conceptual world .. from scratch. In other words, it takes longer. And requires more effort, in the form of memorization.

I actually went back and reviewed the material covering basic concepts .. especially the section on user-defined functions() .. after finding I kept having questions about material I already covered. I'm talking about after I began studying Object-Oriented Programming (OOP), which is the focus of Beyond the Basics.

First Peek into Object-Oriented Programming (OOP)

Took my first peek today into Object-Oriented Programming (OOP). This is something I've postponed until good-n-ready .. cuz I heard OOP's concepts can be difficult to digest, especially those introduced at the outset.

PHP logoI'm currently reading the Gilmore book (among others). Jason says (.. in chapter 6, under heading labeled » Benefits of OOP):

"It is the most powerful programming model on the planet."

Uh, actually he said it's » the most powerful programming model YET DEVISED. I substituted the phrase on the planet for dramatic effect. =)

Same thing. So you can see why this statement got me all hot-n-bothered. [ # Tho Nigel said OOP is not very different. ]

The flip-side of OOP is called 'procedural' programming. I reckon it'd be better for me to learn OOP before becoming too indoctrinated into the Procedural method. Less to unlearn this way. You know how difficult it can be sometimes to change-over to a new paradigm (way of thinking) .. once you've become comfortable with your current method. Old dogs & new tricks.

The OOP model shifts the focus away from (conceptually) a program's procedural events .. to the REAL-LIFE things the programming model represents.

This modeling-of-real-life lends itself (I've found) to making comparisons with how programming applies to REAL-LIFE itself (.. and vice versa).

Sorta meta-physical stuff .. which I won't delve into right now. But thought-provoking nonetheless, and maybe worth discussing some other time.

The focus on REAL-LIFE entities (or 'objects') tends to make programming with OOP less obscure .. than the regular procedural method .. which mimics a foreign language.

Regarding OOP being conceptually daunting .. here's a statement I had to read several times in order to grasp (.. we're still talking about the advantages of OOP):

The developer can change the implementation of the application without affecting the object user because the user's only interaction with the object is via the interface.

So no, it's not rocket science, but the going early on is pretty slow indeed. But it's also very rich, which makes it rewarding. [ # I've heavily marked-up the first few pages of this chapter, as ideas & concepts were exploding all over the place. ]

[ Today's entry could be subtited » The Database Room. ]

Easy to confuse the term 'database' with the software that runs one .. which is actually a 'RDBMS' » Relational DataBase Management System. I've used the term 'database' myself (many times) when what I actually meant was » RDBMS.

MySQL Relational Database Management SystemOkay to use the term 'database' generically, I suppose (.. to refer to its parent software), long as you're aware you're doing it. (Which I wasn't.)

Heck, even MySQL refers to the software it produces as a 'database.' (But it's actually a RDBMS.)

Interesting how sharply the (conceptual) line cuts .. where none existed only a short while ago. Cool to watch programming concepts take form.

A 'database' is a simply collection of tables .. similar to what you find in a spreadsheet. Whereas an RDBMS is the software that powers/runs the actual database.

Of course, I am FAR from being a database guru. (N00b is more like it.) But from what I can see, DATABASES look pretty cool (*).

[ I don't know much about RDBMS's, other than the software seems to function similar to the way a web server works, such as » Apache or LiteSpeed.

The 'relational' part seems to refer to TABLES, which can be 'related' to one another, in any way you like, but only when you explicitly specify the relation.

The database for the Drupal CMS, for example, contains 68 'related' tables. Bigger and more complex applications tend to have more tables. ]

(*) My background contains some mechanical engineering, so that's what I tend to use as a conceptual point of reference. It happens on its own. Here's what I see (» a physical analogy):

»» The Database Room

A good-sized ROOM. I call this » The Database Room. It's empty except for BOOKCASES .. on 3 of the 4 walls .. BOOKCASES that run both wall-to-wall & floor-to-ceiling .. all divided into many perfectly square little cubes.

The only other thing in the room sits mounted to a circular pedestal in the center » a big, shiny, mechanical ARM (made of Inconel stainless-steel) .. which both deposits-items-into & retrieves-items-from the bookcase .. which it does both quickly & efficiently.

Running into the room from the outside is a conveyor belt. (Black, of course.) The conveyor runs both to & from the big mechanical arm. Deftly the arm grabs packages from the conveyor and places them into their designated boxes/cubes (.. in the bookcase). It also retrieves requested packages from other cubes and places them on the outgoing conveyor.

My foray into the world of programming continues with PHP. Several readers wrote to recommend a book. All suggested the same title (by Luke & Laura). One even offered to send his used copy.

PHPEasy to see why they like it so much. The reading flows. Being the 4th edition, the editors had plenty of time to polish the text. It's enjoyable to read a well written book.

If you search Amazon Books for the query » 'php mysql,' this is the title that tops the (long) list returned. Published by Addison-Wesley, who have a reputation for releasing quality titles.

The book, as you might expect, goes into more detail than the video tutorial I was watching. Now that I have a feel for the language, these details are falling into place.

For example, they introduce & discuss the object model in Part I (chapter 6). Object-oriented programming (OOP) supposedly represents a new way of thinking, which differs from the old 'procedural' method.

I especially like how they point out 'common mistakes' (.. cuz I make them all).

Every reference I've ever read on the subject of PHP (including this book) always begins by noting how PHP allows you to serve DYNAMIC web pages (*.php), as opposed to 'static' pages (*.html), which don't change (.. unless you change them yourself).

PHP allows you to craft pages that change according to virtually any criteria you can imagine .. which is what makes it so powerful and useful. The book puts it this way:

If you've built websites using plain HTML, you realize the limitations of this approach. Static content from a pure HTML website is just that--static. It stays the same unless you physically update it. Your users can't interact with the site in any meaningful fashion. Using a language such as PHP and a database such as MySQL allows you to make your sites dynamic: to have them be customizable and contain real-time information.

MySQL databaseBut the fact remains that web authors still need to generate quality content. No matter how you might happen to retrieve & arrange & display the data stored in your database, the content is only as good as what goes INTO your database.

No amount of programming wizardry will turn krappy, poorly written content into a silk purse. (Wouldn't it be great if it could?) That's the thing staring me in the face, sobering my lofty techno esthusiasm.

About this Archive

This page is an archive of recent entries in the programming category.

php is the previous category.

social is the next category.

Find recent content on the main index or look in the archives to find all content.