Posts Tagged performance

Writing better (performing) code..! What is that?

What is good code? The one which is following best programming patterns or the one which just does it's job simple what is required?

Better Code

Writing a better code everyday is every programmer's job and dream. A Programmer should learn from his past projects and experiences every time he start or initialize with something new. Whether it is using Patterns to solve common problem or be it writing reusable generalized code.

When it comes to writing generalized code/solution the programmer/developer has to think from wide perspective about the problem and divide the solution in a way that it could be used in other alternate situations which are not seen as of yet but could arise in future.

As programmer gains experience he learns from his experience what works out and what not in various situations. Experience teaches a Leader/Programmer by problem. The more no of problem one faces it helps him learn faster by solving them. It highly depends on the kind of work/project (enviornment) one is dealing with..!

Performance Tuning

Recently Vance Lucas wrote on his artical that early performance benchmarking is a disease but actually it is not really. I believe it depends on the kind of project you are dealing with. Although his post has targeted my one of the PHP Performance Tips artical which was related to "Writing better code with PHP... although some of them might not be useful with newer PHP versions but it does really matter.

But the question is if you/clients are more concerned about the performance which in most cases will be than it is good to start thinking about Performance from the day one. I know about firms/companies or clients looking at the Language/Tool/Framework benchmarks before taking decision on which tool/language to choose for the Project. This approach is better than crying after spending time, efforts and money on it.

Actually no one likes build a software which is great by architectural design but when it comes to performance it is real dull.

Conclusion:

Although this artical dosn't provide any tips to improve code in any language but in the end I can say that evaluating any code to Bad/Better/Best Code is relative and depends on the criterias and cases you are evaluating with. Work quality is relative to demand. As anytime we can't have good, cheap and fast all together.

Ultimately the Good code is which performs it's job perfectly and is easy to maintain in future. (It includes writing test cases and following proper commenting and everything..)

Readers' comments and thoughts are welcome as I would like to hear from you as well.

Tags: , ,

PHP: Performance Improvement Tips

This post covers some performance improvement tips by showing merits or demerits of various coding practices in PHP. While developing small websites or projects which are not meant to be maintained for longer period of time it's okey it we don't care about all this performance improvement and so on. But while we are into the development of some product or project which are going to be maintained for longer period of time then it is required that we take care of small things from the beginning. Initially we may feel that benefits are not drastic but when we have large amount of user base then all small and minor things matters.

In PHP we have always so many ways to do things. During development of PHP as a language, developer community/team added up many functions and features (due to requests..!) in the language and some of them might be redundant, so we have sometimes many ways to solve one problem. Here sometimes due to not knowing what is the best way to solve the problem, we use the solution which we already know or we are more familiar with. Sometimes as a developer we create habit of doing something in particular way for always. Please read on to know whether you are already aware of this tips, which could improve performance of your php application. (Even if it is micro improvement it matters..!) Read the rest of this entry »

Tags: , ,