When creating web applications, a lot of time is consumed switching back and forth between the code and the application itself. What if there would be an application that would refresh your browsers automatically?
Did your mind needs to stop to read (taken from ckeditor source):
Well you're not alone.
Stop using double negations, even if your code looks "cleaner", and refactor them to be single negations.
A simpler rule is never use negation variable names, so you don't run into issues like this. So don't use names such as: "noElementPresent", "dontRemove" or "notExisting".
For the previous example instead of "don't remove" go with "keep element", "keep", or something along those lines. Just search a thesaurus if you can't find a word.
Notice how readability is just so much better.
A very used paradigm when it come with dealing with errors is the try/catch construct.
I've seen advanced programmers actually throwing the message itself as the thrown object, in code that I will simplify as this:
Unfortunately this is a problem, since we got the error message, and it looks good in our 7 lines of code. In reality if our program was a bit bigger, our message was now meaningless, since we would need to find from where the thing was thrown. If the code that can cause the catastrophic failure is called from multiple sites, this only adds to the complexity.
This gives the output:
So please always use Exception objects and avoid space ship tragedies.
Do you remember that there was a time in Windows when all the UIs used to have the three magic buttons: 'Ok', 'Apply' and 'Cancel'?
My brother used to tell me, man, it's easy to implement this, since 'Ok' becomes only:
And here it is (almost) the same reminiscence in Eclipse (org.eclipse.jface.preference.PreferencePage).
Oh man, how times have changed... oh wait.
PS. If you want to apply the changes, and keep the dialog open, because you want your users to be able to preview the changes, just make those buttons: 'Apply' and 'Close'.
Good, let's see it:
Sourceforge? Was it written by dinosaurs? I remember dinosaurs used to use Sourceforge and put their stuff there. T-Rexes typing with their tiny hands, were the main committers using it, but since poor T-Rexes went away, no one replaced them. Come back T-Rex. We miss you.
Fine let's see the Rhino-based JSDoc.
Notice the vibrant community of 2 committers, and yet starred by 841.
And then finally:
Let those numbers sink in: 51 contributors, last commit 17 hours ago, 2593 people starred it.
And still has Rhino support in case you missed it from v2. Completely unrelated quote:
Let it go! Let it go!
The one to rule them all. The browsers that is.
SharpKnight is an Android chess game.
MagicGroup is an eclipse plugin.