Visualizing sorting algorithms

Currently, I am going through course JavaScript Algorithms and Data Structures (which I highly recommend by the way). For me, one of the strongest parts of this course was Colt ability to explain everything, not only how to implement code, but also what exactly one or other part is doing. Among all instruments used there, one of my favorites were ones, that visualize what is happening, when sorting algorithms are run.Continue reading →

Inexact vs exact flow object types: spreading

If one wants to add flow annotation to object type and reuse some of the types, that was annotated in another object type, it can be done like:

[gist https://gist.github.com/Kiwka/58af12196f5c2fc2a82fcba5eb5fd64d#file-inexactobjectannotation-js /]

However, in this case, not all will run smoothly here, as if to check age will accept, not only number type as valid but other as well.Continue reading →

Debugging tips – console.trace

From my observation, debugging is the best-kept secret of the developer life. Everyone is doing quite often, some are doing it even every day, but rarely anyone is talking  (not moaning :)) about it publicly. Have you seen great tech talk at the recent conference, that has addressed some debussing techniques or anything that can be used next time one should find a way to fix the bug? If yes, please, please, please, share it in the comments.Continue reading →