Category Archives: Ideas and Sorts

Quick note about change

Just a quick note about the change. Needed a change to the site. So I downloaded a good theme, and changed a couple things about it. More of a minimalist approach, not as gimmicky as the old theme, and is a whole lot more “neutral” in color.

Hopefully it will stick around for a while.

Ideas to help code

I have caught myself doing this often, and need to always regroup and figure out what is a better way to do these types of things. I am speaking of coding in absolutes. What does this mean? Coding a type of block that is hard set to do something exactly. Like for an example, let’s say that there is a calendar application. In this calendar application, there are four languages to select from, so a code block does something like this:

// Controller file
$eng = $this->Users->Select("language", "English");
$spn = $this->Users->Select("language", "Spanish");
$gmn = $this->Users->Select("language", "German");
$fre = $this->Users->Select("language", "French");

**Note this is not using any kind of construct in CakePHP, Symfony or any particular framework, just an example of a User class with a function called Select passing in 2 variables.

As an example, the view of this same code may be something like:

// Controller File
$this->set('lang', array($eng, $spn, $gmn, $fre);

Now while this may work for the time being, it could cause a hassle later on if there are more languages that the application will need to support.
Continue reading Ideas to help code

Non Code Code

We all get to a point in the coding process where there needs to be “non-code” code. This does not have the same type of structure or verbiage as the construct of PHP, C# or anything else. This is our own little distinct code.

It may seem like I am talking about lol-catz, which I am not. This is the code we do inside of our code. It extends beyond the logic of the code, or hopefully it does. If your own little code defies all logic, then maybe the code will break hard one day. This code is our own little way of saying how we are putting the code together. This is the notes/documentation that we write (or fail to write), the variable naming convention, object/function naming, any user messages we write, and error trapping/error handling we do. And there is more, this is just a few of the things that we get to write our own “code”.

One of the funniest things for me to do is to go back and look at some of my very first code. I look at the documentation I did, and it is funny to read. Some of the things I actually am scratching my head wondering what I was meaning half the time. The variables have great names which only partially tell what they were supposed to be doing. And the best is looking at the old VB 6 code where the variables followed the Microsoft horrendous naming structure.

Why do I write this and not about real code? Because there will be a time that you will be on both sides, writing and reading, and before you get upset that the person previous to you did not know what they were doing, they probably did. They wrote their non-code code perfectly for them and may have even understood their words at one time. And as sure as that will happen, you will write something that someone else will come in and scratch their head and say “What?”

So take it all in stride. Laugh about it, decipher it, and go forward. There is not enough time in the day to sit and stew about bad code/bad documentation/bad variable naming/bad non-code code.

And next post, I really do promise I will write more about actual code.

Things on my mind

OK, so I am a little late in posting something for the New Year. Now that college football season is over, there is less distractions for me on the TV. In my last post, I mentioned that my only New Year’s resolution was to take down the Christmas Tree. Well, I have done that, so this year is a success.

Now for some of the code stuff going on, more applications appear to be on the horizon. Some are big for a project, others are a couple of things that should be able to be completed fairly quickly. Some will have newer, “flashy” things on them, more integrated AJAX and what not.

But the real excitement is the new MacBook Pro 17″. I was hoping they would do that one soon, and now that they have, I think I want to get it. I just need to convince my wife that it is the right investment to do. Maybe I need to take on a few different projects here and there to help me out to get that new MBP. Then again, I really do not need any new hardware really. I just like getting hardware, especially when it comes with a possible 8G of RAM.

One hope of mine is to return to the UK with my family, possibly moving there. My kids are still younger, so the impact on them would not be as bad as it would be had they been teenagers. Yeah I know it sounds odd for me to want to immigrate to the UK, but that is what I feel would be best for my family. I can not really explain it, just a feeling I have.

So much for the musings and ramblings I have done. Next post will be about some code stuff. Most likely going again in the vein of CakePHP.

So Long 2008

As the country starts in the festivities to lay to rest this past year, many people come up with lists, a la “10 Best Somethings of 2008”. Sometimes the lists even expand to 25. And if you are VH1 and MTV, with little to no viewership and the most horrible shows on earth (BTW, I thought MTV and VH1 were supposed to show music videos, novel concept for a couple of stations name Music Television and Video Hits 1), then your lists go to 100 and there is pointless commentary along with each number.

However, this is not the way I wanted to end 2008, with a list of something. I could list off many things:
10 biggest mistakes in 2008
10 best code tips of 2008
10 best sites of 2008
10 worst stories of 2008

Or I could just say that this past year has been a great learning experience for me. From all the things that have troubled me this past year, to the successes, not-so much successes, illnesses, code projects completed, and what not. Just like my last post, there is always something to learn. This past year was a great year to learn many lessons. Some lessons I hope to never go through again, as the learning part was very painful and unpleasant.

But now as the new year is coming along, many people will make promises to themselves they will promptly break. My only real New Years resolution is to take down this Christmas Tree in my house. I do that, and this next year will be a success.

There are a few different code projects I am looking to complete this year. I also want to go back to school and learn some more. I want to get better at all aspects of the languages I use, better at security and performance to anticipate threats coming in 2009, and as DSL/Cable speeds up in America (about time freakin A) tune the applications to perform better and not lose functionality. I want to also learn Russian. I know a little, but I would really love to be able to write and speak it fluently. Maybe even Spanish and French as well. I also want to learn to play the piano. I know how to read music, now I ought to put that to use.

And I can never forget my kids. I love them so much. I am really glad I am able to be around them, and I want to be able to help them out, play football with them, and just be the best dad I can be.

So, thank you for all the memories 2008. Thank you for all the lessons as well. Hopefully 2009 comes in with success and prosperity for all.

Never Pass up the Opportunity to Learn

Just a quick post, as this is now December and I have not posted for almost a month. But this is another simple, and easy, and sometimes forgotten idea among the web programming world. Never pass up the opportunity to learn something new. I know this sounds really easy, and possibly even like a “duh” comment. But there are so many times I come across people from all areas of life, and all areas of business who think that they have nothing new to learn. When they encounter something they have not done before, or something that is done different than the way they did it, then it is wrong, and it is not right, and it is not correct, that it needs to be scrapped and how much they could do it better. Now while this may sometimes may be the case, it usually is not.

Just because something is different, or there is a requirement to do something in a different way, then it does not mean it is wrong, it is just an opportunity to learn. On Twitter, I started to follow PHP Advent. There are many ideas presented in this that provide a great perspective. Some I would not have tried, just because I would not have thought of that approach. But I would not dismiss them just because of that. There is always something new to learn. Never “poo-poo” anything just because you are not familiar with it.

OK, soapbox post is complete.

New Theme for this site

I redid the theme for the site, and moved it to 2.6.1. I am not going to even remotely claim that this is a visually pleasing site, nor will I ever claim it will win for the best site design. However, what made me change it was that I was not exactly enamored by any of the themes, and decided to do one myself. I looked for how to do this, as I have messed around with Photoshop before, and have become brilliant at hacking things around in Photoshop. But I took a few tutorials on how to do some stuff. This design is based from those tutorials. For those who would like to know, I went to these sites:

That was just some of them. I may do more, but I am also teaching myself Objective-C/Cocoafor the Apple/iPod/iPhone. But if there are any good links out there for Apple tutorials, let me know, because I may just be Googling the wrong phrases.

AJAX and YUI

With the sensationalized aura surrounding this “web 2.0” myth, there is more and more of a call for AJAX enabled sites. This demand gets higher due to sites like Facebook, MySpace, Twitter, and so forth. So when going forward with a design to implement AJAX libraries, which one is the best. The answer: Whichever one fits the job at hand. There are good points to Scriptaculous, jQuery DoJo and others. There is a good list of some of these with pros and cons at The Chandler Project, and a further list of other libraries at eDevil’s Weblog.

The one I am going to cover is a newer one, and one that is hosted elsewhere, which has its own pros and cons, and that is the Yahoo User Interface, or YUI. The documentation, the downloads (if you desire), tutorials and other information is located at http://developer.yahoo.com/yui/ and is very extensive for the different aspects it can do. What I am going to cover is something useful for long pages of content on the web, Tabbed Viewing.

Continue reading AJAX and YUI

Finally back up

After a few years of deliberating and going thru different iterations of site code, I have returned to the WordPress world and will write at the very least, the weekly entry in the blog. This will definitely have some issues as I see, as I am still deciding on the correct theme. But that will all be settled some time soon.

I have set up a few categories as of right now, and may add some more, but may not have to add any at all.

Current projects I am working on includes my full time job working with Fox Entertainment building online applications in PHP. Working with other side projects that include CakePHP for a local non profit organization, developing applications for the iPhone/iPod and another project to develop the plugin applications for those mobile apps on the Mac.

If there are any questions, then let me know.