My Blog

Here you can find my private notes about programming that I wanted to share with you. Feel free to filter based on the topic you want or search for something specific.

    Is there a naming convention for TypeScript interfaces?

    The TypeScript language was created from Microsoft as a super-set of typed-rules for JavaScript. The language contains features that one finds in C#, something that is completely understandable since the inventor of TypeScript also invented C#.

    TypeScript provides interfaces that are used for two main reasons:

    1. Standardize/ Giving a type to an object, by defining the properties that an object contains.

    2. Define a structure of properties and/ or functions that a class has to implement. Doing this way you can define multiple implementations that implement the interface. In this case, the interface works as a contract (known best practice term from C#) that the classes have to respect.

    Read the complete article

    Five common error messages in Angular.js and how to quickly solve them

    When using Angular.js and something goes wrong with your code, the first place to look for an error message that came from your JavaScript code is in the console of the browser debugger that you use (for example Chrome developer tools or IE F12).

    In the following list you see a collection of common error messages that you will most probably come along when you implement web application with Angular.js. Together with each message you see a quick solution to fix your code:

    Read the complete article

    What are the different types of user interface prototyping, what are their advantages and when to use each of them?

    When dealing with User Experience and user interfaces you often have to do with prototyping an idea or a concept, before going to the implementation of it. Doing this way you want to get a first impression of what you are about to implement. Prototyping can be divided in two categories:

    1. Low fidelity prototyping: You create sketches, also known as wireframes, of the user interface you want to program. For creating these sketches you use either a pen and a paper or one of the many available software to draw the sketches digitally. This software can either be a professional one (Photoshop) or a more pen & paper like, like Balsamiq.

    2. High fidelity prototyping: You implement a small part of the future application with a limited number of features. The application is testable and you can navigate from the one page to the other. Here the business logic plays a secondary role, the user interface the preliminary. A high fidelity prototype could also be considered a collection of Photoshop designs, each representing a page of your application, that are combined together to build a fake navigation from the page to the other.

    Read the complete article

    How to avoid wrong values in calc() rule inside a less file when minifying your CSS files?

    The CSS calc rule helps you to do mathematical calculations in your CSS files. For example you could calculate the height of a div element based on a set of less or sass variables. But what happens to the mathematical expressions inside the calc rule when your code gets minified for production? The less engine will calculate the expression inside calc(…) during the minification process and thus calc will contain a wrong value.

    Read the complete article

    The correct way to do word wrapping (breaking) by using CSS rules

    You often have to deal with words that are too long and they possible do not fit as a whole inside an HTML element. In such cases you have to break the word and put the part that does not fit in the next line. On the other side, you do not want to always fill the lines of an HTML element with text, which means that you do not want to break every single word, but instead you only want to break the words that are wider than the width of the containing HTML element.

    Read the complete article