Showing posts with label python4. Show all posts
Showing posts with label python4. Show all posts

Monday, November 17, 2014

C/C++ Must Die

It is a four hour forward only text. I am not in the mood to clean. reread, refactor, split or fix any mistakes right now, and I am not saying sorry for that, because it is how it is written with this limited keyboard interface that I practiced over my lifetime. I am sorry only if you won't be able to read or understand that, because it would mean I made it all worse. I am already at the point that I want to filter it straight to the subject, reread and fix all typos, obscure moments, digressions and words, but I've already out of time and it might happen that there won't be any time for that later.


My system background is [assembly] --> [pascal] --> [c] --> [php] --> [python], so C is not my favorite language, I am in any way attached to it and don't exhibit a feeling of nostalgia and deep sadness when thinking about what changed in the past 40 years that passed since its invention. What I really regret is that there is no a place like Bell Labs anymore that could prevent bloody enterprise from formatting people to the bloody business mindset. Formatting so badly that you even need a ton of startups to just produce ideas (not mentioning getting them right).

So, in the past 40 years, a new language appeared called Python. I don't think that Guido knew the words "usability", "user experience" or CJM when inventing it - it was just natural and human like, just because it was not engineered, but made through feeling of a human, who likes Monty Python and doesn't follow accepted rituals of human organisms in suits. I understand his desire to keep CWI copyright in place - it is a living reminder about another environment that made this thing possible. Unlike these bloody corporations that keep pressure on what you need to do and when to deliver. There is not much creativity and freedom right now. Those tiny groups of people who gather through the internet try to change the things. But the poor expressive power of non-native English language, time gap and invisible mood and attitude changes make it almost impossible to provide a stable communication channel that will not limit itself only to a narrow band of appreciation, joy and positive emoji. All negative emotions, drama, critics and depressions exists there for a reason - to express the importance of details and adapt them.

Accepted rituals of human organisms in suits. It is hard to be human. So hard that the rational part of us will never accept the idea that I, me, myself are limited. Humans had somehow devised the ethics, culture and rituals to deal with that. Implemented complex system of oppressing behavior and enforcing rules to make everyone the same and keep balance. Capitalist economy made it possible to compete, to make a gameplay to measure and estimate your value compared to someone else instead of just killing him, because his will to live just dampens yours. Money had been chosen as a universal way to solve conflicts and it worked for a few generations. Until a new generation appeared that didn't not care about conflicts and didn't see why would anyone should conflict if everything you need is money. We are still limited humans who fail to see the balance and yet we are trying to prove that we are the best, we need to be respected etc, etc. Whatever our rituals are, they are a shroud on on our eyes. The shroud that doesn't allow us to see how human really work, that our perception is not discrete and the expressive power of art is something we should explore as a discipline of human interfaces.

C/C++ is one such interface. It is a written language that no civilization from the outer world will be able to decipher. I didn't research this idea to far, so I leave it to you. It is a formal interface with brackets, asterisks and letter combinations that convey some ideas and concepts. It brings the former poor language of assembly to a whole new level. The level of more toys to play with and *exchange*. Every language invented after it was adding or removing these toys for humans to play with, but they still have hard time to combine all programming languages into the garden of toys as a whole. The garden that you can explore with the rest of your senses (further that arithmetic and text processor units in your head) to see how things work, tear them apart, which toys go well together and which just don't belong. There should be right toy for the game. It is in our mindset. We use the toy that we've used to, learned the first and like opiate, it instills us with the knowledge that this is the best tool in the world, in your world, because everything else if perhaps just worse. The nostalgic feeling brings us emotions, knowledge and experience keeps us in a comfort zone. Egoism. We want to world to be the same. But while we were playing with our toys, it changed.

Many toys appeared and vanished. Patterns made some of us high. UML - the art erased out of drawing - made slave drivers happy. These were adopted ways to transmit the knowledge, format the culture, and narrow the communication down to the limited capabilities of any human put into the bloody cage of enterprise machine. Bloody doesn't mean we can escape it. It is just bloody. I see it as squashing the humans into the cubes of comfort zones and I am afraid of it. There is no progress outside the cells of enterprise organisms and these organisms are still mostly parasites hooked on resources that they are extracting from ecosystem and killing the planet by their exhaust. If you think that Google is good - take a look to the streets - if there is any litter around - how do you think - could people from this Enterprise remove this litter with their bare hands? I think they could. It is easy and even fun. But will they?

C/C++ is not a litter. It is a tool and a toy. The world had grown a lot, but the tool and the toy stayed the same. In these 40 years we've learned that we can only have juggle 7 things in our head at a time. We have only 60 hertz in out heads compared to 3Ghz of modern CPU. 7 things is the most that can survive through the neural network while signal passes from one domain (limited 3D area) through the whole volume of absolutely parallel processing unit. The amount of thing that we need to keep in mind is bytes, chars and pointers, even for string processing. And as a humans we operate with strings. Even bytes in our heads look like hexadecimal and we are still constantly ignoring this. We are continuing to invent rational logical abstractions - new toys - instead of switching off the conscious part of our brain and concentrate on the part that scans things. In the past 42 years we've upgraded our interface from reading to scanning and nobody noticed that. The older people still insist on reading books, going through lengthy letters in mailing lists, and lots of articles. But we've invented movies, animation, visual arts, demoscene. The last one appeared and vanished - it was a sudden ray of warm and bright light - an excitement that was impossible to rationalize and explain, and that gave a birth to a whole generation of game designers out there.

C/C++ is not a game. It is a legacy, a hack, a combination of mysterious symbols that make impossible things possible. This combination has expressive power and concepts that will survive a whole new generations from now on. You will still need an instrument to manipulate memory on low level. An instrument to control hardware with high level concepts. But it is not C/C++ that needs to be used for that, because it doesn't make it optional. C/C++ doesn't help you scan programs faster, read operations behind combinations of asterisks, symbols and brackets to fill the 7 slots in your head with something that makes sense. It doesn't instill me with a sense of confidence, because the code once already written may leak in different places.

Back in a days we were playing with reversing the software. You choose the entrypoint and then try to figure out what software does. Most of the time you had to work with assembly, follow the jumps and procedures, you were writing tools to help you deal with the complexity and automate the journey. The process didn't change since. What changed is that you don't need to think about memory allocations anymore, algorithms can tackle strings more efficiently than humans, so this slot is freed too. You can concentrate on your DNA handling logic, on algorithm, on final result that you need to achieve and this result will make sense for ordinary humans,  not for people with computer science camp behind. Python made this possible by providing this interface for humans when hardware allowed that. Python adapted itself to humans who now scan things instead of reading them. You don't need a whole usability discipline to note a small nifty things to make improvements like these, but when you have this whole new usability and ux buzzworld emerged, it is somehow wrong not to take an advantage of that. It is quite natural and right from the point of standard human specie, but wrong from the point of augmented human that needs tools to be evolved to allow more freedom. Evolution in Python led to the Zen of it. It is not a speccy, not a book, not a long text in a foreign language. It is an artpiece - a thing that could only be born among people who value the artpiece of Monty Python, and appreciate irrational culture of humans and play that. Without the art squeaky PyPI will be remove and the new warehouse will be built, welcome sign will be replaced with patent paranoia, you will have to sign a paper and undergo passport scan to pass through. People attempt to save things that are important to them if they can see them. You can't see the irrational, you can't explain it, especially things that came naturally. Humans are limited in understanding things, in expressing things, complex associations and irrational thoughts that came out of their emotions, knowledge, fears and beliefs. They are limited in their ability to share this information with others, they don't have time to pass info anymore, can't communicate so fast and this is where the progress stops. Humans are limited, they can not deal with the complexity, and they naturally developed arts to deal with that. Arts communicate on different levels of perception and education, they are waiting for you to get there to feel them or came down on you rapidly right away. It is a way to look for answers, to explore, express and communicate them. It is about at least some kind of freedom in dealing with paralysis of complexity. But this is about C/C++ and I need to finish this.

C/C++ is insecurity, but at the same time it brings trust and freedom. At least it was many years ago. It is the last piece of freedom that makes hacking of the systems possible. It was fun and you don't want to kill the fun once you're there. It is not hackers, it is humans, sometimes among them, who kill the fun. Paranoia, fear, social engineering techniques that make talented hackers kill themselves. It is not fun anymore to hack things in this world of fight of limited species over limited resource. Perhaps the backdoor needs to close. I feel deep sadness and sorrow by thinking about that, but who cares anyway. There is a huge demand for a better readable human interfaces for controlling new technologies and devices that will be born to augment humans and while we are messing with bytes and pointers leaning of some memory scattered over the table, we skip the cosmos of possibilities and things that shine in depths behind our necks. There is a place for better coupling between human intention to care or not care about low level details, better interface between the though to operate on some level and the tools that make the thoughts real. It is important to keep it human oriented, because the picture that one human drawn should be intuitive and clean for other human to comprehend. If that second human is familiar with concepts, it should not undergo the long training in decyphering glyphs just to get into details. We've already seen that this is possible. Just need to experiment with this a little bit more to pave our way in the way art does it. Art is the ultimate hack of all times after the science.

And for us, for new generation of coders, C/C++ must die to let evolution continue.

Tuesday, November 20, 2012

Cinematic journey approach for Python development

Quotes page (fixed in stone) is silent about the one who said that Python, compared to other languages, allows to directly put thoughts into the code. I couldn't disagree with this, but taking idealistic approach, this was more true with Python 2 when coding on a system level, but not so true with the great coming of the web and i18n. So, what's wrong now? I don't have a clean and up to the point answer, because many people still think that there is nothing wrong with the Python. Probably the right question is: why Python is not better than it is now?

This one of the complicated questions nobody is able to answer fully. 42 is the answer, but does the question clear enough? The question is probably too complex for a good technical answer and should undergo decomposition. The decomposition can be achieved by clarifying. What means "better"? More easy to code in. Why is it hard to code? Here goes a list of problems...

...

Well, there is no list. Therefore there is no visibility, and without visibility no answer is possible. Gain visibility into the list of problems that make Python not-as-good as we want it to be is the primary step to take to make all subsequent steps reasonably grounded for a good party quest (and sane development roadmap for community to focus on).

Historically there were several driving forces behind Python development - mailing lists, bug reports and PEPs. PEPs more than the bugs. Mailing lists somewhere in between (YMMV).

ML were good until people had a lot of time to follow up. Bugs are good at tracking status of things, but they are tuned for fixing things and scratching issues, so language research naturally falls out of context in bug tracker interface. PEPs.

PEP is a good thing that helped to free Python core from featurecreep damage, provided a basis for discussions over a long period of time and insight into decisions over the language development. But PEPs start to fail, and the reason why they do this is the lack of time and energy to iterate over them. Most people can't say if technology is good or bad before testing it (version control as an example), and PEPs with lengthy pieces of design detail assume prior experience with the problem, require thorough imagination to see if the solution will play well.

PEPs require a lot of concentration - the resource of a big shortage nowadays, especially of professional grade. Which is not a surprise if you look at how good HR and management technologies are developed in modern world to keep people busy and involved. We can only hope that collective minds of big corp.s are somehow bugged with the problem and look for solutions to divert their resource flow to improve the grounds they are standing on. Let's hope that community can back up their support, and also somehow bugged with the problem about how to lower barriers of requirements, responsibility, experience and technical expertise for occasional community member, a student or elderly accountant, to be useful in Python development process. Lets's hope that both parties are interested enough to constantly improve ways to use the resource flow to the fullest extent possible.

There are two things that can be help here (and make Python better that it is now) - first one is to improve visibility. It takes its roots in cinematic industry and it's called scenario. Second one is to improve the process and it is a best practice developed over the time by user experience professionals. This one named customer journey map.


What keeps me away from putting my thoughts into code when I write Python?

"""Python forces me to maintain a lowest level structure of my writing - the indented layout, a good thing. Although this also comes with a pain while debugging, because Gangam style multiline comments require me to remember to indent them as well."""  - this is a scenario. You can add various metrics to it, such as:

  """I have only 7 operational attention slots in my mind, and one constantly falls out, because I have to pay attention to complicated commenting requirement.""" - the metrics here directly influences how deep one person can operate at any given moment. It is basically that multiline comments with strings are stealing concentration.

  """Those indentation errors are driving me mad every time I forget to indent multiline comment for debugging.""" - this says that a person uses iterative approach to debug problems, often commenting a lot, and probably in production environment using non-tuned editor. That's another scenario where Python comment hack doesn't play well.

Scenarios have two good qualities - they are short and can be conflicting between each other. PEP is on the other side - it is self-sufficient. To notice that PEP is contradictory - you need to attentively and thoroughly read it or write it yourself. It takes a lot of time. Scenarios are somewhat emotional, they are easy to remember and refer to. This makes it possible to concentrate on conflicting scenarios, outline conflicting points and concentrate all work around them rather than around vague opinions, which makes the whole process of looking for compromises (or good solutions) more fun and involving.


To summarize, the scenario is a good title to remember and a short story to tell. What is the difference between scenario and a StackOverflow question? Question may not have a story, scenario may not contain questions. What's the difference between scenario, use case and user story? "Use case" is an enterprise slang, "user story" is an agile term. Both may have some definitions. Scenario is just scenario, like in movie. You should replay it to see how it works. Scenario is for humans, it is less formalized and comes with emotions included (YMMV).



Let's skip to another example of problem with Python usability on a higher level - packaging - and present another tool from usability domain that can help with analyzing processes in general.


What's wrong with Python packaging that everybody constantly rewrites it?


I didn't intend to include it here first, but a half an hour ago I spotted this article - http://lucumr.pocoo.org/2012/6/22/hate-hate-hate-everywhere/ If distutils/setuptools had a scenario database for packaging, it could be possible to analyze limitations of Python in regard to each scenario. This analysis is similar to PEP, but not necessary a proposal and not necessary so extensive. Scenario may contain a history of the problem, a short description, summary and link to other conflicting scenarios. The role of scenario database is to aid decision making process and an easy reference for new people facing the same problems.

Scenarios can be universal and it is a good analysis tool. You can substitute Ruby for Python and look how good this specific workflow looks for the different system.

"""I can't list installed Python packages, why?""" - does anybody have a link? """I can't find the answer""", and that's another scenario about usefulness of scenarios.

So, to fix packaging there should be a way to operate with scenarios. There should be at least a list of scenarios (or better indented tree), so that (y-)hackers of a new packaging tool could go over it, think about their approach, tick checkboxes and hopefully, spot and bring to the surface this "Essential Packaging Restraint" that eats a whole generations of people. The point is to spot the problem before starting to code.


The scenario DB will help, but there is another usability tool that can make packaging, bug tracking and other development processes more streamlined (less time consuming, more fun and engaging). This tool is called Customer Journey Map, and it shows to people, who are not experiencing any problems with the process, where those problems are for somebody else. This map is also a good starting point in web site redesigns, conference organizations, all kinds of activities that involve people, or more specific, a single person named "Customer", barriers this guy is facing and steps to remove these barriers.

I can't extend to a great detail about CJM in this post due to time constraints. I was impressed by a presentation of awesome UXpresso team, there might be a video available, but it is likely Russian only, and I've heard of at least one major Python company (wargaming.net) that uses it extensively, so I can only give you a pointer for now. It will be interesting to make presentation of this technology for Python contribution process and talk about CJM at PyCon, but I am unlikely to afford the participation costs, so somebody else should do this.