Learning a programming language can increase your productivity

php_iconDid you know how much faster you could work if you’d learn a language like PHP for example? It is not that difficult and lets you automate some tiresome and monotonous tasks. If you want to delete every third comma from a sentence for example you would have a hard time using search and replace, but a simple PHP script will do it for you in a flash.

I started developing these little snippets for myself a while ago and I have quite an arsenal now. I mostly use it to help my wesite building work though, but a lot of milage can be obtained by “everyday” users as well. If you don’t plan on going into website development the area in which you will benefit most is text manipulation.

Years back when I didn’t even know what PHP was, I had to do a lot of boring and unnecessarily long work finding bits of text, deleting it, copying it and so on. Not all of it, but a lot could have been automated had I been aware of PHP. The problem with any tool you can find for this is that it won’t be flexible enough. The reason these tools are developed is that people need the services it offers in masses. However, how many times have you tried using an app and said that it would work if only one small detail was different? Now you’ll never have to tailor yourself to an app, you can do it the other way around, read on to see how!

Ok, that last bit was a little misleading, I won’t teach you PHP in a short article, but you can study it yourself easily. You will basically need two areas of PHP, string functions and looping (plus the very basics, like variables and arrays). String functions will let you manipulate text in different ways, like finding if a string can be found in it, deleting the first “x” characters, counting the length of the string and so on. Looping will enable you to cycle through lines of a list, words in a sentence, or whatever you need.

I actually learned all I know about PHP online, so I see no reason you shouldn’t be able to do that yourself. Luckily you won’t need all the web stuff behind it, purely the language. I can recommend two sites, PHP.net and Tizag.com. Both are extremely helpful, although I recommend starting on Tizag, which is more of a tutorial, while PHP.net is more of a reference, it’s actually the manual to the PHP language. that sounds scary, but once you have some very basic understanding it will all become clear, plus it features a lot of examples.

I will be posting some example later on, if you have your own PHP scripts that help you work let me know and I’ll post them for all to enjoy. You can also show us your Phython, js, etc. skills in the same department. I realize PHP might be a bit unorthodox for this, but since I primarily work in this area, it is easiest for me. Happy coding everyone!

7 Responses to “Learning a programming language can increase your productivity”

  1. Rarst
    19th of December, 2008 at 16:05

    Can’t say anything about PHP, clueless at it (need to read some book or site).

    However I highly recommend AutoIt for usage model you are describing. It’s programming/scripting language, originally made for Windows automation, easy to learn and with excellent native documentation.

  2. Daniel Pataki
    19th of December, 2008 at 17:42

    PHP is used to build standalone sites, Wordpress is built on PHP for example.

    As I see it AutoIT is more of a macro engine than a type of script I was talking about. For example, you could tell your PC to go one line down, two characters left, then copy, paste and delete the rest, and then do it 3 billion times. Is it also able to do search and replace?

    What I like about PHP is that you can customize it a lot. I can tell it to ask me if its ok to delete in various cicumstances and so on. That being said, it is not actually made specifically for this, but I think it’s not too hard to use.

  3. Rarst
    19th of December, 2008 at 19:52

    @Daniel

    PHP is closer to web development, AutoIt is closer to interface automation. But it has regular expressions support and plenty functions to work with text. :)

    For example I have made AutoIt program that generates software updates RSS feed for my blog. I only input program name, version and links and app erases old item from feed and writes new item in, with current time and rest of stuff.

  4. Daniel Pataki
    19th of December, 2008 at 21:28

    It is a good app, but I would probably still go with php. I would do what you did with a timed PHP script and some XML tags, so it would all be done automatically.

    I guess that’s a bit unfair though, AutoIt is a great solution for everyone who doesn’t know how to code :)

  5. Rarst
    20th of December, 2008 at 09:42

    @Daniel

    I am big fan of automation but I highly doubt you can do that for feed with 70+ (and raising daily) software titles. :)

  6. Daniel Pataki
    20th of December, 2008 at 10:16

    I think I misunderstood you a but, I was thinking locally, on second thought you mean fenerating a feed by inputting other people’s program names and so on. In that case no, I couldn’t do it any other way :D

  7. PHP Tutorials
    25th of April, 2009 at 21:04

    Very well written post however, I would recommend that you turn the No Follow off in your comment section.

    Keep up the good work.

Leave a Reply