Posts

Showing posts from July, 2012

Of pointers and references........

About two and a half years ago, i would have never imagined myself writing anything about pointers or let alone be at a stage where i am no longer intimidated by them, but here i am blogging about using them. This is after almost 2 years of disliking it......well 2 years to actually get the hang of it and use them properly and honestly it now makes so much sense and i get an idea of the power of unmanaged code (of course when done properly). Coming from the managed world (Java, Python and to some extent C#), it was quite a task for me to get grips with managing memory, even now i won't say i have mastered the art of memory management in C++, but i am reasonably comfortable with it. The point i am trying to make is, watching out for memory isn't second nature to my programming style....I still need to be on absolute alert when i am writing any C++ code, especially when i am passing pointers around the code. However having said all of that, writing some C++ code in vim,...

Async (Non-blocking) programming with Java

Following on from my last post, where i explore doing Async with C++0x, in this one i try to accomplish the exact same thing with Java. So first of all, before i say anything else, to me Java is first love and to some extent I still love the idea of writing anything in Java. However there are things that i have come to appreciate in other languages such as C++. So in case you are wondering, why the disclaimer? well when trying to do some Async stuff with Java, i found it to be a bit more complicated then what it was in C++. I honestly never ever imagined myself saying this, but yes it is true, i tried really hard to blame it on the tutorials that i found or my own thinking, but i must accept it for what it is. Problem Given how boring my problem definition was in the last post, i will try to make this more exciting in this one. So say, we have a shop and we are counting the cash at the end of the day to know how much we earned. A colleague will provide some help, by counting t...