Category Archives: Programming

More technical programming topics

Python Design Philosophy and the Principle of Playing

Read of Python’s Design Philosophy on python Python’s BDFL’s blog.

Below I quote those lines that clearly embodies the principle of playing.

BTW, from that blog post, I can see why python succeeded where abc didn’t.

Do one thing well (The “UNIX philosophy”)–this is exactly the principle of playing.

A large complex system should have multiple levels of extensibility. This maximizes the opportunities for users, sophisticated or not, to help themselves.

“Things should be as simple as possible, but no simpler.” — surely the essence of principle of playing. This is very important for people to be able to play together.

Borrow ideas from elsewhere whenever it makes sense.– the principle of playing emphasizing on playing with each other. Borrowing ideas is an extended form of playing with each other.

Don’t try for perfection because “good enough” is often just that.

(Hence) it’s okay to cut corners sometimes, especially if you can do it right later.

Don’t bother users with details that the machine can handle (I didn’t always follow this rule and some of the of the disastrous consequences are described in later sections).

Support and encourage platform-independent user code, but don’t cut off access to platform capabilities or properties (This is in sharp contrast to Java.)

Advertisements

Leave a comment

Filed under Programming, Python

Computer Science is Life Science

Computer Science (CS) is not a science of computers. CS is a science of life. It is a bridge to connect the physical science with human science.

Here I take the word life as what is meant by C.A. (Christopher Alexander) in his book The Nature of Order. And I use his concept Degree of Life as the measure of life.

So what is CS studying? The essential part of CS is software programming, which is about how to create life. It is commonly known that OOP (Object Oriented Programming) is about agents and interfaces (e.g. the contracts between agents) (so is economy). Here we can summarize it with the Principle of Play (as in the post about Python).

Briefly, the Principle of Play is about how other life entities (I will start using this word throughout this essay to describe anything that we consider having a degree of life, probably a degree of life that is higher enough to interact with other entities) can easily interact/play with.

So for a life entity, if we want to measure its degree of life, we can look at the following aspects: how many different entities are able to interact with this entity in different ways; how much time those entities need to learn to figure out how to use this one.

For a system, on average, how much degree of life within a system of many life entities? We can look at these from the following:
how generative the system is, how the system is able to come up with new ways to deal with new problems (kind of like human body);
how adaptive the system is to the outside;
how adaptive the system is to its own growth/evolution, whether the system is able to carry out the evolution in a more peaceful way;
how much time the life entities in the system spend in figuring out how to work with each other;

A better system is more able to be life-generating. It is more efficient at converting energy from lower forms to higher forms, such as converting energy into life entities. Take music for example. When a musician create the music, he consume a lot of energy (he has to eat a lot of food and use the energy that is from the food) in creating that music and put that music down in some kind of physical format (for example, a mp3 file on a computer). When that mp3 file is listened to by another person, the music causes some life-generating events in that person. If we say it causes some new material being generated in that person’s brain or causes restructuring of his brain, then the energy is transformed into the material (new life entity) in that person’s brain. So good music, just by being played over and over again for different people, simply consume some physical energy (electricity, for example) and push a higher energy being generated and stored. (The real situation, of course, can be way more complicated. Here we just simplify it temporally for the convenience of introducing the idea.)

So a system with more life means that more energy are taken from the physical world and stored at a higher level.

So what kind of brain has more life? Possible answers below:
A brain that has real knowledge, the brain structure is shaped very well that it can recall knowledge and engage with the world in a very efficient and creative way;
A brain having a higher degree of life is better at creating life.

More questions for our consideration:
Why human being is a higher form of life? (Is the language giving us the potential to have more life?)
Why creatures have more life than furniture?
Which society is more able to adapt to change? For example, with the new frontier in the info age, which country is more able to adapt and imagine a new future?
What kind of life creating process is it in human body? How does DNA create life for human? How does human being take physical energy from outside and convert that to its own energy?

There are definitely endless fields that we can go into to examine how the life generating process is carried out there.

So when we go to the macro level, we look at the whole human society, we want to see if our society as a whole has a higher degree of life than societies 2000 years ago, which means if our society is more able to adapt to change, more responsive to outside, more able to carry out the evolution in a peaceful way.

To give an example of how we can measure the degree of life, maybe we can try to see how we measure the degree of life of different programming languages (for example, Java VS. Python). I am thinking the method can be as below: we look at how people in different professions or different age groups are able to pick up the programming language quickly and how diverse are the software/apps that are built by this programming language, how the language itself is more able to adapt to change… Surely, sometimes whether a programming language is used more often has a lot to do with marketing. That is why we need a better playground so the better ones can be played by more people.

Every life center (entity) has billions of plus and billions of minus. Thus it is math on a higher level. (Any math is just an extended transformation of plus and minus). So what is this form of transformation of plus and minus in life centers (entities)? One clue is that this is computation of plus and minus on the scales of billions (http://www.wired.com/science/discoveries/magazine/16-07/pb_theory). Another clue is as  CA has pointed out in his book Nature of Order, it is expressed through geometry forms. Certainly any geometry forms (if not a dot) contain billions of plus and minus. Thus visualization of huge amount of data might be part of the big picture of solutions.

Google’s search engine is a way to compute the billions of plus and minus, if we treat a link as a vote (a form of plus and minus). In words of O’Reilly, Google “built real-time information systems to capture and respond to that vote”.

Above are just some early hypothesis. Any new science starts with great hypothesis, then countless proving and figuring out the details. I hope these hypothesis can be a good start.

The ideas here are still very rough. I put it out early for the purpose of getting some early feedback. So if you know someone doing similar work on this, please let me know.

4 Comments

Filed under About Software, Chan/Zen, Computer Software, Essay, Featured Essays, Programming, Python, Social Software

Software programming for everybody

When software programming is made so easy, it is a revolution. I am referring to python and its web frameworks. Programming with python is like writing articles. Instead of writing things down, I just write them into software directly. In a sense, this is the true writing. The writing is not static, but dynamic, and it more fully represents the thoughts/knowledge, which are dynamic and running, and can be interacted with in a totally different level from static writing in words.

With the emergence of all the social software on the web, we see that more and more people need to program themselves to better utilize all the data that is on the web and meet their own specific needs. With this happening, the human world is going to be ushered into a totally new area of knowledge sharing. The significance at least can be compared to that of the invention of paper and printing technology.

Here is Computer Programming for Everybody by Python author Guido.

1 Comment

Filed under About Software, Programming, Python, Social Software

Python resources for beginners

  • Here are some python tutorials:
      1. http://swaroopch.info/text/Byte_of_Python:Main_Page (very simple introduction to python, very good for beginners)
      2. http://www.python.org/doc/current/tut/tut.html (a classic tutorial written by python’s author, very well-written tutorial, highly recommended)
        • Python is very easy to learn. The best thing of python is that you can play with it. You can play with the language in the interactive console environment. You can try out those examples in the console environment directly. For a good console, I would recommend ipython: http://ipython.scipy.org/moin/
        • Python reference is a very useful resource when you are actually programming with python: http://rgruet.free.fr/#QuickRef
        • As web programming is very popular today, here is one Python web framework I am using currently (There are many python web frameworks. This might not be the best one.): http://turbogears.org/

        Note: I decide to post this on the blog because I constantly need to email people beginners’ resources for Python. I will continue to work on this to make it more complete. If you have suggestions regarding how to make this beginner’s page for python better, please let me know.

        Leave a comment

        Filed under Computer Software, Programming, Python

        Language, mind, software learning, and liberal arts

        5 years of fighting in China, I experienced true love and felt free. 7 years of fighting in US, I am stilling struggling with many basic things. This fight has been so long.

        In order to form memory, the mind is trying to reach some more solid ground, some kinds of conclusion. In doing so, it has the tendency of shifting away from the real original experience, jumping into conclusion, or out of habit, interpret the new experience according to old long stuck views and reinforce the old view (either plus or minus). So to avoid this, it is important to at the time of significant experience, acknowledge what is truly experienced or the more reliable evidence as is, don’t jump into any conclusion, just keep what you can reach as is. This, of course, is the function of the notebook.

        The same as our bodies subject to various forces, our minds also subject to various forces. For example, past, present, future. When we see or hear things, they are all forces. Forces are applied to create memory, to recall memory… How do you tame your mind?

        As I can envision, since software is my art of life, by achieving greatness in this art, I will have a lot more grounds to play other things. Indeed, everything will be natural after that. But to achieve the greatness in my art, I need the same level in other arts as I had in China. At least, I need more space, more familiarity with various kinds of space. That is where the great flexibility of software learning comes from. (For example, project choosing. Choosing which tech to learn and being very brave with it. Use the bottom layer knowledge with great flexibility and accuracy. More aware of the context. Be brave and intuitive to use direct approach, short cut…) It is very much needed. It will greatly accelerate the speed. Indeed, your learning of software programming will be at least 1000 times faster if you have a very strong liberal arts and business background. In Chinese, we say Ru Yu De Sui (like fish getting into water), Zuo You Feng Yuan (the source is everywhere).
        2 years ago, I felt the acceleration. Then gradually used it up because I have to work. I need to go back to that. Get my other arts to a whole new level. Then apply great force to my major art. (It seems I am a little trying to jump to conclusion here. 🙂 )

        Leave a comment

        Filed under Business, Chan/Zen, Culture, Programming, What is Learning

        Work on the context to provide meaning to the work

        If you don’t feel your work is very meaningful, you’d better work more on the context. In the software programming world, it means to merely coding might make you feel boring or tiring. But if you work more on the context (the art of programming, for example, or more general, liberal arts) and be aware of the context, then within that space, you gain the meaning of your work.

        Leave a comment

        Filed under Programming, Social Software

        Software like buildings

        Columbia has quite some beautiful buildings. I got inspired by them and felt it quite applies to software as well.

        When I look at those buildings, I know instantly that there are a lot of complexity there. But I feel very comfortable looking at the whole. Just a glimpse, I know what is going on there. I feel very comfortable to look at the whole and then look at each part to appreciate the beauty and how the complexity is put together. The whole building gives me a very consistent feeling.

        I feel software should be like this. Even though there is a lot of complexity, software should be made to allow the complexity to be comfortable accommodated, just like looking at the beautiful buildings.

        Most modern buildings, however, you know there is not much complexity there with just a glimpse.

        Of course, there are a lot of simpler construct in Columbia that are simple, concise and beautiful. For example, the street lamps, the benches. Everything flows naturally on these simple things. When they don’t have to have a lot of complexity, they stay simple and beautiful.

        This applies to the viewing of web interface for webapps. It also applies to the viewing of source code. With the source code, we often rely on IDE to show the structure of the code beautifully. Sometimes we also rely on some simple figures to show the overall construct of the code.

        Of course, in software, all these tied into the object oriented programming.

        Not just software, I feel human organizations should also be like this. It is all about space.

        Leave a comment

        Filed under About Software, Chan/Zen, Programming