Month: October 2005

Why Does the PCP (PHP Collaboration Project) Scare Me?

Am I allowed to say that this worries me just a bit?

Is it normal to think that maybe, just maybe, dropping this much more power into the lap of Zend may turn things a bit sour?

Right now, the Zend PHP Collaboration Project sounds more like a vaporware kind of thing – nothing more than promises between companies that they’ll help each other out. I can’t help but wonder, though, if this inclusion of larger companies with influence on this framework might cause some kind of trickle-down effect on the language itself. What happens if, say, IBM comes up with a spectacular module for the framework, but it needs an update to the PHP source to really work. Do the Zend boys make the change to the code that other developers have worked up and made as bug-free as possible?

I’m not saying that the framework is all-together a bad thing. I know I’m putting a bit of a negative spin on it all, and maybe that’s just me, but I’m also a bit worried about the PHP community as well. I try to keep on top of things that are happening (especially the news), and most of the press about this announcement has been positive. I just hope that a move to bring more companies “into the fold” of PHP development doesn’t cause too many issues around the community – especially with other framework developers. What’s going to happen to their frameworks if the Zend one, obviously funded and developed by a larger group than most, comes in and blows them out of the water?

Will all of these fade into obsolesce?

[UPDATE]: They’ve launched their official site about the collaboration today. Am I the only one out there that finds it amusing that the video they placed so prominently not only doesn’t talk about the collaboration at all (seems like a Zend marketing video to me), but it also includes quotes from companies not even involved with the collaboration!

Advertisement

Creating Calm out of Clutter

Did you ever get the feeling that everyone else around you has it all togther?
Have you ever felt like there just isn’t enough time in the day to get the things done that you’d like?
Do you thing there has to be “A Better Way”?

Well, if you find it let me know…until then, I’d like to offer a few tips on organization from a highly messy person. Yes, I know that it’s a bit of an oxymoron, but all messy people out there (you know who you are) can sympathize with my plight. There are mounds of paper all over, pens and pencils scattered to the wind, and books place haphazardly on shelves and desktops until there’s almost no surface space to be found. I’ve been there (still am most of the time), and I feel your pain. But there are a few things that I’ve found that can help alleviate some of the scarry bad clutter that haunts your work area:

  • Don’t try to clean it all at once – If you’re like me, you have quite a bit of messy area to contend with. Desks are covered, floors too at times. You might even have things posted up all over the walls, covering up perfectly good paint (and no, it’s not holding up the wall). So, what to do about it all? Well, I know for me, the task of taking care of all of it at once is a rather large chore. So, my advice – break it up into chunks. If you’re at work all day and your desk is hard to do much more than type on, pick up a little when you first get in. It doesn’t have to be anything amazing, just take a stack of papers, look through them, figure out what you need and don’t need and toss ’em. Only keep the things that you need, not the “might need laters”. Trust me, you can always find the information on those later. And, if it’s not papers that are mounding on your desk but supplies (pens/pencils/trolls/small animals), consider better places to put them. Writing implements, save one to always keep on hand, go away in the drawer. Books and magazines can go up in the rack/bookshelf where they belong (you do have a bookshelf, right?). But remember, you’re not trying to tackle the whole thing at once. You just need to go a bit at a time. Do one stack in the morning, and one in the afternoon. Two to three stacks a day and you’re definitely on your way to a cleaner, clearer work environment.
  • Don’t keep the maybes. Go with your gut. – This goes hand in hand with a lot of the things mentioned above, but I think it needs to be reinforced. When you’re going through things, look at it but don’t read it – then go with your gut. If you get your mind too overly involved, you’re going to keep it. It’s that simple. Trust me, this is coming from experience. I’ve kept way too much stuff over the years because of one sentimental reason or another and usually just threw it out down the line anyway. No, I’m not talking about the fun little knick-knacks that are parked all around your monitor. I’m talking about papers that you haven’t used in a year, or books that have enough dust on them to draw a smiley face. Find a trash can for the papers and find a (upright) place for the books too live, either in your shelves or in someone elses. (Yes, *gasp*, I’m a propnent of giving books away when they’ve lost their usefulness to me. Besides, most of my web programming work is documented somewhere online anyway, so who needs dead trees?). Even writing tools can go the way of the dodo and need to be tossed – small pencil nubs or pens that have leaked in the past but “seem okay now”. Get rid of them. Toss them in with the remins of your lunch and be done with them. Keeping around things that work and are productive not only help your work, but can make you more productive (well, okay, not everyone, but it can help).
  • Cables, cables everywhere… – This applies more to the hardware-inclined out there, but everyone can suffer if they’re not watching closely. “Cable creep” (much like “feature creep”) can be deadly if left unchecked. Well, not so much deadly as really annoying. I have to admit, I’m an Apple fan, and there’s one thing that I really like about the way their machines are designed – simplicity. Not just the simplicity in their elegant OS or their leader-of-the-pack hardware designs, but because of how they structure the power cables of their machines. It makes me happy that my Cinema Display only plugs into the back of my PowerMac and doesn’t require an external power source. One cable versus two. Sure, it’s not much, but when you compound that into all of the little gadgets and items on your desk, that can really add up. No, I’m not proposing that you go out and buy a Mac (though I think you’d like it if you did), but I am asking you to talk a good, long look at the electronic snakes that are winding their way across your desk. I’m sure some of them belong to items not even a part of your daily routine, yet they remain hooked up to their ports, taking up space and generally making your desk more cluttered. One solution, of course, is to take the offending cables off, especially the ones that you use less than twice a week and put them away in a drawer/bag/someone else’s cube – anything to get them off of your desk. I know I’m bad about leaving things plugged in, and I leave them there in my “Clutter Blind Spot” to wait for a day when they’ll be forced to move.
  • Loose the “Clutter Blinders” – I’m as guilty as the next person of letting things stay where they lie. Papers are placed on top of others, cables and other hardware is moved to make way for something else only adding to the clutter. I get so focused on what I’m doing through out the day, though, that I don’t notice the clutter as much. I can push it out of my mind and continue on my merry way, doing my work unhindered. Now, I know some people out there are looking at me (well, reading this) and thinking that it would drive them crazy to be like that. Well, good thing you’re not me then – different people have different tolerance levels for the clutter they can stand. Some people get a bit bent out of shape if there’s a random piece of dirt or grime on a desktop, and some only have clear areas around their keyboard and mouse (yes, this is me right now). So stop, take a look around you, and really take in what your work area looks like. Would you have room to write something down without having to hold the notepad or put it on a book/stack of papers? Do you have the room to be flexible with the placement of your computer? Can you move at all? (Ah, Milton flashbacks) Chances are, if you either answered “no” or “well, of course I can…I think” to any of the above, get those blinders off, pick up a stack, and get to work.

Okay, that’s enough of that for now….I’m off to take a bit of my own medicine and make this cube a little more “ship-shape”. Once again, please feel free to leave some comments below – especially if you found this at all useful. There’s more tips where these came from, but I want to be sure I’m not just rambling to no one out there. If you submit a comment and don’t see it right away, it’s because I’m not online (I know! I actually have life outside of the keyboard!), but I’m regularly checking the admin on this blog for new comments to approve, so it shouldn’t be too far away…

How to Learn PHP (and Understand It)

I don’t think there’s a day that goes by that I don’t see someone just coming into the world of PHP, eyes bright with promise and hope, ready to tackle just about anything that comes their way. Of course, reality sinks in and, unless they’re already pretty well versed with programming and the thought processes that go on behind it, they might take one look at PHP and run screaming. Of course, there are much worse kinds of languages (some that have functions that wouldn’t even make sense to someone who wasn’t “on the inside”). Thankfull, PHP is a low-entry language – people can come in, not have much programming experience at all, and, with some help from tutorials and the manual, make some simple little PHP scripts to do some smaller jobs.

Some people stop there – they’re happy that they learned something, and what they wrote – even if it took them four days of twenty hours each to finish the five lines of code, they’re happy and pround of it. Of course, it won’t take long before they look at it, realize that there has to be something better and set out on a course to follow in the footsteps of many before them – to really learn the language.

So, you ask (being one of those with the resolve to go on) – how can I learn all there is to know about PHP? What do all of these funny things mean in these “class” files? Why can’t I just stick with procedural code all my life?

Well, lets take a step back and start from the beginning – programming itself. Ever since computers came on the scene, there have always been programmers (duh). In the early days, they were the pioneers of the technology world, forging ahead to make ever bigger and better pieces of software for the world to use. They mucked about in their digital playground, building the physical form of the logic that sat in their heads, making real what was just an idea. Unfortunately, with the general state of the web these days, this pioneering spirit seems to have gotten a bit lost in the details. Sure, there are those out there that are forging the way into the new land of “Web 2.0”, but on the whole, things seem to have plateaued a bit. So, how can you, a budding programmer take part in all of this? Well, the real question you should be asking yourself isn’t so much “what big thing can I do to make a difference?” but “how can I make what I can do the best it can be?”

So much of the programming that I see is more of a hack job than anything else. Yes, I’m as guilty as the next developer out there of doing this, but there just comes a certain satisfaction with creating something that you just want to show off to another developer and see their jaw drop, just a little, when they figure it all out. Programming is an art, it’s an extension of you, who you are and how you work. It’s never static, and acts as a fluid whole always changing shape but never breaking form.

So, enough of that – you want to get down to the real meat of the subject – how can you, a developer somewhat skilled in the ways of PHP, learn as much as you can about the language in the shortest amount of time.

The easy answer? A project
The harder answer? There is no easy way.

PHP throws people off by being such an easy language to get into. They look at it, they understand what the functions do and their names, and they know how to get things to cooperate when the time comes. However, making a quick script here and there is nice, but it’s not going pull you into the language like you’d need. For that, you really need a project to work on.

No matter what project you choose, however, you need to always plan before you start writing. Lots of projects show evidence of poor planning on the part of the developers, and it shows. Code is hard to update and difficult to add new features to, and at some point, the developers would rather just scrap the whole thing than have to work with it one more minute. So, the monal of the story? Plan, plan, plan. Take your project, step back, and look at what it really needs to accomplish. Break it into chunks, take it apart in your head. One good method for breaking it out is to think of it in steps. Say your application is a simple content manager – all you really want to do is put information into a database and pull it back out. Nice and easy, right? Well, take that simple project and look at it in bits – something to display the data, something to put the data into the database/text file, and something to handle both of those. So, three parts – three scripts. You can create one page thats goal is to simply pull the information out, one page that uses something like a form to put the information in, and another single shared file that helps you with parts of both – a library of sorts that you can call functions from.

Now, if that sounds a bit overwhelming, then break it down even more. The real key here is to keep breaking down the tasks that you have ahead of you until you know what you’re doing. Don’t try to tackle a database abstraction layer on your first day. Instead, take a look at some of the database functionality – learn how to read and write to it, learn some of the basics of SQL. PHP makes it very simple to interact with it (MySQL or the like) quite seamlessly.

So, here’s a handy little list of suggestions to follow to help you get more out of your PHP experience (some that have been mentioned, some that haven’t):

  • Break it down, now! – don’t focus on the project as a whole except at the beginning. Break it down into chunks that you can do and work towards that. Then, as things progress, you’ll find the smaller steps easier and the larger ones “just happening”
  • The manual is your best friend: I see too many questions (like on ##php on freenode) that could have been answered by a quick look in the manual. If you’ve been working with PHP thus far and haven’t see the manual, head on over to php.net/manual and discover the joy…
  • Remember that programming is more than just writing code: when you create an application, think of it as that – a creation. One that needs to be thought out, planned, and cared for just like any other thing. The less you take care of it, the more it’ll come back to haunt you in the future.
  • Tutorials and all are nice, but you have to strike out sometime: get your feet wet with some examples and tutorials, but don’t expect there to be a tutorial for everything out there. Sometimes, you just have to take an idea, forge ahead, and make your own trail…

Well, hopefully this has been useful to someone out there. I know there wasn’t any code involved, but I didn’t want to get into that. I wanted to talk more about what it is to program and how that can apply to PHP. As always, if you have comments/suggestions/flames/death threats, feel free to leave them below in the comments…

Developer Descriptions and Distractions

The other day, upon the stair, I met a developer who wasn’t there. He wasn’t there again today – oh how I wish he’d go away.

Yes, I know it’s a little off, so sue me – but we’ve all had people that have worked with us like this, whether they were mentally “not there” (not in their work, goofing off most of the time, etc) or really physically not there. This last type of developer really has two types – the type that’s just not at work a lot of the time (“I’m sick.”, “My alarm didn’t go off.”, and, my personal favorite heard on the radio this morning, “God didn’t wake me up.”), and the type that’s there but never at their desk. They’re either up and about running between asking useless questions to the other people in the office, or their off just hanging out somewhere, abusing the company policies of leniency.

Any of the above kinds of developers can be detremental the course of a company. I don’t have any kind of experience beyond just what I’ve seen in the corporate culture around me, but I think that’s enough to know dead weight when I see it. Sure, not everyone works the same way, and, to be fair, most of these kinds of developers still get their jobs done – they just aren’t as efficient as others. It’s easy to see how, with not much time spent thinking about work-related things or actually (*gasp*) sitting down long enough to get some work done, they could be seen as not pulling their own weight. It’s a shame really, that there are people out there that sometimes make it their mission to see how much they can “bend the system” before something snaps. Am I guilty of a little bending myself? Sure – I think we all are in honesty. Everyone’s called in sick when they weren’t (and according to statistics, the most-called-in-sick day is Wednesday, go figure) or taken the easy way out of reassigning things when they just wanted a break, but it’s a sad state of affairs when the worker makes a habit out of it.

I don’t want to come off as self-righteous or snything, so feel free to knock me down in the comments on this one, but I think everyone out there (that’s worked in a corporate environment) can sympathize with what I’m saying here. We’re all human, and sometimes we all just need a break – we really weren’t made to be sitting in offices doing the same kinds of tasks over and over again. Why do you think weekends are so enjoyable? If everyone loved their job, weekends might be just another day. As it stands now, though, they’re “not long enough” or they “went by too fast” despite them being the same length as any other day (though I have my suspicions about Saturday…)

So, as a way to try to remedy some of the things that could make one a less-than-stellar developer in their neck of the woods, here’s a few handy tips that can keep you on your toes:

  • Avoid Distract….that dog has a puffy tail! – Yes, computers can be both the greatest things since sliced bread and the worst thing for productivity, all at the same time. I’m particularly guilty of this one, having 20-someodd windows open most of the time, with ALT+TAB being one of my best friends. (Clicking is just too dang slow sometimes). Between IRC, email, instant messages, and just plain ole surfing the web, there’s tons to distract you from the real task at hand. I suggest something I read a while back – use a reward system to help condition you into working in bursts. No one I know works for extended periods of time all the time – they can do it for a bit, but it wears on them. This method, while a little silly to start off with, can help down the road. You simply block out time with applications…for example, you say that for the next hour, the only things you can have running are a web browser, your IDE, and a local copy of the PHP manual. It will take a while, and if you’re not particularly good with temptation, maybe longer, but it can help to just not have that temptation there.
  • Care about your work, and your work will care about you – Sure, it sounds a bit trite, but if you really do enjoy what you’re doing and take the time to really craft the scripts you create, you’re doing more than just coding another application – you’re giving birth to a bouncing baby of code. Treat it as such. Sure there’ll be scripts that are a 10 minute hack job – I’m not really talking about those. Larger projects, however, are the prime example of why you should “baby” the code – find the “right” way to do something rather than a hack (yes, you know what I mean – don’t even pretend like you don’t), think flexible/give it room to grow, teach it to share, keep track of its growth, don’t let it hang out with “the bad kids”, and, most importantly, don’t push it off on someone else – this only leads to trouble and code juvenile delinquency.
  • When you’re at work, work – As mentioned above, there’s some developers that come in and make a game out of seeing how much work they can avoid. They do just enough to not get fired (Office Space, anyone?) – no more, no less. Not only does this tend to bring everyone down, but it also makes it a nightmare for the management staff. Employees that can esentially manage themselves are very much desired. No one likes the guy that has to call every 10 minutes to ask a question about an app they’re writing. So, stop, sit down at your desk, focus on the work in front of you – even if it’s only for 10 minutes – then take a break. Get something done, something real…if you get something accomplished, chances are, there’s something right behind it that’ll need doing. Do that. Get it done. Get motivated about your job and your work! I don’t know about you, but time spent “at work” for me is some of the most (PHP-related) productive time that I spend each day. I work from home occasionally, but it’s just not the same. I know it’s mostly psychological, and I know I could work just about anywhere, but it still helps me to be there – wholy there – and get the job done.

Alright, that’s about enough of that…if you have suggestions to add to the list, feel free to leave some comments below. I’m really going to try to bring some more PHP-related things into this blog as time goes on. I knowI’ve been getting more into the whole “corporate culture” thing lately, and if it hasn’t been your cup of tea – sorry about that. But keep an eye out – more PHP goodness is yet to come!