Thanks.
Carlin
Criminy
One of the many downsides to temporarily not accepting comments is that you’ll have to second-guess people’s comments. Luckily, with so few regular readers, you’re in a position to second-guess them correctly.
n8han/Coderspiel linked to Friday’s Intentional Programming deal under the pretext “Criminal intent” (I see what you did there), linking back to a good piece of his own discussing an article about Intentional Programming:
It’s going to be great! People will be able to fight out their conflicting requirements by checking in conflicting visual programming flow charts or whatever crap they come up with next to try to enable people that don’t like programming or programmers to write software.
But there’s a problem: you have to think logically to be able to tell a computer what to do. Annoying! But true. Even with the flow diagrams you’re still writing logic, and using like a thousand times more pixels. It’s because most people don’t think very logically (and don’t want to learn the craft of it) that programming languages are “esoteric,” not because of some secret programming cabal.
Intentional Programming probably sounds like hogwash to many when put in this context. It’s hard to write Windows, or Office, or even Windows Calculator — now with two rows! — in Intentional Programming. However, I believe that it could work in narrowly defined circumstances. When you have a problem that is sufficiently advanced that it demands very precise logic that encompasses the majority of the program, you’re probably screaming for a domain-specific language to begin with. It’s not that far-fetched to assume that people could cobble together the interconnecting raw logic if only they were given tools to do so.
The code has to be written. The low-level ifs, the concurrency and memory considerations, the hashing for the hash tables; there’s no doubt about this. But maybe the underlying code to implement the pure programming logic that’s needed could be generated, and maybe the generator could be smart about recognizing larger patterns in ways that let it generate subtly different code in different situations, such as a programmer would do it.
Intentional Programming won’t swoop the landscape and solve all our problems. It probably won’t even work unless some very specific criteria have been met. But so what? Someone reasonably smart is attacking the problem where others would give up, and it seems like it will work in some cases. How is this anything but progress, even if it leads pumped-up New York Times scribes to declare premature immaculation and the absolute democratization of writing software?
Writing software without replicating every single piece of logic remains a fundamentally impossible problem to solve. But so does, say, providing code completion and related smarts that’s as good as statically typed languages to duck-typed languages, and we’ve already seen huge inroads being made that help achieve sort-of acceptable solutions. Putting effort into this sort of problem is worthwhile because while it’s likely guaranteed that you won’t solve it, you will make progress by chipping away chunks of the problem, and you will make it possible to solve parts of the problem, and that’s a useful contribution that in my mind legitimizes everything.
And of course, the most brilliant part of Intentional Programming isn’t about making people write code without writing code, it’s about developing the idea of collapsing a program in steps in order to take a bird’s-eye-view of a module. This is what comments and regions solve today, badly, and what could really use some smarter implementation.
I Discovered That My Castle Stands Upon Pillars of Salt and Pillars of Sand
Today was perhaps the fifth time I went back and read up on Intentional Programming. It’s the brainchild of Charles Simonyi. (He happens to have invented the often misunderstood concept of hungarian notation — if you think it’s horrible, you’re probably just applying it horribly — and if I wanted to be facetious I could claim that Intentional Programming was his way of trying to make up for it, but I don’t, so I won’t.)
Intentional Programming sounds completely ludicrous to any seasoned programmer. It’s about writing code that describes intent — instructions that read “print the numbers 1 to 10″ — instead of turing machine-centric imperatives — instructions that read “let i be 1, while i is less than 11, print i and then increment i by 1″. It’s ludicrous because it shouldn’t work, because if it would, it would have been implemented ages ago and we’d all be much happier. This is not a new problem. Yet Simonyi seems to have made it work somehow.
The core of the implementation of the idea is simple and compelling: start with describing the problem. Too many issues happen when you translate business logic — the thing that the program should do — to programming logic — the thing that the program tells the turing machine to perform in order to actually do this as a side effect. As the number of people that have to interact on these layers goes up, so does complexity, and so does the likelihood of someone translating something wrong, or of conflicting rules appearing. By first defining the problem as a set of interconnecting objects and rules, you short-circuit the problem.
Now that you have the appropriate building blocks, you can start writing the logic in a domain specific language. Here’s where the reception gets fuzzy. Apparently, the logic will be generated to compilable code. Apparently, this has gone far enough that a system for managing or somehow calculating pensions has been built by CapGemini, and apparently, the people can now enter their rules in the same way that they laid out their logic in Excel spreadsheets, only now the program is actually written for them by implication. But that’s mostly all we know.
It stands to reason that this way of solving the problem would work. If translation tends to fuck up the logic, stop translating, or at least invent a better, controlled way of translating. If you can rid the world of horrible Access/Excel/VBA “apps” where “everyone’s a programmer!”, so much the better. (I’m not opposed to solving those problems. I’m opposed to solving those problems in a way that makes the solvers half-assed practitioners of my craft, instead of practitioners of their own craft or even a new craft.)
Intentional Programming will hopefully play itself out over the next few years and give us an opportunity to watch. I could choose to focus on the difficulty of engineering decisions without an engineer at the helm at all times (how are the generated programs with respect to parallelism? speed? memory usage? how do you optimize or debug such a program?), but I’m instead just gleeful that anyone’s working on solving the underlying problem. This seems to be common case these days, what with MagLev and all. (Relational databases really heavy? Let’s throw them out and just use native objects. You’re going to use native objects anyway; let’s use them in a way that scales.)
And hopefully, it’s part of the ongoing shift towards asking “what?” instead of asking “how?”.
The Death of Swedish Democracy
The modern Swedish Democracy
* 1918 (Universal suffrage passes and is first practiced in 1921.)
✝ 2008-06-18 19:21 UTC (The ubiquitous wiretapping bill passes and will eventually become law.)
~
WHEREAS this law attempts to covertly legitimize organized illegal activity by the National Defence Radio Establishment for the past 30 years,
WHEREAS this law bestows upon the National Defence Radio Establishment power to in effect constantly wiretap every Swede attempting to converse over cellular networks or navigate to servers outside the local network,
WHEREAS recent and historical events have uncovered the National Defence Radio Establishment’s disrespect for powers established to control it as well as its inability to prevent leaks,
WHEREAS this law’s refocus from listening to ethereal frequencies to allowing actual wiretapping will, in a very profound way, change the bulk of the underlying traffic from commercial and governmental to personal correspondence,
WHEREAS the aforementioned power infringes on the European Convention on Human Rights, Article 8, a law that is by constitutional mandate endowed superiority over every other Swedish law save the Swedish Constitution itself,
WHEREAS the aforementioned power also severely cripples fully half of the Swedish Constitution in effectively removing the right from inquiry into anonymity by public authorities set forward both in The Fundamental Law on Freedom of Expression (Chapter 2, Article 4) and in The Freedom of the Press Act (Chapter 3, Article 4),
WHEREAS the circumstances under which this law was discussed, debated and attempted repeatedly to covertly pass is a disgrace to the political system,
WHEREAS the law is passed under the guise of attempting to guard the Swedish nation from foreign threats, legitimate examples thereof which could (and are, and have) easily and routinely circumvent this wiretapping by routing around the Swedish borders and applying encryption, and
WHEREAS the creation and movement to pass this law has been in violation of The Instrument of Government (the first law in the Swedish Constitution), Article Two, which contains the passages “Public power shall be exercised with respect for the equal worth of all and the liberty and dignity of the private person.” as well as “The public institutions shall promote the ideals of democracy as guidelines in all sectors of society and protect the private and family lives of private persons.”,
WE, THE PEOPLE OF SWEDEN, impeach the following public servants on charges of high treason:
Tina Acketoft (fp), Jan Andersson (c), Yvonne Andersson (kd), Gunnar Andrén (fp), Staffan Anger (m), Staffan Appelros (m), Sofia Arkelsten (m), Lena Asplund (m), Stefan Attefall (kd), Gunnar Axén (m), Hans Backman (fp), Eva Bengtson Skogsberg (m), Finn Bengtsson (m), Ulf Berg (m), Sten Bergheden (m), Anna Bergkvist (m), Sven Bergström (c), Per Bill (m), Gustav Blix (m), Helena Bouveng (m), Anita Brodén (fp), Katarina Brännström (m), Ulrika Carlsson (c), Mikael Cederbratt (m), Margareta Cederfelt (m), Staffan Danielsson (c), Inger Davidson (kd), Kjell Eldensjö (kd), Lars Elinderson (m), Annicka Engblom (m), Hillevi Engström (m), Annelie Enochson (kd), Karin Enström (m), Jan Ericson (m), Erik A Eriksson (c), Jan Ertsborn (fp), Mahmood Fahmi (m), Fredrick Federley (c), Eva Flyborg (fp), Inge Garstedt (m), Mats Gerdau (m), Karin Granbom (fp), Rolf Gunnarsson (m), Holger Gustafsson (kd), Lars Gustafsson (kd), Walburga Habsburg Douglas (m), Liselott Hagberg (fp), Björn Hamilton (m), Carl B Hamilton (fp), Ann-Charlotte Hammar Johnsson (m), Krister Hammarbergh (m), Anders Hansson (m), Lennart Hedquist (m), Emma Henriksson (kd), Lars Hjälmered (m), Christian Holm (m), Isabella Jernbeck (m), Annie Johansson (c), Bengt-Anders Johansson (m), Jörgen Johansson (c), Mats Johansson (m), Jeppe Johnsson (m), Christine Jönsson (m), Reza Khelili Dylami (m), Marianne Kierkemann (m), Dan Kihlström (kd), Anna Kinberg Batra (m), Bertil Kjellberg (m), Margareta B Kjellin (m), Maria Kornevik Jakobsson (c), Tobias Krantz (fp), Sofia Larsen (c), Nina Larsson (fp), Olof Lavesson (m), Björn Leivik (m), Lennart Levi (c), Anna Lilliehöök (m), Göran Lindblad (m), Lars Lindblad (m), Lars Lindén (kd), Else-Marie Lindgren (kd), Kerstin Lundgren (c), Maria Lundqvist-Brömster (fp), Ulla Löfgren (m), Malin Löfsjögård (m), Fredrik Malm (fp), Betty Malmberg (m), Göran Montan (m), Karin Nilsson (c), Mats G Nilsson (m), Nils Oskar Nilsson (m), Rolf K Nilsson (m), Ulf Nilsson (fp), Andreas Norlén (m), Kent Olsson (m), Mikael Oscarsson (kd), Johan Pehrson (fp), Sven Gunnar Persson (kd), Sven Yngve Persson (m), Désirée Pethrus Engström (kd), Göran Pettersson (m), Lennart Pettersson (c), Karin Pilsäter (fp), Maria Plass (m), Jessica Polfjärd (m), Marietta Pourbaix-Lundin (m), Annika Qarlsson (c), Helena Rivière (m), Eliza Roszkowska Öberg (m), Hans Rothenberg (m), Rosita Runegrund (kd), Lennart Sacrédeus (kd), Mats Sander (m), Fredrik Schulte (m), Birgitta Sellén (c), Ulf Sjösten (m), Lars-Arne Staxäng (m), Ola Sundell (m), Elisabeth Svantesson (m), Ingvar Svensson (kd), Henrik Sydow (m), Solveig Ternström (c), Ewa Thalén Finné (m), Göran Thingwall (m), Roger Tiefensee (c), Gunilla Tjernberg (kd), Tomas Tobé (m), Stefan Tornberg (c), Lars Tysklind (fp), Peder Wachtmeister (m), Hans Wallmark (m), Marie Weibull Kornias (m), Barbro Westerholm (fp), Cecilia Widegren (m), Allan Widman (fp), Cecilia Wigström (fp), Rune Wikström (m), Christer Winbäck (fp), Ingemar Vänerlöv (kd), Claes Västerteg (c), Solveig Zander (c), Anders Åkesson (c), Per Åsling (c);
AS WELL AS the former and current Ministers of Defence:
Sten Tolgfors (m), Mikael Odenberg (m);
INCLUDING the current Prime Minister of Sweden:
Fredrik Reinfeldt (m);
AND the Minister of Defence under whose administration work on the original bill began:
Leni Björklund (s).
~
The Internet, 2008.