Pages

Thursday, August 14, 2014

Why Codecademy is cool

I recently finished the Python course on Codecademy and I'm thinking on how to say thank you for it to them. Not just because the site is great and I already found the next course (as a back-end developer I need to practice front-end things at home to not be a specialist of one thing) to continue, but by their approach to letting me to learn python on very entertaining and easy to understand way. I see how much effort invested into the site just to provide free material and how professionally designed the page and the learning flow. The Pythong material is well structured and introducing step-by-step from the basics to the real pythonic things. And you get a chance to write a game during the course!
What I liked in the Python lessons as a notorious Java developer?


  • The for-each loops. Especially when I can add an enumeration to track the index. In java if you need you had to avoid for-each and use regular index based for.
  • Else case at the end of the loops. That's a brilliant idea to separate the implementation for the successfully finished looping or the cancelled ones.
  • The in keyword. Python has a more generic approach to check the existance of an item in a collection/dictionary/array/etc..
  • List comprehensions. I love to populate data in a readable, one-liner format

I think I have a basic knowledge about some of the language elements (first steps :) ) and I need to move forward the more complex topics. Not only on language level, but I'd like to see Python as platform to deliver a complete solution to a problem. I already bookmarked some Youtube videos about the advanced topics, but I hope I can find some blogs or tutorials about how to start a Python project and end up with a successful delivery.

Wednesday, August 13, 2014

Beware of outdated books

I'm really amazed when I found on Amazon a very old book from Martin Fowler: Patterns of Enterprise Application Architecture. I have this book and I rechecked my assumptions and found this book is badly outdated. I mean most of their suggestions and patterns are already implemented in several frameworks (spring, spring-mvc, hibernate/jpa, etc..), the current architectural solutions are stepped over on it, but the price is still high. Maybe they keeping them for the collectors or multi-millionare developer veterans :) 
Currently the IT sector is growing quickly and lot of newbies are arriving to train themself to the next Peter Norton (Is anyone knowing him? :) ), Larry Page (better known) or Guido van Rossum. Thanks to the internet, voluntarism and the open source community we can learn almost everything for free, but some of us need to buy some paper books to erect a statue of our learning efforts.
I don't really know what should Amazon do with these books, but it alerts me to read all reviews carefully even if it written by trendy/famous authors to avoid traps like this.

Sunday, July 6, 2014

My impressions about 97 things that every programmers should know book

Yesterday I finished 97 things that every programmers should know book in the bathtub (hehe :) ). This is somehow a bit sad thing, because I really enjoyed to read ideas from experienced programmers and the thinking on how add these things to my daily routine.
IMHO this is not a one time read only book and I surely get it from the bookshelf in the future often just to pick a random chapter, because you can't memorize all useful thoughts after the first time. If I have to pick my current (surely changes in the future) top 5 chapters I would list these:

Chapter 82. Test While You Sleep (and over Weekends)

Since long time I felt my PC in the office is wasting the time and money when I'm away. I mean the developer machines are strong enough to help the daily automation with their extra capacity during the absence of their owners. When do my holiday leave, my machine can be switched off to do nothing, but why I can't offer it as a free resource like the Amazons on-demand instances to help my colleagues work with it's extra capacity? My dream is a so automated environment when we can handle ALL available machines in pools and offer them several roles based on their current status.

Friday, July 4, 2014

Algorithmic challenges - if it works thats not enough.


I recently started to solve problems on CodeEval thanks to my colleague's recommendation and suddenly recognized the enjoyment of problem solving. After the boring daily routine it's a really unique and refreshing feeling when your brain starts to warm-up again.
After solving few easy problems I was very proud, because it worked! But I very quickly recognized a serious issue with my code: it just works. I had an input that I transformed to the output and submitted to the site as quickly as possible.
The code was ugly. Really. Like my first Borland Pascal solutions in the high school and I felt some shame for it, so I said to myself: calm down cowboy and think on it what do you want from this? I was already seduced by the world of algorithmic challenges (I don't no why not started it earlier...), but I had no other goals with my code than to fulfill the challenge and I almost missed a good opportunity to learn something.

Thursday, April 10, 2014

Performance of a mocking framework

Few days ago came in my mind the idea to measure the performance of the mocking framework used here. I was curious how it affects our unit tests' running time and how can we squeeze out some extra performance from the build agents. I created a basic measurement code with low amount of iteration steps (to imitate a medium sized codebase) and recognized we are in the world of nanoseconds. From this point all the measurement is just about some competition between the frameworks and no reason to switch between them just to make the test run faster.

I tested only three common cases:

  • Mock creation
  • Mock interaction
  • Mock verification

Test environment: Core i5 750@2.67GHz

Here are the results



Conclusion:
Easymock dramatically overperforms Mockito even it needs a bit more coding in some cases, but the difference is not changing the game. You can use any of them without worrying for their performance

The code also available on GitHub