Blog

Tuesday, May 24, 2011

Recursion in the real life

{Imported from my post in Vstretch blog}

Recursion is one of the most interesting concepts I have found in the software development, when a function calls itself in order to efficiently reach a solution. Most of the models used in the science and technology are based on the real-world entities at the first place, neural networks, artificial intelligence.. For many years now I had the thought of finding the analogy of the recursion in reality.

There are many aspects that are recursive, although your first tough usually doesn't land on those, like the parallel mirror positioned ideally so that one reflects the reflection of the other and the other one the reflection of the other one... But there are two problems with this instance, first that wherever you position the camera (viewpoint) it won't be reflecting the reflection of one mirror into the other, since it is going to be pointed onto one of the mirrors at a time. Second problem is that in the actuality there is no such thing as ideally positioned mirrors, likewise there is no such a thing as parallel lines.

Lizards - by M. C. Escher (one of the most recursive painting known)
As a kid I was amazed when on tv, the cartoon actors where watching TV. I would guess that those could be watching another cartoon on their TV, why not? That's like a wander to a kid -- recursive cartoon!

The best instance of recursion for me has been for a long time and to this day.. dreaming... Have you ever had a dream in your dream?
Think about it, and before you ever heard of  the movie Inception, but when you are dreaming inside your dream, which is the serious second level dreaming. But who restricts you to have another dream when you are dreaming in your dream? With enough imagination that is very possible and achievable.

What's your instance of real-world recursion?

Monday, May 16, 2011

Programmers vs Non-Programmers

{Imported from my post in Vstretch blog}

Buzz words, like: business logic, analytics diagrams, project estimation, cloud computing.. are ones that business people build their career on, managers try to use in most of the applicable and not so much circumstances and programmers try to run as far and hide.. Hide when possible to avoid being trapped into committing to finalization of development phase within certain period of time. Programmers do realize that estimating far ahead of time, committing to the project, that relies on other code you have never seen before is a trap.



All the hot-shot "young" programmers believe that given some time, they would re-implement the buggy modules given, rather than spend tedious hours debugging and trying to make sense of project components, that your managers have bought the sales pitch for. With years of programming comes wisdom, and with wisdom comes realization that you will never be able to sell your top-notch perfect solution that you enjoyed every second developing... Your so-perfect solution with never be able to compete with competitors solutions, since with the really ugly interface and much more uglier back-end they were able to bind a couple of open source projects together, reuse some other components, and within fraction of your development and deployment time, and fraction of the man-hours spent on the project release their solution to the market with the fraction of your price.

Relatively early in my career, Graduate Student Research Assistant was my title. Given freedom to choose what project I want to work on, what results I was pursuing, it seemed I had all the time in the world to convert my dreams into C# lines of code. Armed with resources as time, caffeine and Internet, and thrown into the dark woods of exploring the great and grand world of Artificial Intelligence. Overwhelmed with all the possibilities, I worked on the interface for displaying the algorithms for five months, writing polished and re-usable code, and re-thinking every detail of the project. Needless to say, I never quite finalized the project, although parts and pieces of it were perfection, the time came to move to a "real" job, where everything is much better structured, and my dream project was left unfinished.

Looking back, and analyzing the value of the re-usable and clean code I used to cherish so dearly, I conclude - the experience was a great exercise, and made great "code sample" asked at some interviews. However what counts is, that nobody ever re-used a single module from that code, and the project was left undone. Comparing this with the model of successful small to medium scale software companies, comes the realization of fact that marketing folks [that announce worldwide about non-existence features of your product], sales folks [that hide the truth from your customers about pricing going up], support [that tell your customers that feature they requested will be soon added, although from engineering perspective it is near-impossible], project management [that forces developers like yourself to commit to deadline, which seems unrealistic], are so very important for the success of your company, for generating the revenue and keeping you employed.

They will never understand the pure joy of writing beautiful code, the importance of scientific discoveries you are about to make, but this collaboration, often disagreements and compromised between engineering and non-technical stuff is what keeps your product revenue and sales high, and keeps the balance ensuring all the effort is utilized optimally.


Wednesday, May 11, 2011

We speak so many languages... and not only programming languages

{Imported from my post at Vstrech blog}

Hello World, I am a Note
For those of us addicted to Facebook already know, few months back they expended the profile options for adding more personal data, such as interests - movies, books [all displayed with thumbnails] and languages. And for those of us - the geeks, the options are restrictive and do not allow listing our beloved programming languages as spoken on Facebook?




When measuring if somebody can really speak the given language the person is usually asked a series of questions, like how would you say "Hello", "How are you", "I love you", "Bye" in the langauge. To prove the point I can say the prase you chose in many programming languages, going with a sample phase this is the list of my non-listed spoken lanuages, enjoy:) 

C
#include <stdio.h>
#include <stdlib.h>
int main(void) {
    printf("Hello World, I am a Note\n");
    return EXIT_SUCCESS;
}

C++
#include <iostream>
int main() {
   std::cout << "Hello World, I am a Note" << std::endl;
   return 0;
}

C#
class Hello {
  static void Main() {
     System.Console.WriteLine("Hello World, I am a Note");   }
}

Java
public class Hello {
    public static void main(String []args) {
      System.out.println("Hello World, I am a Note");
    }
}

JavaScript
 document.writeln("Hello World, I am a Note");

Perl / Python
print 'Hello World, I am a Note';

  
Ruby
puts 'Hello World, I am a Note';

Shell
echo "Hello World, I am a Note"


Assembly

I wouldn't mind the distiction of natural versus artificial languages, and prevension of fake languages being listed as spoke, but if one can add "alian" to the list, there should be option to at least add Lisp to the same list.