Thursday, February 2, 2017

learn programming (or to become a programmer)

Programming is an interesting exercise. Sometimes at work, I discover a problem. And a good chunk of my time goes into figuring out a solution to fix it. When I discover a challenge in the piece of code I am writing or the solution I am implementing, it becomes more exciting.

But programming isn't everyone's cup of tea. There are good many articles and forum posts which say what the programming profession is and if programming is the right job for you. Here are few links to that effect:
  1. http://www.makeuseof.com/tag/6-signs-meant-programmer/
  2. https://www.theguardian.com/info/developer-blog/2011/oct/07/programming-developer-journalist
  3. https://www.youtube.com/watch?v=0MJUpEkxteE

I highly recommend you continue reading this post after visiting the above links.

Here are some less-mentioned guides about how to go about learning programming:

1. The more you realize what a computer actually is, the more comfortable you might be with learning how to write programs. Its not really writing code or compiling programs...it more of figuring out the answer to why write programs?

2. It also helps to think of a computer as an IO (input/output) machine. It is designed to accept certain kinds of input, do some processing and calculations, and output to a set of destinations. The most common of destinations is a computer terminal (or a computer monitor).

3. Get a general sense of how software works? Is it interactive? Does it require human interaction? If the software does not need human interaction, and it works, how the hell does it work?

4. Its not about a language, or the best language. The language is only a vehicle for you to get programming. The language alone doesn't tell the computer what to do. But it is important to figure out what the computer is capable of...and how that language can achieve all that. Step 3 is sort of important here. As you do this, you slowly figure out how a computer actually works.

Now if all this sounds like something you are not bound to like...then don't get into programming. Its not your thing. There are loads of other career choices to make - it need not have to be related with what you studied in college. But it has to be something you enjoy doing.


If you are a novice programmer probably the best place to get started might be
CodeAcademy. Most of the programming languages come with a developer environment (or an IDE). Here you can learn any language without that hassle. If you are just starting out, keep the next thing as a to-do item at the back of your mind...probably when you achieve a certain level of proficiency writing simple programs you can have a go at this: find an answer to what makes a web application different from a desktop application?

All the best.

Tuesday, January 3, 2017

konva js - a fork of kineticjs - a javascript 2d graphics/animation library

I've been exploring KonvaJs for a while. And I like it. I've done some pretty awesome animations using this library too.

https://plus.google.com/+ArunJayapal/posts/BRqib53sHK6
http://jsbin.com/fulujeceti/1/edit?js,output

The more you use the library, the more you'd want to make a custom shape. And there is a solution for that. However, that talks about manually drawing shapes using the 2d canvas primitives. But, you'd also want to re-use what is already offered by the library. Konva docs currently don't have a say about how to do this.

I may have found a hack. It may not be elegant when you think it. But it will do...

Here is my git repo if you are interested in code for an example.

https://github.com/deostroll/konva-graph-generator

Ps: you'll need npm and gulp to run it.