1. order by priority
  2. quality
  3. code readability is more important than speed of work of that code
  4. block modularity
  5. flexibility
  6. usability
  7. minimalism
  8. should be things, which are needed to 80% of users
  9. less options
  10. split big tasks into smaller ones
  11. do not focus on competitors, just do what you want to do
  12. important is not to lose the idea during the development
  13. product should solve problem
  14. beleive in what you do or product will not be good

about non-sense micro-optimizations:

As most of us, I am tired to read blog posts about non-sense micro-optimizations like replacing print by echo, ++$i by $i++, or double quotes by single quotes. Why? Because 99.999999% of the time, it is irrelevant. Why? Because 99.99% of the time, you'd better install a PHP accelerator like APC, or add these missing indexes on your database columns, or try to avoid those 1000 database requests you have on the homepage.

print uses one more opcode because it actually returns something. We can conclude that echo is faster than print. But one opcode costs nothing, really nothing.

I have tried on a fresh WordPress installation. The script halts before it ends with a "Bus Error" on my laptop, but the number of opcodes was already at more than 2.3 millions. Enough said.

Premature optimization is the root of all evil. Donald Knuth

Unprefixed property should be the last

.style {
    -prefix-something: awesome;
    something: awesome;


Web-Development - General Notes

Do not add css styles and javascript handler for the same class

Separate css styles and javascript logic for not making your code extremely tight coupled.
For example add these 2 classes for the element: ".navbar-search .navbar-search-action".
And then add styles for the first one and bind javascript events for the second one.

Do not use ID selector

Bad thing about it that you cannot use same ID selector twice on page and you cannot use multiple ID selectors for the same element.

The only case you need to use ID for is the label-input connection. The other cases better to replace it with classes selectors.

Keep the same naming in BE, FE and DB

If the field in db was renamed from active to is_active, then rename this variable to is_active in FE and BE too. This will save you a lot of time while developing and maintaining the app.

Avoid too much of abstraction

It is much better to have show_state() and hide_state() than toggle_state('show')

No code = No problems

Less code means less bugs, less time on maintenance, less time to found the issue, little bit less time on execution.

Leave a Comment