HTML5 Zone is brought to you in partnership with:

I'm software developer and microISV, with a lot of passion to technologies.. having a fun writing code, writing blog posts and giving public speeches. For about 10 years of total experince I've been working in many branches of software development, including management and QA. I try to follow and adopt agile practices and signed up for software craftsmenship manifesto. Alexander is a DZone MVB and is not an employee of DZone and has posted 63 posts at DZone. You can read more from them at their website. View Full User Profile

A .NET Developer in a JavaScript World

05.12.2013
| 1368 views |
  • submit to reddit

This is a transcript of a lighting talk I did at #odessajs conference that took place 13 April in Odessa.

The story

Thinking about the things going on inside and around me I realized - I haven't done .NET development for more than 1.5 years now. It's not the first time I was thinking about that, but now it has a bit different perspective.

WTH?

I work in an E-conomic company and about 2 years ago we decided to build a new product.

Till that time we've learned a few hard things: plain jQuery applications are messy, building new shiny products on out-dated infrastructure is a bad idea.

So, we've started with the front-end by choosing Backbone.js as our foundation, later on we've decided to switch our API server from .NET to Node.js.

It appears we got full JavaScript stack on that product and I involved in JavaScript more and more each day.

I thought I know JavaScript

That time I mistakenly thought, I can do JS programming. Sure, I understood jQuery selectors, concept of callback and even why we need 'var me = this;' trick in code.

But the reality was a bit different. Now, listening to podcasts and reading some blogs, I understood that I've been to 'classic' trap on C#/Java developer switching to JavaScript. Languages and frameworks requires time to learn.

Long hard way of learning

I had to spend the time to learn new stuff. I would say the best source of information was the code written by my colleagues. We have great team, so initially I were just reviewing the code following some patterns. I also spent time of peering famous OS projects like underscore and Backbone.js.

JavaScript Good Parts, opened my eyes on few important things as well.

There are 3 aspects that changed my mind on JavaScript.

JavaScript is dynamic language

Let's be clear. If someone in 2003 tell me I'm going to program dynamic language and will be happy about, I would never believe that. I was programming C++ and truly believed in types. Types as I was thinking is only way to tackle complexity of software.

Even though, I still think about some advantages of static vs. dynamic languages, my opinion has changed radically.

Dynamic languages are great. I feel I more solve problems rather than designing types (or usually hierarchy of types). Consider that, instead of thinking about the name for next "ProxyAbstractFactoryManager" I'm writing functions that do stuff.

Frictionless development

I was compiling applications for whole my life. Just to run some simple thing I need to compile and link. It's usually not a problem at all, but depends on project infrastructure it can take a lot of time. Sooner or later you start to hate builds.

With JavaScript application, you simply should run it. It starting fast so the gap between "write the line of code" and "check the results" became very small.

Instead of heavyweight IDE's I became Sublime Text 2 user. After years in VS you simply could not understand how to write code without IntellySense. But practice shows it's really possible.

Node.js

To be honest with you, I was very skeptical regarding Node.js initially. But again, practice showed different results. It's been proved that Node.js is very suitable for our product. We are running API server on Node.js and it performs really nice.

Later I started to learn what Node.js platform offers and I was really surprised with it's abilities.

CommonJS style of writing code started to make sense. Namespacing problem is solved, so you can build big applications there.

I have to add that Node.js is a significant Open Source player. Everything you get by npm is open source, you can check the sources if anything unclear. Most of Node.js modules are hosted in github, so even if you experience issues you can fix it.

Conclusions

JavaScript is awesome. I like the experience of JavaScript programming so far. Whatever you do, front-end or back-end you stay in one "language context". I would not call a huge problem, but usually context switching from one language to another can take something.Picking up technology for next side-project or quick hack I'm selecting JavaScript.



Published at DZone with permission of Alexander Beletsky, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)