hitchhiker tux' guide to galaxy

21
HITCHHIKER TUX’ GUIDE TO GALAXY Programming: when the ideas turn into the real things Maciej Kaczmarek Lisp C Perl Python PHP Javascript OPERATING SYSTEM BROWSER INSTANT MESSAGING OFFICE Scratch

Upload: ferhat-elmas

Post on 18-May-2015

193 views

Category:

Entertainment & Humor


6 download

DESCRIPTION

Innovation course writing

TRANSCRIPT

Page 1: Hitchhiker Tux' Guide to Galaxy

HITCHHIKER TUX’ GUIDE TO GALAXY

Programming: when the ideas turn into the real things Maciej Kaczmarek

LispCPerlPythonPHPJavascript

OPERATING SYSTEM BROWSER INSTANT MESSAGING OFFICE

Scratch

Page 2: Hitchhiker Tux' Guide to Galaxy

I am Tux, a special penguin. I live in an universe called computer.In this universe, I am the ruler Let’s be more clear: This machine, computer can do anything you want in a way you like true, a car can only take you a ride a dishwasher only cleans dirty dishesbut computer adapts, every object every tool,which would make it way universal

Page 3: Hitchhiker Tux' Guide to Galaxy

A ‘program’ gives set of instructions always bothered computer by saying what to do an operator system decides in which order it should do I said, I decide here; if we become close, you can decide, tooI regulate the order of executions like your mother saying: shoulda brushed your teeth after every meal if she does not order your life, would you go your bed at ten?you know, you could not do, and fell asleep at school time and cannot see the girl you would fell in love Hey, we need order, computer needs order moderator will give, do not wonder

Aye how wonderful operator system I am I know operating as if coded on my genes my creator has been an operator, Linus Torvalds my father has been an operator, Unix I am a main operator, Torvalds Unix – say just Tux - Oh, they say there are few more mains, Windows and MacOS laugh with me brothers, I rule 90% of 500 fastest computersI am the only one having made his code open people can see me, I let them modify my inside my daughter, sweet Android, can run on mobile still people call mains these means you are not one of them, aren’t you?

Page 4: Hitchhiker Tux' Guide to Galaxy

Tux: Hey, Fox! What do you do? Fox: Don’t you remember? I work in Firefox browser make people surf on web as enjoyable as surfing on sea waves in summer. A layout engine to show the web pages; in design, it will make you experience latest progress With tabbed browsing, no new window for each page Unlike life where new windows are gonna open after each page Do not worry my fellow, I hold a special security mode for that You know, you should check the life’s going and fix it Like the spell checking I provide; if you wrote something wrong, I would warn you to fix it. Tux: Thanks Fox, really thanks, but I meant what do you do, how are you?!Fox: Huh, fine. I am still competing with the others all the way.Tux: What makes you different than them anyway?Fox: Do you want to use Safari or Opera instead of me? Which one would you prefer: Internet Explorer, Chrome or me? as dedicated myself to my work, I work free. I am so generous that I made my code open so that anybody can change it for better.

Page 5: Hitchhiker Tux' Guide to Galaxy

Tux: Hey, Fox! What do you do? Fox: Don’t you remember? I work in Firefox browser make people surf on web as enjoyable as surfing on sea waves in summer. A layout engine to show the web pages; in design, it will make you experience latest progress With tabbed browsing, no new window for each page Unlike life where new windows are gonna open after each page Do not worry my fellow, I hold a special security mode for that You know, you should check the life’s going and fix it Like the spell checking I provide; if you wrote something wrong, I would warn you to fix it. Tux: Thanks Fox, really thanks, but I meant what do you do, how are you?!Fox: Huh, fine. I am still competing with the others all the way.Tux: What makes you different than them anyway?Fox: Do you want to use Safari or Opera instead of me? Which one would you prefer: Internet Explorer, Chrome or me? as dedicated myself to my work, I work free. I am so generous that I made my code open so that anybody can change it for better.

Page 6: Hitchhiker Tux' Guide to Galaxy

Tux: Don’t be this touchy; you are my friend, I use you. Fox: February 2012, I am selected as the winner of browser stress tests. Yet have 25% market share. Tux: Please being third most popular is not bad. Let’s change the subject. Umm, where does your name come from? Fox: Initially, my father named me Firebird; but it wasn’t unique, there were too many birds, then I tried to keep it similar to my older. My main feature was security, hence I get a name from Red Panda, which secretive and gentle creature. Tux: Fine, you know I do not have much time. By the way, I am downloading a big file, then I gotta go and I ruin the downloaded file. Fox: With my download manager, you can stop download, and resume later. Tux: What if I like a webpage, then I gotta go and forget which one it was. Fox: I will market to your favorite websites, you can have fast access to them later. Tux: Thanks buddy! I gotta go, see you later.

Page 7: Hitchhiker Tux' Guide to Galaxy

Tux: Don’t be this touchy; you are my friend, I use you. Fox: February 2012, I am selected as the winner of browser stress tests. Yet have 25% market share. Tux: Please being third most popular is not bad. Let’s change the subject. Umm, where does your name come from? Fox: Initially, my father named me Firebird; but it wasn’t unique, there were too many birds, then I tried to keep it similar to my older. My main feature was security, hence I get a name from Red Panda, which secretive and gentle creature. Tux: Fine, you know I do not have much time. By the way, I am downloading a big file, then I gotta go and I ruin the downloaded file. Fox: With my download manager, you can stop download, and resume later. Tux: What if I like a webpage, then I gotta go and forget which one it was. Fox: I will market to your favorite websites, you can have fast access to them later. Tux: Thanks buddy! I gotta go, see you later.

Page 8: Hitchhiker Tux' Guide to Galaxy

Tux: Hey! ThunderBird what can you do for my friend?ThunderBird: I provide an easy to use interface for email, news-group and news feed. With extensions, my interface is highly customizable. First, I can manage multiple email accounts, this is important because people should have been in different net-works to utilize all of them. There are extensive search capabili-ties with the option of saving search results for performance. Advanced message filtering prevents you from being disturbed. Notification and labels reminds you important tasks. Tux: Ok but what about security? I am a security addict. I can’t use anything insecure. ThunderBird: I use secure protocols to send and get emails. For archiving, I support Pretty Good Privacy.

Page 9: Hitchhiker Tux' Guide to Galaxy

Tux: Pidgin, How are you? what do you do?Pidgin: I enable you to talk to your friends in real time. That’s why my name is instant messenger. Mainly, you can easily control your contact list,and conversation and so their log. You can also transfer files. The best is that you can do it with friends in different networks such as Google Talk, Facebook, Yahoo Messenger, MSN, Jabber or QQ. Tux: Good good! Security!Pidgin: Shame on you, Tux. I respect privacy so off the record mode.Tux: Well done! Tell me the source of your name.Pidgin: I was written by a student as copying features from AOL InstantMessenger by using big graphic library GTK+, code base to be used for other programs, to be able to run on you so my name was GAIM,but copyright issues have arisen and my name should have been changed. It became Pidgin because it describes a communication between two people that don’t share a common language.

Page 10: Hitchhiker Tux' Guide to Galaxy

CHAPTER I:

Baby Steps: Programming

Page 11: Hitchhiker Tux' Guide to Galaxy

You see my friends. Do you want to write next genera-tion of them? However, you should know programming but don’t worry I know wise cat, Scratch, she can teach you.Tux: Hey! Wise cat, here is my friend, could you teach programming?Scratch: Sure, that’s why I am created. I provide you an interface so that you can drag and pull some blocks and come together like playing with legos. By this way, you will enjoy but also you will also produce nice animations. That’s all you need to know, go and give a try.

Page 12: Hitchhiker Tux' Guide to Galaxy
Page 13: Hitchhiker Tux' Guide to Galaxy
Page 14: Hitchhiker Tux' Guide to Galaxy

If you want to write one of these cool programs, you need to learn a programming language. There are nearly 60K programming languages but Lisp is different so I will introduce him and his army. He is the oldest and most powerful one so he is like an alien that comes from another planet.

Tux: Hey, Lisp! Could you explain why you are an alien?Lisp: Because I seem as an alien language to most of the programmers in terms of my syntax. Everything must be between parentheses which are called S expressions. Moreover, I have very powerful features that other languages don’t have even if I am the first high level language which is written by key-words, not bits.Tux: Can you give some examples from your differentiating features?Lisp: I have talked S expressions, these are the main building blocks of mine. Data and code are kept in the same way so a program can modify its code very easily.Tux: What is the advantage of it?Lisp: It is very important feature for artificial intelligence. For example, one robot is programmed by mistake to pass through when it sees red light in the traffic. However, it can learn from the environment and correct its code.Tux: It seems very useful. What else?Lisp: Since I am the first language, I am the pioneer of various paradigms such as automatic storage management, dynamic typing, innova-tive data structures or self hosting compiler.Tux: I got confused! Could you explain them?Lisp: Haha! This is normal because they are very advanced, that’s why most of the languages don’t have them. Compiler is a program that translates a program that is written in a high level language to machine code that can be directly executed. Moreover, compiler can be written in any language, even in machine code. If a language has a compiler that is written by itself, then this language is self-hosting. In real life, most of things show social structures which in turn make a graph. I make easier the representation and manipulation of these abstractions. Think about your friends, they also create a social graph. The other one is dynamic typing. When programmers are doing manipulations, they need memory to store results and they should specify how much of memory they require according to type of their result. I don’t require this. To make it more concrete, you have a name, you are calling your bicycle with this name but then you sold your bicycle and bought a computer and started to call your computer with same name. As you see, name isn’t bounded to a specific type. Automatic storage management is very self-descriptive. If a programmer wants to store an object, he should measure how much memory he needs, then he should allocate that much of memory. Moreover, when he is done with memory, he should return the memory back otherwise your programs cannot run since they don’t have enough memory. This is the scenario of other languages, I handle of them for you.Tux: Wow, I now understand why they behave you as an alien but one final thing, I guess that your name comes from these lists and parentheses.Lisp: You are correct, Tux. I made List Processing shorter.

Lisp: We can live with some bugs happily but one of them can produce new bugs exponentially and they can start to command you before you notice. That’s why you need special weapons and tools to make a war against them. Here is my army:

Page 15: Hitchhiker Tux' Guide to Galaxy

If you want to write one of these cool programs, you need to learn a programming language. There are nearly 60K programming languages but Lisp is different so I will introduce him and his army. He is the oldest and most powerful one so he is like an alien that comes from another planet.

Tux: Hey, Lisp! Could you explain why you are an alien?Lisp: Because I seem as an alien language to most of the programmers in terms of my syntax. Everything must be between parentheses which are called S expressions. Moreover, I have very powerful features that other languages don’t have even if I am the first high level language which is written by key-words, not bits.Tux: Can you give some examples from your differentiating features?Lisp: I have talked S expressions, these are the main building blocks of mine. Data and code are kept in the same way so a program can modify its code very easily.Tux: What is the advantage of it?Lisp: It is very important feature for artificial intelligence. For example, one robot is programmed by mistake to pass through when it sees red light in the traffic. However, it can learn from the environment and correct its code.Tux: It seems very useful. What else?Lisp: Since I am the first language, I am the pioneer of various paradigms such as automatic storage management, dynamic typing, innova-tive data structures or self hosting compiler.Tux: I got confused! Could you explain them?Lisp: Haha! This is normal because they are very advanced, that’s why most of the languages don’t have them. Compiler is a program that translates a program that is written in a high level language to machine code that can be directly executed. Moreover, compiler can be written in any language, even in machine code. If a language has a compiler that is written by itself, then this language is self-hosting. In real life, most of things show social structures which in turn make a graph. I make easier the representation and manipulation of these abstractions. Think about your friends, they also create a social graph. The other one is dynamic typing. When programmers are doing manipulations, they need memory to store results and they should specify how much of memory they require according to type of their result. I don’t require this. To make it more concrete, you have a name, you are calling your bicycle with this name but then you sold your bicycle and bought a computer and started to call your computer with same name. As you see, name isn’t bounded to a specific type. Automatic storage management is very self-descriptive. If a programmer wants to store an object, he should measure how much memory he needs, then he should allocate that much of memory. Moreover, when he is done with memory, he should return the memory back otherwise your programs cannot run since they don’t have enough memory. This is the scenario of other languages, I handle of them for you.Tux: Wow, I now understand why they behave you as an alien but one final thing, I guess that your name comes from these lists and parentheses.Lisp: You are correct, Tux. I made List Processing shorter.

Lisp: We can live with some bugs happily but one of them can produce new bugs exponentially and they can start to command you before you notice. That’s why you need special weapons and tools to make a war against them. Here is my army:

Page 16: Hitchhiker Tux' Guide to Galaxy

I am very similar to macro guild and basically I am an extreme version macros. Lisp only uses parentheses so it has a very simple syntax. Moreover, it stores and behaves its code and data in the same way. Therefore, the code of the program can be modified by itself. I help you modify the language ac-cording to your needs. Since you get only what you need in terms of syntax, complexity and features, you know t the domain.

DSL GUILD HOT RODES

Page 17: Hitchhiker Tux' Guide to Galaxy

Do you know the movie called Back to the Future? If so, you know what I am useful, otherwise, let me explain. I take you to time travel in code. With my help, you can write a code that runs from end to start or in other crazy ways you can think of. Moreover, I help you for an advanced technique, nondeterminism. For example, you are lost in a maze and searching the way to the exit. Program can divide itself into multiple particles and each particle can go in different directions and continue the search. The good part is that if one of the particles finds the exit, all particles instantaneously come together. In a reality, a particle cannot be exist in different places at the same time so you need to try one path as much as you can and when you come an empty result, you should roll back to the point where you have chosen the path you have tried and choose the other path and continue searching new path. You see that all these roll- backs make the code complex and buggy but I can handle them and you need to write only logic.

CONTUNIATION

GUILD

ROCKET POTS

Page 18: Hitchhiker Tux' Guide to Galaxy

I am the pioneer of the functional programming which is the main combination of mathematics and programming. I have some principles that the programmer must conform. At first, they can be seemed difficult to get used to but I want them for their goodness so if they get used to my principles, they will be more productive and be able to write much more elegant code. If you are similar to functions in math, you already know me.

My main principle is that the data on which the function does the processing must be a parameter passed to function, local variable that is created by the function or a constant. Moreover, a function can not creat side effects so it can’t write to disk, print hello messages on the screen or do anything other than preparing its result.

Well coded functions according to my principles can do only one thing that is returning a result and it is independent from the rest of the program. The only dependency is on its parametersand so if you give same parameters infinity times, it will return the same result. Therefore, if there is something going on wrong, we can separate the function and debug it.

FUNCTIONAL GUILD CRUISER

Page 19: Hitchhiker Tux' Guide to Galaxy

With my help, progra mmers can build t their new cool features by creat- ing compiler or interpreter that understands the new feature in a elegant way. I prevent the programmer from duplicate the code and enable him to tailor the language for the problem. Main building block is logic and its main keyword is if. When writing a program, encounter 2 values, you may need to test these and process them specially and do sth else for the rest then with my help, you can write three way if keyword.

MACRO GUILD MELEE FIGHTERS

FUNCTIONAL GUILD CRUISER

Page 20: Hitchhiker Tux' Guide to Galaxy

I In other languages you need to set a value for a variable but I can run a generic set method, get its result and set it to variable. Basically, I can bind a variable to a method or more complex structures. Since I can abstract the logic and do the hard part for you, code is simple. The simpler code is, the less bug it contains.

GENERIC SETTER GUILD SUPPLY CHAIN

Page 21: Hitchhiker Tux' Guide to Galaxy

I am similar to macro guild, but an extreme version macros. Lisp only uses parentheses, very simple syntax. It stores and behaves its data in the same way. The code of the pro-gram can be modified by itself. I help you modify the language according to your needs. Since, you get only what you need in terms of syntax, complex-ity and features, you know the domain and do less errors.

DSL GUILD HOT RODES

GENERIC SETTER GUILD SUPPLY CHAIN