Category: Theory

  • 5 Tips to Become a Better Web Developer

    So, you are looking to become a better web developer?  Well, the fact that you are willing to read this article is a great start!  It’s actual one of my five tips.  I’ll begin by listing, what I believe, are the most important pieces in becoming a better web developer.

    1. Test
    2. Adapt
    3. Think/Plan
    4. Trial and Error
    5. Ask for help

    (more…)

  • How to deal with stress at work

    I’m assuming I’m not alone with this one, but on a daily basis I seem to bring home a lot of stress from work.  At one point I use to bring home so much stress that I was unable to sleep at night.  From time-to-time it still happens, but with these techniques below I have been able to significantly improve the amount of stress I bring home from work.

    Before we discuss resolutions, let’s discuss the type of stress us web developers/project managers bring home on a daily basis.

    • Angry clients
    • Your team members not performing well
    • A mistake by you
    • A bug that you were unable to find
    • Too much work
    • Mean boss
    • Difficult co-workers

    I’m sure this list could carry on a lot longer, but I think we get the point with HOW much stress we can bring home on a daily basis.

    Let’s begin by breaking each one down. (more…)

  • Keeping your CakePHP Controllers Clean

    As my office gains more and more experience with CakePHP, we are beginning to learn to build more organized web sites.  Looking back at our first few projects, I’m astonished to see how messy our controllers are!

    I know the controllers are the “brain” of MVC because it pieces our data to our views, but that doesn’t mean everything should go in there.  Our original controllers would contain all of our logic, all of our data manipulation, all of our custom queries, and some additional data validation.

    We are now working very hard to keep our controllers as clean and simple as possible.  My goal is to make every function in our controllers under 20 lines of code.  It might sound ambitious, but I think it is completely feasable. (more…)

  • Underscores and Internet Explorer Fun

    I think my favorite thing about being a web developer is wasting hours and hours of my time, my co-workers time, pretty much every ones time because Internet Explorer is retarded.

    Earlier this week, we were developing a site and we created a new sub domain off of our main domain.  Because we already had an existing sub domain for the same client, the team decided to postfix the sub domain with _new.  When we started testing our work, it didn’t start off well.  Open up Internet Explorer 7 and receive the login page, attempt to login and just get redirected back to the login page.

    We know there is nothing wrong with our login script as it works fine in Mozilla and it’s something that we’ve used on a million other projects.

    My head still hurts from banging it against the wall for quite some time to simply discover that Internet Explorer rejects session cookies when a domain contains an underscore (“_”) in the name!

    I know this is the shortest article I’ve ever written, but I had to vent.  Hopefully if you run into this problem you will Google it sooner than we did and this article will save you time and a headache!

  • How to create a socket server in PHP

    Ever want to build a chat application or perhaps even a game? If so, a socket server will help you get started. Once you understand the underlying functionality of creating the server, enhancing it is just as easy.

    The way a socket server works is, it will be running continously and waiting for a client to connect to it. When a client connects, our server will add it to our list of clients and begin waiting for messages from that client.

    Without further adieu, here is the full source code:

    (more…)