My Year of Code

2015-11-13

2015 was my year to really dive into PHP. Up until this year, PHP was hobby language for me -- much as Python, Haskell, C++, Dart, JavaScript, and Java have been hobby languages. Granted, last year I finally took a job where PHP is where I spend half of my time.

This year, I took up intensive study of PHP. At the beginning of the year, I poured over the Zend PHP 5 Certification Study Guide, Third Edition by Davey Shafik and Ben Ramsey. I even passed the Zend Certified PHP Engineer exam and earned my Zend Certification. I also took up more of a leadership role in my local PHP user group, KCPHPUG, gave a few talks, and have been hosting meetups both at work and at a local café. In the late Spring/early Summer, I began work on a PHP library called OPHP. In April, I attended the Lone Star PHP conference and got to meet and hang out with quite a few luminaries of the community.

I think I can safely say that 2015 has been a year of PHP for me.

For next year, my language of intensive study will be JavaScript. No matter who I talk with about programming, JavaScript seems to be the lingua franca of web programming. I have already started to look deeply into Sencha's Ext JS, which is the JavaScript framework we use at work. EcmaScript 6 has piqued my interest since it was ratified in June. I have also been interested in learning more about node since it has usage in Atom Electron and beyond.

By this time next year, I hope to have a native comfort in JavaScript.

Tags: php, javascript, learning, omphaloskepsis

Number System: Time for a change?

2015-07-16

I have been thinking about numbers for most of my life. It wasn't until I helped my oldest child learn to count to 20 that I thought that the way we count in the English language is silly. There is no logic in our base-10 counting system until we get to 17: "fif teen" (what's a "fif?") is followed by "six teen" (ah, six is a number I recognize!) which is followed by "seven teen" (aha! seven is another number I recognize!). And this got me thinking that surely there's a better way to count.

Soon thereafter, I started finding a better way to count in a chapter of Malcolm Gladwell's book, Outliers. Gladwell posits that Chinese-speaking kids can memorize multi-digit numbers much faster than English-speaking kids can since the sequence "4, 8, 5, 3, 9, 7, 6" is made up of monosyllabic words in Chinese and "7" has 2 syllables in English. I would add that since Chinese is a tonal language, this sequence also has its own tune. Quick show of hands, who knows the 7-digit phone number from the Tommy Tutone hit, "Jenny" from 1981? Do you know that number because you can sing the number or because you can recite the number?

In the same chapter, Gladwell suggests that adding numbers in Chinese is easier than in English because the names of the numbers are more logical in Chinese than in English. For instance, the number 25 is "twenty-five" in English and the equivalent to "two ten five" in Chinese. Aha! Then 11 is "ten 1" in Chinese and 123 is "hundred two-ten three" in Chinese. In English (and En español ), the numbers between 11 and 15 are hard to memorize. In Chinese, pshh: "ten one," "ten two," "ten three," "ten four," "ten five."

This made me think that perhaps learning numbers would be easier if we came up with different units. If we were to count "0 - 10" in the standard English manner, then "11 - 19" would be known as "ten one," "ten two," "ten three," & etc. "20 - 29" would be "two-ten," "two-ten one," "two-ten two," "two-ten three," & etc.

Already, "1200" can be read two different ways in English, "One thousand two hundred" and "Twelve hundred.". It wouldn't be too large of a stretch for "1000" to no longer be known as "one thousand" but to be known as "ten hundred." Instead, "10000" would be known as "one thousand." Since the place names are changed in an exponential-growth pattern, this probably should be written as "1,0000" (10^4 or 100 hundreds) instead of "10,000." I could then call 1,0000,0000 "1 million" (10^8 or 1 thousand thousands) instead of "100 million," and 1,0000,0000,0000,0000 (10^16 or 1 million millions) "1 billion" instead of "10 quintillion."

Place 10^0 10^1 10^2 10^4 10^8 10^16 10^32
Place Name Ones Tens Hundreds Thousands Millions Billions Trillions
Smallest Example 1 10 100 1,0000 1,0000,0000 1,0000,0000,0000,0000 1,0000,0000,0000,0000,0000,0000,0000,0000

In my numbering system, I might also shorten two names: "seven" becomes "sep" and "tens" become "-ty"(pronounced like "tea")." 10 - 20 would be read as:

Number 10 11 12 13 14 15 16 17 18 19 20
Name Onety Onety-one Onety-two Onety-three Onety-four Onety-five Onety-six Onety-sep Onety-eight Onety-nine Twoty

Already there's some logic to the number names. The place names would be recursive like so:

Number English Name New Name
5 Five Five
55 Fifty-five Fivety-five
555 Five-hundred fifty-five Five-hundred fivety-five
5555 Five-thousand fifty-five Fivety-five-hundred fivety-five
5,5555 Fifty-five-thousand five-hundred fifty-five Five-thousand fivety-hundred fivety-five
55,5555 Five-hundred-fifty-five-thousand five-hundred fifty-five Fivety-five-thousand fivety-hundred fivety-five
555,5555 Five-million five-hundred-fifty-five-thousand five-hundred fifty-five Five-hundred-fivety-five-thousand fivety-hundred fivety-five
5555,5555 Fifty-five-million five-hundred-fifty-five-thousand five-hundred fifty-five Fivety-five-hundred-fivety-five-thousand fivety-hundred fivety-five
5,5555,5555 Five-hundred-fifty-five-million five-hundred-fifty-five-thousand five-hundred fifty-five Five-million fivety-five-hundred-fivety-five-thousand fivety-hundred fivety-five

It's Already Been Done

While thinking of this numbering system, I found out that one of my programming heroes, Donald Knuth, had come up with a very similar alternative almost 30 years prior (1981 - same year as Tommy Tutone's number-memorization hit mentioned above -- coincidence?). His system is called "-yllion" and is also influenced by the Chinese number system, has exponential binary growth, grouping digits in fours, renames some of the numbers, and has recursive naming. Knuth gets rid of "thousand" and replaces it with "myriad;" "million," "billion," etc become "myllion," "byllion," etc. I thought it would be great to use a combination of the two, especially for insanely large numbers.

While driving or working, I would count things in this manner until it became second-nature to me. Then I realized that knowing a secret language that has a global speaker count of 1 is not a good thing. I could either spread my idea by conquering and burning the world ala Genghis Khan or I could quietly give up. I chose the more gentle option.

The Chinese Connection

Fast forward to a few nights ago. I was studying the Chinese numbering system via edX's MandarinX course and was learning the separate symbols for 1, 10, 100, & 1000 (一, 十, 一百, 一千, respectively). Then it gets interesting, Chinese has symbols for 10,000 (一万) and doesn't have another new symbol until 100,000,000 (一亿). Why 10,000 and 100,000,000? Then I thought back to my toy numbering system. Notice any similarities?

My Number System Chinese
1
10
100 一百
1000 一千
1,0000 一万
1,0000,0000 一亿

A Modest Proposal

I do not believe that changing the Western number system is a reasonable expectation. After all, the Metric system (ok, "SI") has been around for several hundred years and the US is still stuck on the Imperial system for most things. We still use miles, pounds per square inch, and degrees Fahrenheit; but there's hope: I recently ran a 5K (5 kilometer) race, my mechanic has to use Metric wrenches on my and others' cars, and we buy bottles of soda and hooch in Liters (750 mL, 1.5 L, or 2 L). So perhaps there might be room for the -yllion system or maybe my modified -yllion system. Given the huge increase in drive sizes over the last 20 years, we are quickly running out of ways to describe their units of capacity. 25ish years ago, I thought that I was pretty hot stuff with my 20 MB (~ 20,971,520 Bytes) RLL hard drive. 1 decade later, I was thinking that my 250 GB (~ 268,435,456,000 Bytes) PATA drive was pretty hot stuff. A decade later, yesterday, I saw a 6 TB (~ 6,597,069,766,656 Bytes) drive array on sale for the same price I bought my first 20 MB hard drive. What's my point? The drives I'm describing are consumer-grade drives. In the IT-world, consumer-grade size is laughable. 15 years ago, I had heard an NPR report stating that the total size of data on the Internet was estimated to be 2 Terabytes. Last year, when I left a small IT shop in a small school district, we were in talks to bring on a drive array whose size was measured in Exabytes. Exabytes. That totally bypasses the whole Petabytes unit of measurement. So, after Exabytes, what then? Zottabytes? Then what? OMGigabytes?

If we were to recalibrate our units of measurement for computer-based things, perhaps we could have an easier time of describing those units of measurement if we were to use a different unit of measurement.

Let 1000 Bytes = 1 KB. I know 1 standard KB == 1024 Bytes, but let's go with the marketing assumption that computer units are base-10. That would mean that 1 Byte is the same as 0.001 KB. Now, let's expand upon these KB units using the -yllion number system:

Number Place Current Name New Name: Base = 1 KB New Name: Base = 1 GB
0.001 KB 10^-3 1 Byte 1 ten-hundredth KB 100 Myriad Myllionth GB
0.01 KB 10^-2 10 Bytes 1 hundredth KB 10 Myriad Myllionth GB
0.1 KB 10^-1 100 Bytes 1 tenth KB 1 Myriad Myllionth GB
1 KB 10^0 1 KB 1 KB 100 Myllionth GB
10 KB 10^1 10 Kilobytes 10 KB 10 Myllionth GB
100 KB 10^2 100 Kilobytes 1 Hundred KB 1 Myllionth GB
1000 KB 10^3 1 Megabyte 10 Hundred KB 100 Myriadth GB
1,0000 KB 10^4 10 Megabytes 1 Myriad KB 10 Myriadth GB
10,0000 KB 10^5 100 Megabytes 10 Myriad KB 1 Myriadth GB
100,0000 KB 10^6 1 Terabyte 1 Hundred Myriad KB 10 Hundredth GB
1000,0000 KB 10^7 10 Terabytes 10 Hundred Myriad KB 1 Hundredth GB
1;0000,0000 KB 10^8 100 Terabytes 1 Myllion KB 1 Tenth GB
10;0000,0000 KB 10^9 1 Gigabyte 10 Myllion KB 1 GB
100;0000,0000 KB 10^10 10 Gigabytes 1 Hundred Myllion KB 10 GB
1000;0000,0000 KB 10^11 100 Gigabytes 10 Hundred Myllion KB 1 Hundred GB
1,0000;0000,0000 KB 10^12 1 Terabyte 1 Myriad Myllion KB 10 Hundred GB
10,0000;0000,0000 KB 10^13 10 Terabytes 10 Myriad Myllion KB 1 Myriad GB
100,0000;0000,0000 KB 10^14 100 Terabytes 100 Myriad Myllion KB 10 Myriad GB
1000,0000;0000,0000 KB 10^15 1 Petabyte 10 Hundred Myriad Myllion KB 100 Myriad GB
1:0000,0000;0000,0000 KB 10^16 10 Petabytes 1 Byllion KB 1 Myllion GB
1'0000,0000;0000,0000:0000,0000;0000,0000 KB 10^32 100 Million Yottabytes 1 Tryllion KB 100 Myriad Myllion Byllion GB
1'0000,0000;0000,0000:0000,0000;0000,0000'0000,0000;0000,0000:0000,0000;0000,0000 KB 10^64 10 Duodecillion Yottabytes 1 Quadryllion KB 100 Myriad Myllion Byllion Tryllion GB

As you can see, somewhere between 10 Petabytes (1 Byllion KB) and 100 Million Yottabytes (1 Tryllion KB), we run out of SI units to describe the computer capacity. At some point, we'll either have to come up with a bunch of SI units to use with capacity, or we'll have to come up with a different way to count that capacity.

I expect to see capacities measured in Yottabytes within the next 20 years. Then what?

Tags: math, learning, Chinese