Posts

Showing posts from May, 2013

The Art of Naming

Image
1 2 3 4 5 6 7 8 public class Handler { private String data ; private String temp ; public int c ( int a , int a2 ){ int result = a + a2 ; //... Why is Naming so important? Because its a matter of Quality. Naming = Readability = Understandability = Maintainability = Quality. Good Names make your code readable, which is an essential feature for every person that has to work on it, including yourself. Soon after written, you'll forget about the details. Getting into it and understanding again can be tough and frustrating. The right Names will redeem yourself and others from those barriers. You'll might think for yourself: "No!!! I don't have the time to make this all clean and perfect. I just have to get the thing done as fast as possible, and it's no problem because i won't have to deal with it after its finished anyways..." - That's just wishful thinking. Software never ever becomes completed. Thats part of it...

Object.setPrototypeOf(O, proto) IS in ES6

This one is a short one, just to confirm that finally Object.setPrototypeOf(obj, proto) made it into ES6 . The section 15.2.3.2 speaks clearly: 15.2.3.2 Object.setPrototypeOf ( O, proto ) When the setPrototypeOf function is called with arguments O and proto, the following steps are taken: If Type(O) is not Object, then throw a TypeError exception. If Type(proto) is neither Object or Null, then throw a TypeError exception. Let status be the result of calling the [[SetInheritance]] internal method of O with argument proto. ReturnIfAbrupt(status). If status is false, then throw a TypeError exception. Return O. Without going into details, the most basic polyfill woud be like this: (function(O,s){ O[s]||(O[s]=function(o,p){o.__proto__=p;return o}) }(Object,'setPrototypeOf')); If you want to go into details, the full reliable polyfill is hard to write down due all inconsistencies across JS engines out there where the __proto__ setter cannot be reused which means it's not po...

Master the unpredictable

Have you ever come to work on a Project that you cant quite overlook? Are Requirements not yet clear or changing fast? Here are some tips to get along. Use Tracer Bullets Don't specify your software to death. Just grab your best idea, and give it a shot. Tracer Bullets are similar to Prototypes with one very important difference. Prototypes are built to proove something, and then be thrown away. They are not intended for real production. Even some drawing on a paper could be a prototype. A Tracer Bullet might get thrown away, but it is not intended to in the first place. It is developed as stable, clean and complete as needed, to use it for real production. A Tracer Bullet that hits its target, becomes a trunk. Develop Leaves first What do i mean with a leaf? Leaves are small exchangable software components or modules, that can be written independently, tested in isolation, and sometimes even run autonomous. They only perform a very specific task, not more. Find the leaves in your ...

Do The Sleepwalk

Image