If You Build Software: Watch This

Filed under: Development — Randy @ 1:45 pm 5/16/2007

I’m a huge fan of Douglas Crockford, this video is well worth your time to watch or listen to in the background: Quality. This is a great story about software development history as well as problems that you might be able to avoid.

Do Yourself a Favor: Learn Regular Expressions

Filed under: Development — Randy @ 3:32 am 5/10/2007

The first programming language I learned was Perl. Perl was easy to do many things with and it also allowed me to manipulate text strings. Except that instead of doing it the easy way I would often write very, very convoluted chunks of code in an attempt to get the data into or out of a string that existed. I was afraid of this monster that they called RegEx, or as it is properly known: Regular Expressions. Regular Expressions allow you to write an abbreviated syntax structure that will look for matches and patterns within the text string and then, depending on the function you’re using, do a comparison (match) or do a text replacement.

Just last night I was trying to manipulate a URL and get one parameter out of it, the view parameter in JavaScript. instead of a bunch of indexOf calls and burying myself in lines of code I got the variable with one line of code:
tempStr.replace(/(^.+)(view=)([a-z_]+)(&.+)/, “$3″);
JavaScript syntax allows you to use the forward slash to wrap the beginning and end of a regular experssion, then I used a group of regular expressions within that text to find the view value. Upon finding the match I printed out the third pattern that matched into a variable that is returned (patterns in this context are grouped with parenthesis).

You can learn more about regular expesesions here, but I recommend you find a tutorial for using regular expressions in the languages you code in.

I Hold Me Responsible

Filed under: General — Randy @ 8:27 am 5/9/2007

Apparently 2.5 days out of a year, if you add up the seconds, you’re waiting for slow loading websites. I don’t know where this number really comes from. I wouldn’t add of my total time for that, but I’m on broadband and don’t surf aimlessly. When I design a web page or a web application my goal is to trim out the fluff and to get you, the user, on your way. You don’t need junk, you need working solutions that get you what you need. Sure, I want it to look nice, but I don’t write pages that make you mad at me because I’m holding you back.

As a designer, a developer, an ISP, a host or whatever: do your part to reduce this number.

Software Architecture Tips

Filed under: Development — Randy @ 3:22 pm 5/8/2007

I’m probably not the worlds foremost expert in software architecture, but I’m the son of an engineer. A civil engineer. That is to say that he’s nice to most people, and it shows in his engineering, too. Software architecture is something that I understood the least when I was first learning about software development. At that stage in the game I needed to learn how to write code and didn’t grasp the critical nature of designing the code in such a way that I didnt’ have to rebuild the wheel every time I did something. “Hello, World!,” meet impulsive idea man.

As time went on and I stubbed my toes on various ideas (accidents can lead to learning) I learned more by learning how not to do things. I didn’t go to school to be a software developer, I majored in history. As the infamous quote goes, “Those who don’t learn from history are doomed to repeat it.” Boy, did I repeat myself. Eventually I learned more about how to do things the right way and more recently I learned more about Model/View/Controller (MVC) coding. Here are some architecture tips I’ve learned, hopefully you’ll find them helpful as you learn:

Consume Open Source Code
Open source code, such as WordPress, xinha and the YUI code are places I learned about software architecture - free, and usually commented. See how and why things are done. Don’t just learn a technique, learn why to use the technique by trying to see why the open source software used a technique. Check out Sourceforge.

Learn Existing Code Libraries
If you have the chance learn some coding libraries and their functions. Often you’ll find that a code library is useful in more than one place. Matt Mullenweg has said that he re-uses components from WordPress in other projects. If your software architecture doesn’t fit with these libraries then you’ve probably got more thinking to do about your architecture. Closed systems can be a headache. I’m currently learning the PHP Cake library, and that’s powerful!

Build Your Own Libraries
Build your own libraries. No, not huge open source libraries necessarily, but find snippets of code that you can re-use as needed. Know your coding style and know how it will work for you. When you’re designing the structure of your code, these libraries will play a role in this.

Go To Libraries
Libraries house books. Free for you to look at and often for you to check-out and take home to learn from. Don’t underestimate the power of a good paper, physical book :) Software architecture is going to develop over time and you’re learning and reading is going to grow if you invest in it. it won’t happen by magic (usually).

Learn What Optimized Code Looks Like
I have studied optimized coding practices for every language I’ve learned. In PHP I learned about commas as concatenators, various loop type speeds, and of course MySQL optimization to help keep queries fast. Your code architecture will need to employ these things yourself.

Join a Community
Find an online forum or email list that you can participate in. You’ll quickly find out that you, too, can help others learn. This will most certainly help you develop better software architecture practices.

Microsoft and PHP (via a Yahoo! Merger)

Filed under: Development, Links — Randy @ 1:44 pm 5/4/2007

Matt Mullenweg asks, “If Microsoft were to buy Yahoo, I wonder if that would have an impact on PHP?” I think that everyone will have to say, “Yes.” on some level. There are two ways that this impact could take place:

1) PHP is challenged to compete with other languages in the market, that’s either ASP, Ruby, Perl, Python or some new language that comes around. JSP could be re-written to be easier (ha! Like that’s going to happen). PHP is going to be challenged by these languages, at least one of which is tied into Microsoft.
2) PHP will be challenged because Yahoo! needs more of something to deal with their demand. If Microsoft is after Yahoo! for revenue/ad related things then the engines running the machines will be left alone over time. People will adopt PHP (or whatever language) because of its functionality. I personally think that WordPress is a compelling reason to use PHP, Yahoo’s use of it is not as strong as WordPress’ because its easy to get your hands on the source and learn PHP from it.

Yahoo! has a commitment to PHP at present, unless Microsoft dumps their entire staff in charge of making Yahoo! what it is, its going to be a slow transition if it were to change over to .NET/ASP. Industry leaders in the web development/software development community are at Yahoo! working on code and making choices, if Yahoo! loses interest for them they’ll move somewhere else and employ their killer PHP skills there.

PHP libraries like PHP Cake (which I’m using for a new project) make using PHP fun and easy. I think PHP will be around for years to come because of what it is: fast, easy and powerful. I hope Microsoft causes PHP to change, Yahoo! or not. I also hope that Yahoo! opens up more than their YUI library so that coders can learn PHP stuff from them as well.

Thanks Matt for the interesting question!

« Previous PageNext Page »