What frameworks are for and why some are better than others

Posted on Tuesday, November 11, 2008 in Code, Other, PHP, Personal, Picora

I posted earlier tonight about installing and setting up Picora and I also mentioned that I would probably write a few tutorials and doing something basic with it. I am going to write these tutorials so people will have the option of using Picora if they like. I personally don’t really think that this would be my choice for a few reasons. First of all their website is place holder, which in terms of the web and applications means you will end up supporting the framework as if it were your own. Chances are in a year, if that long, it won’t even have that placeholder. You will just see some girl holding her bookbag and a guy dancing because he got a lower mortgage payment. I could be wrong but I have called it before. On another note if less than one hour after I post a blog entry on how to install and get Picora running I am #1 in Google for “Picora Install” or “How to Install Picora” then their own documentation obviously is horrible, or rather it is nonexistent. If you are going to go the route of supporting dead frameworks then why not just build your own? If you are interested then take a look at this.

Second of all, a lot of the options available in their classes look kind of thrown together or somewhat copied over from CI. In fact I just spent the last two hour avoiding using their ActiveRecord class because I see no need for it. I would rather define my own Application Model class with my own functions to handle a few things, if I even need that, and then extend it in my models. So what I am saying is that there are a lot of frameworks out there, most people won’t know what you use either so don’t go for the hardest crap just to be L337. The point of a framework is to SAVE you time not steal it from you slowly.

So if a framework is supposed to save you time and make your life easier then, in my opinion, the most important things it can have are the following:

  1. A great community such as the one at any of the CakePHP sites or IRC Channels
  2. Awesome documentation, CodeIgniter wins this one. No one can even begin to mess with CI Docs
  3. Extensibility, you should be able to extend and improve every part of the framework in a standardized manner. i.e. Plugins or Modules

Because of the way I see frameworks and development I think that the best choice for those who want loose structure that is not required then go with CodeIgniter. If you need help constantly and know that you will need others to help you figure things out then on top of taking a class at your local community college you should check out Cake, their communities aren’t always the friendliest but there are so many that you are very likely to eventually get some poor guy to write the code for you.

The overall message here is that while I may not have chosen this as my primary, go-to framework for rapid development, others may. So when you are out there and see a blog post about using something like Django and you know that it sucks and you can’t stand Python and you really want to post a comment on how much Python sucks and Django is the natural extension of it’s suck then don’t. Just walk away and be happy that they enjoy developing in something that you can’t stand. By my rules above Django has great community, great documentation, plenty of modular additions, and on top of that a good number of books. So why make fun of that guy, he has all he needs to build and get support.

Always remember above all else though that this is all personal choice, that is the main point and to show you what I mean. Look at how irritated Allard obviously must of been by all the talk and the flooding of the internet with frameworks. Here it is, promises everything you could possibly ever want. Check it out and see what I mean.

Installing or Setting up Picora Micro Framework

Posted on Tuesday, November 11, 2008 in Code, Other, PHP, Personal, Picora

I was recently introduced to the Picora framework by the great guys and my new employers over at Applied Solutions Group. If you fit the following then this might be a good one to checkout.

  1. Don’t like the HUGE frameworks that get all the attention, talking about you CakePHP
  2. Really don’t care for being forced to use strict MVC and prefer to have the choice
  3. Really aren’t super experienced with frameworks and need to get started in a forgiving way

While I do care for and support strict MVC and not straying from it, other wise what is the point, I can see how some people don’t want to spend their development time worrying about what should and shouldn’t be done in a certain way. So to get started you may be asking yourself why I would need an article on how to setup a framework that is not as in depth as the large ones. Well the thing is that there isn’t much documentation to Picora. To me this isn’t a huge problem because as I have said before, if you learn one of these then you know them all. But setup can be frustrating when there is no README and you need to create a few files to get this thing up and running. So lets get started and remember that once we get these files made before you start playing make yourself a copy of the working framework so you can just be ready to get going each time you need it.

Step One - Download

First of all we need to get the core files so head on over to Picora and download the files. I will assume you know how to get a site installed on a server. So now we have our server pointing to and serving our Picora install. Open your install in your browser and you will more than likely see the following.

Picora Installed, Maybe

WOW that is impressive huh? Well the problem is that in addition to not including all the file you need to get started it also doesn’t include a stock .htaccess file, the “.” is important so don’t forget it. So lets start by identifying the problem, hey I ain’t doing all the work for you without teaching you something.

Step Two - Find our Errors

In the root of your Picora install create a file names .htaccess, in other words it should be at the same level as the controller folder, etc… Now in that file you want to type the following:

	php_value display_errors on

Remember that little line right there because it will save you many hours of heartache. Anytime php doens’t work for you just add that into your .htaccess file, just make sure to comment it before launch for obvious reasons. So lets take another look at our browser. Refresh your page and you should have the following.

Step Three - Fix our Broken Download

WOW again, ok now we at least have something to work with. Looks like the index.php file is trying to require a file called config.php that….doens’t exist huh? I think this is kind of crappy for the download not to include a default one that can be modified to show the ropes some but either way easy enough to figure out what is going on. In true step by step fashion lets create config.php, the file it wants, and see what we get.

Well again we get errors and it wants the base url so lets add some stuff to the config.php and see what happens next. We are going to add some stuff that is required for this work and move a bit quicker now because fixing every error one at a time is going to take up 8 pages here and I know you don’t want to read it and I don’t want to type it.

	define('BASE_URL','http://picora.local/');
 
	require_once('classes/PicoraAutoLoader.php');
	PicoraAutoLoader::addFolder($path.'/classes/');
	PicoraAutoLoader::addFolder($path.'/controllers/');
	PicoraAutoLoader::addFolder($path.'/models/');
 
	$routes = array(
		'/' => array('Application','welcome')
	);

Ok so now we got a config.php file that does a few things. We are defining a base url which is used by the system for many things, for instance flash messages and redirects usually rely on the base url. Either whoo, the require we have here could also be done inside a different file such as your index.php but I choose to separate it because I am calling in a class that will be required for the next few statements and because this is the config, don’t clutter your index.php file with a bunch of crap, but if you do, do it everytime so you know where to find it. Next up is something that since you will probably want to play with it isn’t a bad thing. We load everything class we have. In a release version we would narrow this down to only the classes that we are using and even at that you could argue, with good reason, to only loading these classes as need as part of the top of a controller. Either way I will stay out of influencing you to properly use conventions.

Well we added this here so now we need to clean up our index.php file a bit so we can get the rest of this working. Again I will give you a full dump of my index.php so you can copy paste and then read more to understand what it does.

	$path = dirname(__FILE__);
	require_once($path.'/config.php');
 
	PicoraDispatcher::addRoute($routes);
 
	print PicoraDispatcher::dispatch($path,BASE_URL,(isset($_GET['__route__']) ? '/'.$_GET['__route__'] : '/'));

Almost all of these things were already in there so we basically just took a few of them out to clean up our file and make it easier to understand. First off we get our path for use in config, and other places I am sure. Next we require our config.php. The next one is new though, we are calling the PicoraDispatcher that we loaded in the config, by loading all those classes, so that we can add in our routes. In every framework routes are always a huge and powerful option that any developer will gladly take advantage of. Last of all is the same line that was already there just calling that dispatcher to get our right routes. Now we want to refresh our browser again and see what we get. I get the following but you may not, if you do not then use the PHP error that gets printed or the Picora error message, won’t be much help, or finally post a comment here and maybe I can help you.

Step Four - Play with your Picora

Well that heading sounds retarded and kind of sexual but it is true, the only way to learn any framework is to use it. When I started programming I had a teacher tell me one time to try to NOT remember everything. Remember the basics and the conceptual side of programming and everything will always be possible. Syntax can be learned in a couple hours IF you know the concepts. It makes sense if you think about it, in the computer world if you know Java you can learn C, if you know Java and C then you can obviously learn anything because you know the concepts. If you just repeatedly repeat syntax then you will never understand it.

I will probably write a tutorial, or rather tutorials, soon and we will maybe build a blog application or some other stupid intro project with Picora just to show you around and let you see how you can extend classes in PHP so you don’t have to repeat yourself. I am in no way an expert with this system, I have around 10 minutes working in it and it took me about an hour to figure out all the weirdness with setting it up so take advantage of that and as I said before, save your working copy and use it to start new projects.

Why Mosaic Mix is a great company that is doing more than just selling ethnically diverse clothing

Posted on Wednesday, September 10, 2008 in Groovy Web Design, Other, Personal

I think that few people take into account a lot of the small details of the world around them. I have posted a few times in the past about one of our clients, Mosaic Mix, and how much we really like them but instead of just talking about why they are great clients lets take a look at why what they are doing is also as awesome as they are.

Many people would not see the reason for needing ethnically diverse clothing. If you had asked me if there was a need 3 years ago I would probably of not seen as much of reason as I do now. One night while watching a documentary on T.V. I saw a few clips from a video made by a young girl named Kiri Davis, then a high school student. After seeing a few clips of her documentary I went and found the full film, which is only about seven minutes long, and it is really a sad, eye opening short film. The video is at the bottom of this post so you can see it, it really is only about seven minutes long and I recommend that you watch it.

In the 40’s a man named Kenneth Clark conducted an experiment in which two dolls were presented to an African-American child and they are asked questions such as “Which doll is the good doll”, or “Which doll would you want to be” and the majority of the children chose the white doll. So Kiri Davis recreated the experiment to see if things had changed in the last 60 years, and she got very similar results.

So I hope you are starting to see my point about why Morinee and Richard Terry are doing a good thing with their business. They both realize the need for clothing that will not only allow children and parents to feel good but will also help promote self-esteem and build a better self image in children. I think it is the small companies like Mosaic Mix that may just have a shot at making sure if we do this experiment again in another 20 or 40 years that the results can finally change.

So head on over to Mosaic Mix and show some support for them, if you don’t need to buy any children’s or tween’s clothes then I am sure they would appreciate you sending them an email, or just letting some of your friends with children know about their company and their site.

I’m usually a calm person but this is a pure waste of time

Posted on Thursday, August 14, 2008 in Personal

This whole post is huge and stupid to show you how you look to me. If I find out one cent of my precious tax paying money went to this waste of time then I am going to go stand in front of the courthouse with a sign that says “Go to hell.” What a waste of MY time this site was and what an utter waste of time it was for these people to apologize. If you don’t see the problem here then you are first of all, sheltered and inexperienced, and second of all just lost in the stupid sauce. Things like this don’t discourage the youth from drinking and driving it just makes them laugh and do it more. Please have better ideas before you get me killed by some stupid drunk kid who thinks this video is hilarious.

http://fullapologies.com/

It’ll Mess you up bad

Posted on Friday, August 8, 2008 in Other, Personal

Well I saw it as the “Programmer’s Keyboard” and I had to try it so I installed some linux distro on an old 486DX2 I had sitting around, it was actually an old version of Slack that I keep for just such computers that hate X as much as I do and set it to kick ass in Dvorak keyboard mode.

Well I don’t know if you can imagine this or not but I type pretty freaking fast when I know what I want to say, and that counts me checking for errors as I type. Not as fast as Steve or as hard as Jim but pretty quick! So imagine me sitting at a computer with this crappy old 15 inch CRT that I use for Linux boxes trying to find “ls” or “wget” or even my personal favorite “lynx http://google.com.”

For those of you who are still wondering what the hell I am blabbering about here you go, here is an image of the layout that this keyboard that is “better” for your hands and speed looks like.

So long story short, try it out so you can feel my frustration!

Well Ms. Lohan, it has been a while

Posted on Wednesday, July 30, 2008 in Other, Personal

Well, it has been a good number of week and no contact. I could blame Google but I think I am going to call this experiment officially done. I guess that I was wrong and the dream meetings are not real, well at least not for me. I have proven this through a great deal of scientific research. So here is my research so everyone can learn from it.

Question : Is it possible to dream about someone and actually have been talking to that person.

Answer: No

Support: I posted two blog entries and waited 6 weeks.

Well that is it for research, as you can see I did an excellent job and I have managed to disprove it in a measly 6 weeks. Of course I am joking but who cares! Either way, I will leave up the Lohan posts just in case and for further research on the subject but I expect nothing, I actually expect less than nothing, as in the freakin E! Channel showing up outside my door someday to heckle me.

Apollo’s Travels

Posted on Sunday, July 27, 2008 in Groovy Web Design, Other, Personal

Well Jim has been posting a lot of content over at Apollo Creed Travels and although he has been making most of the content, me and Steve have gotten into the action a little bit and we have had a really good time.

So far the most fun we have had has to be doing this. We spent a few minutes on Friday driving to the store and checking out the Belle Chere parking situation. We had a blast filming it and much props goes to Steve’s steady driving!

Long story short, great idea Jim and keep the ideas flowing on what Apollo needs to do next

Our Grooviest Customers - July 08

Posted on Monday, July 21, 2008 in Groovy Web Design

Back again to present our Grooviest Customers for another month. We love our clients here at GWD and we like to let everyone know how much we like them by writing about them.

Mosaic Mix

I won’t write about a customer until their site is launched and that is why, even though we have been working together for a while, I am just now talking about Mosaic Mix. Richard and Morinee Terry are two of the most awesome customers that any web developer or designer could ask for. They actually spend a good amount of their time doing research and learning about their new business and how it can grow on the web. There is an old saying that when a E-Commerce site launches it should already have at least one customer. Most people don’t do a lot of work during development but I can guarantee that Mosaic Mix already has a customer if not more! But what really makes them awesome clients to us is that since they do their homework on the internet we have had a really smooth development process with them. They know what they want and they ask for it, this is great because a lot of clients will beat around the bush because they don’t know what they are looking for.

But moving on from just why I love them, lets talk about their product and what they do!

Mosaic Mix makes clothing for children, ranging from infants to pre-teens. They make original designs that promote positive self-esteem and aim to be completely multi-cultural. I have spent literally months looking at their products and I have to say my favorite is Lighthearted Lauren.

I think that Mosaic Mix will go really well for Richard and Morinee Terry because they are really dedicated to making sure that the site works exactly how they wanted it to work, which isn’t always easy in X-Cart! So best of luck to you and I hope to work with you guys again someday.


Apollo Creed Travels

Ok so this is not really a customer but I still had to talk about how awesome it is and this is my one monthly blog post in which I allow myself to do so.

Jim has the greatest ideas anyway but this one really takes the cake to me. A little back story first. While on a shopping expedition against our will we were stuck at an outlet mall in Williamsburg Virginia and out of boredom I went into Kay-Bee toys to find something to do and there he was, in all his glory, Apollo Creed. Knowing how much Jim loves Rocky I had to get it. Not five minutes later Jim took the first picture and had an idea to show everyone the world through the eyes of a 12 inch action figure. The site is supposed to be funny so go take a look at it, don’t take it seriously, and most of all laugh about it.

SLife is pretty cool!

Posted on Wednesday, July 2, 2008 in Other

SLife is, more or less, a time tracking program. It doesn’t track time in a traditional sense where you start it and then just let it go until you are done but it monitors how long each app has focus so you can see where you spend most of your day at work, or at home I guess. Sound stupid? Well it isn’t, it is kind of kick ass. I assume I spend most of my time with textmate or terminal but now I see that i spend most of my time working either on research or on checking work becaue Safari and Firefox are out front. It does so much more so give it a try!

So check it out over at http://www.slifelabs.com/ Give it a try, as you all know us Mac people don’t have a pain in the ass uninstaller so why not right?

On another note, I am sure Steve was going to blog about this so please check out http://stevejamesson.com for a good review and explanation. If you haven’t noticed I half ass these posts and keep them short, Steve actually goes a good job so head over there and read, then download.

Answer for those even frustrated by StarPlayr….StarPlayr2

Posted on Wednesday, July 2, 2008 in Other

StarPlayr2 is pretty nice, it is much better in my opinion and I am impressed. I tried SiriusMac, which was one of the crappiest and confusing pieces of software I have used this year. StarPlayr2 is not without it’s really crappy moments but it is definitely an improvement and you should give it a try!

My music selection makes last.fm look good

You can't see my music, but that doesn't mean it's not there.

This theme was designed by Chris Wallace and is licensed under the GNU General Public License.

Check out his cool WordPress Themes. Released by Six Revisions in the year of the rat.