Geekery

As a web developer I find myself challenged with code that is my own and the completely bastardized versions of things that people call code from others all the time. It’s part of the challenge I love and part of what makes me good at what I do.

Recently I was in the #php chatroom of the Ubuntu Servers in IRC and I found myself giving advice to someone looking to provide a shopping-cart like solution to his website. After talking to him for a while, the real problem came out. Apparently, there was a symbol that was appearing in the output file that was not allowing them to easily open it. So, rather than come up with a solution to change the file, they started to look for a ‘shopping cart’ solution.

Once he was convinced that it wasn’t that he needed a new solution, but a new look at his code, this is the conclusion of a long conversation with him:

me: craigbass1976, then start to learn to use php.net and its search functionality.

craigbass1976: Ok, I’m going to go break more stuff. Thanks

me: craigbass1976, and go through the code. It’ll take time. But you’ll learn and understand simultaneously.

craigbass1976 (n=craig@*************************) has left ##php (“Leaving”)

me: Heh… sometimes people just need confidence to break stuff.

It’s amazing to find that people just need the confidence and the reassurance to go ‘break code’ that may cause their application to work properly.

So, the point of this post is:
YOU CAN COPY YOUR FILES AND THEN BREAK THEM

It’s such an important lesson that I even decided to hit the caps lock key.

Breaking code is a huge lesson when it comes to learning how to write code. If you are afraid that you are going to break things, then that may curb you from stepping outside of your bounds. Don’t be afraid to push your limits when it comes to writing code. Use a complicated array in a weird way to find results associated to a weird database.

It’s important to push yourself.

I think that one of the biggest things that can help you is learning how to easily access the search engine of code language of your choice. First of all, this suggestion is for Firefox. Not Internet Explorer.

Here’s one of the tips that has helped me so much:
Setting Keyword Searches

Oh man. This allows you to type simple things in the browser and have it search the location of your choice.

Here’s an example:
Say I wanted to know what the function strstr() did in PHP. I can open Firefox and type in the location bar: php strstr and that’s it. It will immediately take me to here.

This can apply to whatever language you want. I use pgsql for when I am searching for PostgreSQL related things in a similar manner.

Here’s how simple it is.

  1. Go to the website of the language of your choice. In this case, we are going to use http://www.postgresql.org because it is the best database setup ever:
  2. If availabile: find the search box for the site and make sure you select the type of search you want. On some sites this will be selections such as “Function List” or “Online Documentation”. I personally prefer to select the most general search option to ensure the largest number of answers. In our example here, there isn’t a basic choice in the search box.

    Once you have selected your option, right click in the box and select “Add a Keyword for this Search…”:

  3. Now that you have selected the search box. This will bring up the “Add Bookmark” dialogue. Here, you can enter a Name for the search (in this case PostgreSQL Search) and the Keyword for this search (pgsql).
  4. Click on the “Add” button.
  5. Enjoy. Try entering the following into your address bar pgsql drop column and you will see that you will be brought to here. It’s as easy as:

Now you can easily access the search engine of the language of your choice and you can plow through code and easily search what it is you’re really looking for. Hopefully this will be helpful to those that are trying to learn how to write code or trying to learn a different language.

Ultimately though: this applies for anyone looking to ease their browsing experience.

Now that you have easy access to the documentation you need, you can go about breaking stuff. Start at the top of the code and work your way down. When you come to something you don’t understand, fire up your browser and start searching. Having the keyword search available at a whim will save you a ton of time. It will also allow you to minimize the time spent away from your code. The more you trudge, the further you’ll get. Eventually you’ll start to learn simple bits and pieces about the code in front of you and the results you see on the screen.

It will take time, but patience and perseverance will pay off in the end.

That’s it for now. If you enjoyed this post, then you should consider subscribing to my RSS feed.

  • Farking Fabulous! I have found other ways to do this but this is by far the easiest.
    Thanks so much!
    Dano