For last few weeks I have been exploring a relatively new language (about 2 years old) Crystal (hasn’t hit 1.0 as of today). Today I am going try to explain things I have learnt during this time.

Crystal is Ruby inspired language hence it has Ruby like syntax that we all love. It is a statically typed language, so you won’t have runtime bugs since compiler will catch type related bugs during compilation.

Crystal is very efficient in compiling code to native code which can be distributed as binary.

Crystal has a modern standard library which has implementations of markdown…

Pattern? What’s a pattern? Tom asked.

Well a pattern is a general solution to a specific problem in a particular context.

And what about design pattern?

A design pattern is a general solution to a specific recurring design problems in object oriented systems.

And why would I use a design pattern?

Design patterns are rigorously tested, proven development methodologies. They can help speed up the development process. Reusing design patterns can reduce chances of introducing bugs in the system.

Design patterns are independent of programming languages. Since they are more or less general solutions, they can be implemented in any programming language.

So my question to all you Tom’s now is

Image for post
Image for post
design patterns

July 8, 2015

If it stinks, change it.

— Grandma Beck, discussing child-rearing philosophy

A way of thinking about writing a good piece of code is to remember that not everything out there is good.

Not all language features will help you write quality code. Some features may in fact be considered harmful (a code smell) and are hence discouraged.

Image for post
Image for post

OK, let’s rephrase in a more appropriate context.

With great power of language features, comes great responsibility of deciding what not to use.

Let’s consider the case of getters and setters. They are common in most languages. You might say

July 8, 2015

To design is difficult. It’s not like most everyday problems you might face. To learn to design a dummy house for instance, might require knowledge of good placement of windows and doors. Better design is always an evolution.

Design is a problem that is always meant to solved from bottom up. You pick a starting point and continue to build on top of it. It’s a practice and you only get better at it by making mistakes. Mistakes are always supposed to be part of design.

I learned that making assumptions about design might lead you to place you can’t easily comeback from without making drastic decisions.

Originally published at

Vijay Dhama

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store