ASSERT, ASSERT and ASSERT. Also, always ASSERT !

Putting assertions in your code was always VERY important.
I constantly find its importance in my coding.
It is very important to always assert your variables\conditions along with the testing it ( 'if' statement ).
Also, another common use is in an algorithm. it is important to assert different conditions which might define a state at a moment, a state which I know it should be false\true (when i mean a state i mean a condition composed of multiple variables, variables which might not be in the same scope but I expect some specific values).
i am having situations where while coding, i come accross some asserts which make me say "wtf, how did that happen ?" and then i discover that the algo has some issues which were not obvious due to complexity (or my fatigue).

Comments

Popular posts from this blog

IconFont2Code, my open-source tool in order to view icons in font files and create C# class with the glyph constants

Problems

Xamarin.Forms XmlnsDefinition attribute: All of your namespaces become one