13 March, 2013

PHP: A Few Changes To Go

I've been using PHP since 1998/99 and during that time, I've experimented with a lot of other languages every time I have come back to PHP.  Since PHP 5.3 there have been numerous changes that have greatly improved the language -- I am especially looking forward to changes in 5.5. PHP has grown as a language incredibly since 5.2 however, there are a few major changes that need to be addressed. It is time for PHP to pull up it's big-kid pants and grow-up as a language.

The list found below are a list of items which I would recommend considering for changes to the language. PHP is my preferred language; you will not find me bashing PHP nor hanging out with the Ruby on Rails fanboys who trash talk PHP and compare it to their framework as if it were an equal comparison [except for maybe the lack of a finally block -- which will be corrected in 5.5 (w00t!)]. I do have  a list of changes I feel would improve the language overall.

On to the list:
  1. "$haystack, $needle" or "$needle, $haystack"  - pick one and make it consistent across the board. Most of the array functions use $needle, $haystack while string functions like, strstr or strpos are $haystack, $needle 
  2. Pick a function naming method and stick with it - Underscore, all lower-and-crammed-together or camelCased. Examples:  in_array, isset, ReflectionParameter::getClass.
  3. Replace "use " with "import" for namespaces - I have no real citation or legitimate reason for this I just really don't like the use keyword for namespace/class importing.  Use is used for too many thing within PHP plus I have proposed use for use at my next point. Wow, that was a lot of the word use.
  4. Replace "use" with "has" for  traits - my biggest complaint is I feel like traits should be included on class declaration. (e.g. class Programmer extends Employee has Coder {...} ). There in creates a separate problem where it leaves you needing to define Trait preference. I see no reason why these could not be stand-alone statements within the class itself. (e.g.

    class Programmer extends Employee [implements PersonInterface] has Coder
    {
       
      Coder
    ::getTitle as getJobTitle; 
      // or if you're hell-bent on the use keyword how-about...    
       
      use Coder
    ::getTitle as getJobTitle;
    // not a bad option
      // or just as an interface declaration 
      public function getJobTitle as Coder::getTitle;
    }

  5. Change String concatenation modifier from "." to "+"  - The plus-sign is generally used more often with String concatenation (as well as Math addition). Why do we need a separate modifier for String concat. I assume there was a reason this was done for a reason, I know Perl uses the dot for string concatenation.
  6. Replace back-slash "\" with period "." for namespace separators - why would you want to use your escape modifier to separate namespace paths?
These are issues in the language that I feel should be resolved. Obviously these are not trivial adjustments to the language. These are API breaking "features" which is why I feel that if these changes are adopted they would need to go in at a major release such as PHP 6 or PHP 7.  Any one of these proposed changes would require a developer to completely "seek and refactor" projects moving to a major release adopting these changes. Therein lies the key to this proposal. While this sounds like it would be a problem and slow-down developers, unfortunately PHP developers or perhaps sysadmins have been slow to adopt new versions. That I'm not here to debate, but I will use that to assist my proposal. 

Based on a presentation by Nick Belhomme dated 28 January, 2012, PHP 5.2 was still head-and-shoulders above all other versions of PHP 5 - despite the fact that PHP 5.3 was released 30 June, 2009  ( citation ). Two and a half years later and 53.6% more people were using and "old" version. If the adoption rate is this slow it stands to reason that this would allow for developers to ease into the new major release of PHP. I don't want to treat this like the ultimate solution to my proposed adjustments, this solution comes with some risk. Look to python for an example, python 3 was release 3 December, 2008 and it still doesn't have a wide adoption rate. The PHP community as a whole would have to have complete (read-as: majority) buy-in to move forward with the language. 

Finally, as stated previously these are just some changes I would like to see in PHP, changes which I feel would improve the language as a whole. Improvements that might make the transition to PHP from another language slightly smoother, ease recall of syntax and simplify reading.  Changes of this kind are not without growing pains for all developers converting to a version supporting these changes but changes which make the language clean and more consistent.

.::.  DruiD628 .::.

Labels: , ,

01 November, 2012

Running with Zombies



This past weekend I ran with zombies and it was a lot of fun. Wait, let me back up a little bit...
BEGIN FLASHBACK

This past June, two big things happened to me. First, I found out my wife is pregnant with our second child,  and second, I turned thirty. When my wife was pregnant with our first child I found that I gained a lot of sympathy weight. Now, most people probably think 'well, that's not a big deal it happens just do this or do that and you'll lose it in no time.' I've never been one who's been considered skinny nor very athletic and have always struggled with weight management.  So after my first child was born it took emergency surgery and a five-and-a-half week battle with appendicitis to loose the sympathy weight. That's not an ideal way and is quite expensive. So when my the gravity of turning thirty hit me along with a side-order of fatherhood round-2 I decided to do something.  I've always been very interested in running just too lazy to keep with it. So I thought back to a conversation my wife and I had about running where she told me about the Couch-to-5K program. At the time I had looked into it and just did not have the motivation to get up and move. So, I decided to give it a try.  I talked to a few people, they encouraged me and so I went to Dick's Sporting Goods and found some running shoes with some birthday money. On 8 July, 2012 I stepped out my front door and changed my life.  On 16 September, 2012 I completed the Couch-to-5K program and I was elated. Despite trying many times before to stick to running this time I had done it. The structure of the program kept me engaged and the Active.com community kept me honest with myself.

I came across a zombie 5k run, in Nashville near Halloween. Zombies? Me? Run? Sounds exciting! So I registered for the Zombie Buffet 5K and continued to train. In the mean time I decided I wanted some experience under my belt (even just one race) before my outing with the zombies when lo and behold while in the Hermitage Starbucks I see a sign for the Mt. Juliet HS Run for the Gold 5K.  On 29 September, I ran my first 5k race. The band-boosters for Mount Juliet High School put on a race to support the band and being a band-geek in school and a music lover this seemed like a good start. I ran the race in 32' 20" doing 10:13 minute mile. Pretty good I felt for my first time out. The morning of the race was mostly a blur until the race started but most importantly I had a much better idea what to expect for future races. I continued my training in preparation for the scheduled zombie outbreak. Finally 27 October, 2012 arrived and it was a cold, overcast and dreary morning, we'll just call this mood music. The experience was incredible, between the non-stationary cadavers chasing me to the one chained to a tree lunging at runners it was so much fun. The cold air, the cobweb gray sky, and the since of urgency helped keep your mind on edge the entire time. Just as you would recover from one onslaught you would round a corner and see a terrifying site forcing your mind to perform a reality check asking, 'is this real or not?' Most of the time I passed through obstacles with either a smile or determination on my face however, a few times I know that it was very likely self-preservation.  I went out and gave it my all however I did realize that were this a real ZomPoc I am not as well prepared as I would like to think. I made it a little more than a mile avoiding most of the zombie obstacles until loosing my final life flag into the hands of a runner on a flank attack. I also had it violently shoved in my face that I really need to spend more time on hills as the third mile was mostly one big hill. Upon completion of the race I immediately start planning and looking forward to next year. Running as a survivor adds such a level of difficulty and requires a higher level of skill which adds to the whole experience but seeing how much fun the zombies had it really makes it difficult for me to decide which side of the infection I want to run next year.

Getting past the week encompassing All Hallow's Eve, I have already began prepping for starting a 5K to 10K program and look forward to stepping up the skill. My new goals have been set:


  • Short-Term: Complete 5K-10K Program
  • Mid-Term:   
    • Complete a 10K
    • Begin Half-Marathon Program
  • Long-Term:  Tough Mudder

Links:
Active - http://active.com/
Zombie Buffet 5K - http://zombiebuffet5k.com/
Tough Mudder - http://toughmudder.com/

Zombie Buffet 5K Photos: http://bryanbloebaum.smugmug.com/Sports/Zombie-Buffet-5K-2012/26192483_PX5WHk#!i=2178636353&k=kL6dv3X
Zombie Buffet 5K Video:  http://youtu.be/JBvFF0LJdUg

Labels: , , , ,

15 July, 2012

Soccer

If you have ever said, "soccer is boring", "soccer can't really hold my attention" or anything of the sort this post is for you. I am a recent convert to soccer/[world-]football advocate however my first real introduction to soccer was about 10-12 years ago.  At that time I realized that soccer was a sport I could really get behind but as there wasn't really any where to go to watch soccer without being that creepy guy at high school and college games without a connection to anyone in the game. So as time went on my intrest waned. Fast-forward to 2010, FIFA World Cup comes back around and admittedly it peaked my curiosity again. Watching the World Cup, I wish I could say that it was a rekindled love at first site. It was not.  It took some time.  I then found out Chattanooga (TN, USA) had a soccer team, the Chattanooga Football Club (link: http://chattanoogafc.com/) I went to a few games and was suddenly beyond fascinated with the sport.  I began to watch it more and more on tv (when I could find it) mostly English Premier League but whatever I could find. I started keeping up with MLS (link: http://www.mlssoccer.com/) started following the New England Revolution (link: http://www.revolutionsoccer.net/) who played the Columbus Crew(link: http://www.thecrew.com/) at Finley Stadium in Chattanooga -- unfortunately I missed that game. Later I found myself a fan of the Vancouver Whitecaps (link: http://www.whitecapsfc.com/). My daughter even has grown up knowing soccer, when she was first getting interested in TV she would often bring me the remote where ever I was in the house and say, "soccer?" We now play soccer - or some form of it - most everyday. She can often be found marching around singing Believe (the Real Salt Lake anthem - link: http://www.youtube.com/watch?v=Pa1DJ008t9Y). So as you can see soccer has become as commonplace as hockey in Casa del DruiD. 

Last night after the litte one had gone to bed, I began flipping the channel and found nothing, the wife had fallen asleep on the couch and so I had decided it was probably bed time. I continued flipping and gave my self one pass of the guide and if nothing jumped out at me, it was bed time. I began paging through the guide and what to my wandering eyes should appear but "MLS Soccer" glowing in green in the middle of the screen.  I press "Select" and the game has just started. It was the David Beckham and the L.A. Galaxy (link: http://www.lagalaxy.com/) against the Portland Timbers (link: http://www.portlandtimbers.com/) so I decided I would give myself the first half then go to bed. I decided that despite not having any investment in either team I would pull for the Timbers. Three minutes into the game Kris Boyd plants the ball in the net. "That was quick," I said aloud.  1-0 Timbers. This three-minute goal said to me this was a good sign for the Timbers. After that Boyd's goal the Timber seemed to take it easy on the Galaxy allowing David Beckham to perform his magic and land one in the net at the nineteen minute mark. 1-1. Five minutes went by when the Galaxy were awarded a free kick. Beckham takes the point and flys the ball just over the head of the Timber players -- who did not bother  leaving the ground to block the ball -- and continued to the back of the net.  2-1 Galaxy.  Three minutes later the Galaxy get yet another kick and in a move that was genius Landon Donovan takes the point. The Timbers would have been much more prepared for the mystical prowess of Beckham and the logical thing it would seem to do would be let Beckham go for the hat-trick. Instead throw the Timbers off their game and let Donovan take the kick. A strategy which proved very successful. 3-1 Galaxy. One minute later the ball found itself on the wrong side of the Troy Perkins, the  Timber's goal-tender in a smooth play by Robbie Keane getting the assist from Mr. Landon Donovan. 4-1 Galaxy. 

At this point all hope seems lost for the Timbers. Twenty-eight minutes have passed and the home team has only been blessed with green smoke once and at this point it's questionable if anyone even remembers that goal it was so long ago. Twenty-five minutes have passed since Kris Boyd drew first blood and his team was already down by 3 goals.  Fear not, six minutes later at thirty-four minutes Kosuke Kimura puts one in the net changing the tide ever so slightly and keeping the Timber's hopes alive. 4-2 Galaxy. The forty-five minute mark comes and goes. The first has been recorded in history. With forty-five minutes left to play Portland came out swinging. It would not be until the sixty-four minute mark before the ball finds itself inside the net and unfortunately it would be for the Galaxy. Keane would be setup by Sean Franklin and David Beckham to pour salt in the open wounds of their hosting team. 5-2 Galaxy.  Later Eric Alexander sets up Kris Boyd to yet again find the net at the seventy minute mark. This would be the end for both teams however the fireworks were not over. 

For the remaining twenty minutes each team would come very close numerous times and played their hearts out. Each team was playing as if their lives depended on it. Even David Beckham took a nasty fall and a with an obviously painful crash on the head which proved it difficult for him to stand on his feet for a moment. He was pulled moments later for Bryan Gaul to take his spot. This game was amazing it was exciting and stayed fast paced. These are the games which spread the popularity of the sport.  I long to see more MLS games televised. The best way to grow the sport is to put the games out there for people to see. Now back to you the soccer skeptic - these are the games that you should see. These are the games that show the soccer skeptics why we fans love this sport.

Game Highlights: http://youtu.be/Tmmpnk5WGBk 

Labels:

22 April, 2012

Crow

So, I've decided it's going to be better for me to just bring my blog back to blogspot.
Long story, I'll explain later.

So if you are used to tablet.druid628.com look for it to start using druid628.blogspot.com.

Labels: , ,

31 May, 2011

The Way of the Flames…


Why the Thrashers need to make like the Flames and make like a Toronto Maple and leaf. Ok, all kidding aside, time to be serious. So the announcement comes out today that the city of Winnipeg (ok last joke, promise) has begun the process of purchasing the Thrashers to pull them back home to re-institute the Jets. This may or may not be a good thing, personally I was never a fan of the Jets and was a fan of the Thrashers ( highest rank: #4 on my list of teams) while Nashville was more of a favorite for me, Atlanta had more convenient access to games. Sadly, the Thrashers have not performed well since the loss of One-man-Team Superstar (Ily Kovalchuk) and Long-time Stanley Cup  hopeful (Hossa). They have simply performed, “just okay” in recent years.
Performance however is not the reason I believe that the Thrasher’s vacancy from Atlanta would be a good thing. As a fan of the Thrashers I do not want to see them leave Atlanta, that being said however, I think that the lack of enthusiasm for the team does strike a chord. Please don’t misunderstand me I don’t mean that no one in Atlanta or the surrounding areas but me is enthusiastic about the Thrashers though there is a general feeling of “eh” from most people I’ve had the pleasure of sitting near at games. The closer to the boards the better the reception to the team but for the most part my experience has led met to believe most people who go to Thrasher’s games are there as a social function. I’ve often kidded that you could ask any random person in Blueland what they think of Atlanta’s hockey team and you would get the response, “We have a hockey team?” My experiences in other barns has not been this way. Experiences in Nashville, for example, have been greatly more positive.
While Atlanta does have more hockey history than Nashville the differences between the markets is astounding. The first hockey game I took my wife to was a Penguins/Predators game and even being a long time Penguins fan I was fearful to actively pull for the Penguins because the overall sense of pride that Nashville has for their team is very overwhelming. While I do participate in the heckling, chanting and shouting of “Knights” during the National Anthem, Atlanta is missing home grown tradition. On the other hand, Nashville’s Cellblock 303, the catfish tossing – borrowed and modified tradition from the hooligans in Detroit, and the fight the Smashville community put up to keep the Predators there sing as a crescendo into what I feel will be a hockey club which will remain in good-standing and eventually will lead to new level of respect for the team, city and even south-eastern (US) hockey.
As stated previously, I do not want to see the Thrashers leave Blueland, but I can understand a positive vote to allow for relocation. I really enjoy being surrounded by hockey teams (Predators, Hurricanes and Thrashers) and while the loss of one of those teams would be sad for me, the NHL will go on, hockey in the South-East will go on and ultimately the world will keep spinning. While I hate that this would be looked at as a second failed attempt to bring NHL hockey to Atlanta maybe the next generation will be more receptive and proud to have a hockey team to call their own. Who knows, the next time the Coyotes come up for sale maybe Turner and Glavine  can purchase them and bring the Thrashers back to Blueland.

Labels: , , , ,

17 January, 2011

eDay


So, today is eDay. For those playing along at home, eDay was the date I have been looking forward to for some time. it is the day in which according to Big Red (Verizon) I am eligible for an upgrade. I look around and think I want a new phone NOW, yet I feel as though Big Red once again has me between a rock & a hard place.
Rock:
Android Phone, DroiD2/DroiD2 Global (slide-out keyboard), 3G, Existing Technology,  soon-to-be “the old way”, (ever so-slightly) cheaper.
Me:
I want a phone I can develop on/for, make phone calls (when needed), txt, email (TXRX), I would prefer an Android phone, preference given to ones with slide-out keyboard.  I’m tired of being behind on mobile technology.
Hard Place:
DroiD Bionic, Thunderbolt, iPhone 4 (is this really a pro?), 4G LTE, up-to-date, new technology, mo’ better phones. Expensive.
Here is the quandary, as  I see it, I could go forth with getting a Dark Sapphire DroiD 2 Global and its super-cool 1.2 Ghz Processor, sleek design and awesomely cool slide-out keyboard — or even just the DroiD 2 [non-global].  Riding the 3G wave from here on out for at least another 2 years. I know that the 4G capability is not even to Chattanooga yet but I know it will be.
The flip side, of the few 4G phones seen so far  none have had a physical keyboard which is a big deal to me and I’m not really 100% if it will be worth the wait right now. I mean I could wait 6 months or I could wait 2 years. 6 Months from now 4G could be still really buggy or be super cool while 2 years form now it could be super cool or really bogged down from the sudden mass migration of people like me who are eligible for upgrades now  and either don’t want or know to wait for 4G.
I think that my biggest problem is that today was supposed to be a happy day, “yay no more carrying my black — what do you mean pink? I’m color-blind, they said it was black — Blackberry.” while all I’m doing is worrying over whether to wait blow part of a paycheck on a new phone.
Looking at it right now, I can get a DroiD 2 Global for $200 (with my upgrade discount) I can get a DroiD 2 for $50… I supposed there is something to be said for waiting. Admittedly I’m not a patient person. I might possibly learn something from waiting to upgrade my phone, maybe an uncomfortable part of growing up.   Then again if I had one I could start doing Android development now…  Arghh! the humanity!


This post was a progression, it started as a tweet, grew to a facebook post then grew again into a full-on blog post which will get sent out as a tweet which will update facebook… life goes full circle huh?

Labels: , , ,

04 November, 2010

My 16 Year Old Self

Today I noticed a trending topic on Twitter, TweetYour16YearOldSelf, and  normally I don’t find myself falling into such tomfoolery but for a minute I was very tempted. Then the more I thought about it, the more intrigued I became. I thought, what would I tell my 16 year-old self.  Now, there was a song that came out a few years ago by Brad Paisley which made me first think of this idea. What would I tell me? What do I really need to know? There is so much I would love to save myself from, make sure I did and change if I could.
But is there really? If I were to change one thing, that one thing, could change it all. As bad as some of it was, as bad as it got, there was a lot of good in there. Some of it is responsible for me being here now and making me who I am. So no, I don’t know that I would want to tell me enough to change the out come.
I think the reason I found the idea of tweeting to my 16-year old self so fascinating was that whatever I said had to mean something. 140 character is all I get, it’s got to count for something. So, the one thing I would want to tell me at 16 years old is almost a back-handed pick-me-up, but given who I am, I would expect nothing less. Looking at it now the funny thing is, I don’t need 140 characters, I don’t need 100.  Just 80 characters says it all.
“It’s going to get better but not before it gets worse. Chin up and keep walking.”

.::. DruiD628 .::.

Labels: ,