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.
(more…)

0 Comments

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…

1 Comment

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,…

0 Comments

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…

0 Comments

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…

2 Comments

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…

0 Comments

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.

(more…)

1 Comment

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…

3 Comments