How to start your new project

I’m pretty sure there are dozens of articles on the web with more or less the same things to say, but I’d like to collect my thoughts on this topic.

The environment

Version control

It doesn’t matter if you work alone or in  team using a CVS like Git or Subversion is essential to work professionally. It’s true if you are working with PHP, Java, Ruby or whatever and it can be useful for designers too. You will not be able to use all of the features of these with images, PSDs, but you won’t have to keep dozens of copies of a design in different stages.

Issue management

If you never used an issue management software like Mantis, Redmine, or JIRA it feels like a big pain in the ass. You’ll see it as a useless thing because you can keep your tasks in mind or on notes. If you ever worked on a project for a customer or on something under the supervision of others for instance project managers without an issue tracker, then you probably noticed that they used to ask questions very often:

  • When will it be done?
  • How is it going?
  • Is it done yet?

This is really annoying, isn’t it? With an issue manager they can see that status of your current work. What are you working on at the moment? Which issues are done? Which one will be the next you will start work on? They will be able to answer these question for them self and they don’t have to interrupt you.

Always choose the right tools

A few month ago I missed this guideline and I started a project with tools I didn’t know very well. I had to write a facebook application, yikes… It sounded pretty easy, the basic idea was that the facebook users can vote on each other. Quite simple. Few hours of work with PHP and MySQL, right? When I registered the new application, facebook asked me about my host. As it was a low budget project I had to use Heroku’s services so I had to choose the hosted language: PHP, Node.js, Java? I choose Node.js and if it is node then store the data in MongoDB. It wasn’t a good idea, I had no deep experience with neither of these and I spent days on figure out how to use these things properly. As it turned out, it would be much easier to make this project with PHP and MySQL, but on the other hand now I have a pretty good understanding on MongoDB, Node.js and the Express framework.

So if you start a new project, always take your time to try to find out more on technologies available and if there is a tool you are experienced with, then you should go with it if you want to proceed fast. Always try to find the key features in your application and check the tools if you’ll be able to implement these features with them. It is pretty embarrassing when you find something that can not be done after on month of work. You will be able to experiment with new and fancy technologies after you have got a working prototype. Don’t forget, if you want to make money – and your managers always want to -, then you have to produce something that can be sold.

If you’re working in a team, then you should cross-check your ideas with the members. For instance, if you’re start using Ruby in a project and none of the members know Ruby, it can be a great problem for the team if you leave them, because nobody can modify it. That is why your CTO won’t be always happy when you try to get permission to use fancy things.

Define the milestones and the path leading to them

When you start a project – before you write a single line of code – you should understand the goals of the project. You have to find the essential parts and pitfalls of it, so you will be able to choose the right tools and be able to avoid the obstacles.

What are the Milestones in a project?

Well, it depends on the project. You can say that your milestones are like “Beta, RC, 1.0, …”, but you also can choose “Home, Product list, Search, Category list, …” as milestones. It depends on the granularity. The only thing that matters is to know where are you going. In the hierarchy milestones are the top level. Most of the times, child elements of the milestones are the features, for example a registration form. We say that a milestone is reached, when all of its child elements (features) are done.

What is a path?

I mean the features under a milestone when I say “path”. You have to walk along the path – implement all the features – to reach a milestone.

Reinventing the wheel

There are so many good tools out there, you do not have to write everything from scratch. If you need a framework, then you can choose one, if you need a template engine pick Smarty or Twig, however I prefer to use my own framework because I know everything about it and I don’t depend on updates and security holes known by everyone on the internet.

I think these are the most important things.

Named groups in regular expressions

Today I was reading PHP’s PCRE documentation to refresh my knowledge about regular expressions when I made a discovery. I didn’t know that I could use names for the matches instead of number indexes in preg_match_all. It’s a shame after many years, but somehow I missed this section.

For instance, there is a file name what was made from [document_id]_[year][month][day].[extension] and I want to get these parts, I can do it as follows:

It will produce this:

As you can see, there are our named groups, so we can access them more easily.

LESS compiler for Node.js

There are some rumours at our company about moving our CSS code base to LESS, so I thought I shall look into it. I’m at the very beginning of the studying, but looks cool. I don’t really like to complicate things but I’m getting used to it after Coffee script and now LESS.

While I was reading LESS‘s page I decided that I’ll use it precompiled. I don’t like the idea of using this at the client side and stressing the client’s machine with it, but in development it can be useful because you don’t have to compile it after every change, just reload the page. So I jumped right to the server-side descriptions and I found some poor examples, I spent some minutes with coding and came up with this:

If you have node and the node’s less module installed you should be able to run this. Don’t forget to change the file paths.