More fun with Jasmine, Sinon and JavaScript

By Kenneth 'RabidDog' Clark at January 26, 2012 22:48
Filed Under: Code, JavaScript, Test Driven Development

Once again delving into front end JavaScript development (which I might add is not all that fun Sad smile) I have started to gather a few tid bits on good sites to have a look at. Before I post that I want to make a few points on the whole JavaScript world and why I find it to be so annoying to work with.

 

A few general trends I have noticed in the web development world is that the idea of using solid architectural practises is often undermined by the need for fancy front end user experiences. This leads to a very dangerous situation were we sacrifice the integrity of backend services to facilitate fancy front end experiences. This being said, I must admit, that I do like the trend developing in the JavaScript development community to implement test cases. Lets hope this trend continues!

 

The one thing that really, and I mean REALLY, frustrates me around the JavaScript language is the lack of structure. While this might be a plus for some people, it is highly frustrating me. Why has the ECMA specification not allowed for a simple import function? All other major platforms and languages allow you to import reference files. Yes, I know you can merge them, minify them and then wrap them in cheese but why should you have to? I know that this decreases HTTP traffic in certain instances but it is a pain in the rectum to develop for. Some sort of import directive is long over due in JavaScript. Why should my HTML pages contain script reference tags? This doesn’t fit in with the view knowing nothing about the application layer. With unobtrusive JavaScript becoming big this is a serious flaw in the design. I know there are ways to get round all this but all mechanism involving referencing files is contrived.

 

That single word sums up my feelings on JavaScript development, it is contrived. That an the lack of support by any major IDEs is also painful. Yes, you should know how to do this without the help of an IDE but that is like telling a dentist to use a handle drill because an electric drill is too helpful.

 

The lack of standards regarding engineering practises in JavaScript, the custom JavaScript engines found in all major browsers and a few other things still make JavaScript development a “dark art”. I take my hat off to good, productive JavaScript developers, you guys truly have a gift. I am also left wondering who long it will be before JavaScript grows up.

 

Anyways if you looking to get into the whole JavaScript TDD and MVC boat I would highly recommend that you check out a fantastic set of write ups by Jim Newbery over at tinnedfruit.com.

 

http://tinnedfruit.com/2011/03/03/testing-backbone-apps-with-jasmine-sinon.html

 

Well here is to JavaScript growing up!

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading








I am South African. Always have been always will be. I love my country. I love my wife and two children.


I also really enjoy solving problems. I currently work as a Software Architect exploring new solutions for business problems. Having been round the block a few times I enjoy showing new developers how best to solve problems, how to find answers and how to approach solution development.


In my spare time I enjoy riding my super bike, training in Systema and horsing around with my family.


Month List

Visitors

Twitter Feed

20. February 21:10
@telkomsa saying a pending R4.2 billion fine could sink them, I say sink them! Tired of paying for (no) service.

19. February 22:39
@telkomsa congratulations! This is a new record regarding no/intermittent service! Just over 2 months tossers! And I still pay for it

6. February 18:01
Unit tests don't check if code works. They PROVE the code works!

12. January 23:34
@Annaling horrific. People like that should face sever punishment. Unless of course they tried to find the cat :(