Programming languages considered harmful.

[New thread, spawned from the “Nicholas’ Simple Unity Tutorials” thread in the Support forum.]

This post is a reply to the question: How would I change how software development is done?

Incidentally, the title of this thread would happen naturally if the path I suggest is followed:

Programming languages are differentiated almost exclusively by their organisational and structural scaffolding. Eliminate the need for that stuff to be in the programming language itself and the very need for the Tower of Babel ceases to exist.

So what is the first step along that path?

Simple: Get rid of the dumb, flat, text files.

Store the raw code in a database. Each class or module becomes a record; each function / method becomes a sub-record in the database. Variables are just fields in the record.

This isn’t merely the first step: it’s the only step needed to bring development kicking and screaming into the 21st Century. Everything else follows on directly from this fundamental change.

Once you’re doing it this way, it’s easy to see that we can abstract all the structural and organisational scaffolding into the database’s structure and the IDE itself. All that’ll be left is the ‘naked’ instructions.

Now you can start thinking about using the database’s strengths to improve the quality of the code: define contracts for your functions and classes; the database structure makes it trivial to store this as metadata.

Speed up the compilation process too: the unit of compilation becomes the individual records. Spread this process over all the clients and even the server itself – no more long compile-and-link cycles. There’s always an compiled version ready to test.

Massive improvements in scaleability, versioning and project management. Check-out code at the function level, not just at the text file level. Versioning comes practically as standard and is trivial to implement. The database can be accessed however you please – online, offline, remotely, in-house, wherever. Metrics can be improved too.

You can build – even generate – entire test suites just by analysing the metadata in the database. You can build all sorts of tools that would be utterly impractical for current development systems.

Furthermore, eliminating all that language-specific organisational and structural fluff leaves us with something truly portable and, most importantly, reusable. Now you can do real black-box programming. You can build programs as easily as if you were using LEGO bricks. Need a quicksort? Search a trusted website for one with matching contractual requirements and you can literally drop it right in, sight unseen.

View your application any way you damned well please! Export it in any language you like (within reason)! View it as a 3D model, zooming out to see the big picture, or drill right down, into the blocks, and into the underlying raw code.

This is all blindingly obvious stuff and I’m even not the first to suggest it. I’ve banged on about it at length in the GameDev.Net forums over the last few years already. It’s a complete and utter no-brainer solution to so many development bottlenecks.

The key obstacle is that someone has to take the first step and commit to it. They’ll have to use current tools to build that first iteration, but Unity might be a good starting point too.

That “someone” isn’t going to be me. I don’t like programming for its own sake; I know how to change a fuse too, but that doesn’t mean I’d enjoy rewiring my house.

(Okay, I lied about demolishing the Tower of Babel. If this industry has taught me anything, it’s that getting two IT companies to agree on a single, global, standard is about as likely as convincing the Pope to renounce Catholicism. Nevertheless, I hope it’ll be a much shorter, less annoying, tower.)

Software development will still be a complicated thing, no matter what: No Silver Bullet - Wikipedia

I would recommend that you check out Eiffel
It sounds like a language for you :slight_smile:

Otherwise: sounds all nice and fine but it won’t happen the next 20 - 40 years.
Given that C-Trash-Trash survided till 2009 even thought it has been outdated since at least 1999 already means that the current major languages will survive for a pretty long time due to all the libraries that are written with it.

Also there are many holes in the idea that work fine in theory but would cause some pretty ugly problems in practical environments.
Generally your assumption that a function could be the lowest unit of blackboxing and “stand alone functionality” will already ensure that the Pope will become buddhist before such an environment happens for major software development.

Language design and formalisms haven’t wasted hundred tousands of men hour of scientific research the past 20 years on parallelism, object oriented development paradigms and alike to drop it again. It will be expanded and further refined but there will definitely not be a step back to stone age as you would like it to happen (and operating on function level is a step back to stone age). At least not within the major languages.

The only languages where this can and potentially will happen are functional languages like Haskel
They are fine and powerfull in their own way but haskel and OO-languagges are two distinct worlds and the chances that you win in lottery is several milliards higher than that those two fundamentally different designs will merge within your lifespan.

@stimarco
Just wondering, what do you do for a living?

I generally put “Writer” on forms which ask this, but I’m currently making a game for the first time in some years. Partly as a favour to an old friend, but mainly to prove to myself that I can still do it. (It’s been over 15 years since I last designed and built my own game entirely single-handed.)

Long-term, I plan to write books for a living as people tell me I’m a pretty decent writer. (I’ve been researching the relationship between Story and Play over the past few years. I have some pretty mad ideas about those too.)

I’ve been self-employed for most of my working life and prefer variety over notions of a career. I’ve been a (professional) game designer, developer, graphics artist, musician, technical author, writer, school administrator, manager, business owner and even a land surveyor’s assistant at various points in my life, though not necessarily in that order.

I also have a deep-seated hatred of open-plan working environments. I’ve never learned how to tune out background noise and distractions and have come to the conclusion that I’m pretty much unemployable. (The mood swings I get when I forget to take my diabetes medication don’t exactly help either.)

I’ve no idea where I’m headed, but I’m rather enjoying the journey.

Already have. And SmallTalk, which took some steps in this direction too. They’re interesting, but nowhere near there.

Programming languages miss the point, which is that programming language design has been focused on the related problems of organisation and structure. What the designers never seem to grasp is that a programming language is just a user interface. Nothing more.

There is absolutely no reason today for programming to take place solely using text-centric interfaces. Even human communication is mostly gestures and visual cues; language itself is used for less than half of all communication between humans.

Most users have moved on from purely textual UIs, but programmers seem to be positively obsessed with them. Imagine if the games industry had stuck with text adventures – sorry, that’d be “Interactive Fiction” – for fifty years.

I could understand if there were some meaningful choices other than all these text-based software development UIs, but nobody seems to be interested in providing any. I’d even settle for something that meets me halfway, but we don’t even have that much choice. It’s all textual languages.

I honestly find this intriguing: surely I’m not the only one looking beyond textual UIs for software development tools?

Seems appropriate. Copyright ESR as far as I know.

Master Foo Discourses on the Graphical User Interface

One evening, Master Foo and Nubi attended a gathering of programmers who had met to learn from each other. One of the programmers asked Nubi to what school he and his master belonged. Upon being told they were followers of the Great Way of Unix, the programmer grew scornful.

“The command-line tools of Unix are crude and backward,” he scoffed. “Modern, properly designed operating systems do everything through a graphical user interface.”

Master Foo said nothing, but pointed at the moon. A nearby dog began to bark at the master’s hand.

“I don’t understand you!” said the programmer.

Master Foo remained silent, and pointed at an image of the Buddha. Then he pointed at a window.

“What are you trying to tell me?” asked the programmer.

Master Foo pointed at the programmer’s head. Then he pointed at a rock.

“Why can’t you make yourself clear?” demanded the programmer.

Master Foo frowned thoughtfully, tapped the programmer twice on the nose, and dropped him in a nearby trashcan.

As the programmer was attempting to extricate himself from the garbage, the dog wandered over and piddled on him.

At that moment, the programmer achieved enlightenment.

Just a little bit of disclosure… Sean (stimarco) wrote the 3rd Person Platformer tutorial for UT. Take that for what it’s worth when reading his posts.

Ethan

I dunno, but I’d think you would think (as a writer) it is easier/better/clearer to communicate meaning through use of words. All great works of literature are composed of pages and pages of text… pictures, in any, are merely icing on the cake. Text is the best method humans have to document thoughts (in any real detail).

As a UI designer as my day job, I often think the same thing about programming languages.

And I do see the Unity Editor as taking it beyond just Text. Defining a gameobject for a script using the unity editor is a great example.

And I also see IDEs as taking programming beyond “pure text”. Many people use C# just to get the “magic” that the MS Visual Studio IDE gives you. The final output may be text, but the creation of that text comes from a lot of different tools that the Visual Studio IDE give you.

I’d love to see a ships-with-Unity editor that does that kind of magic, and beyond. There’s a lot more UT could do to improve the scripting experience.

Ultimately though if you’re going to change the way programming is done, you need to ask yourself why you’re changing it. For example, many have developed scripting languages in an attempt to make programming accessible to non-programmers. But by and large they fall into an awkward middle ground: they’re not standard enough for CS programmers to use, but they still baffle the non-programmer.

Definitely. I love the game object paradigm if you will. It sort of brings object oriented programming to a whole new field without actually changing any of the fundamentals of the game.

Um… I read you original post again and I see now that you aren’t really saying you want to get rid of text-based programming. Your just saying we should define the structures in a database. … Well, ok. But I would argue that most modern IDEs are basically doing that for you. For instance Visual Studio builds a table of classes, methods and properties in order to help with navigation and code-completion. Also, Visual Studio offers a view that allow the developer to create/design classes/methods/properties visual, very much like designing a database visually.

I remember interviewing for a project on Interlisp (Xerox Dandelion) machines a long, long time ago and being told those systems used a source code database instead of flat text files. This recent post on comp.lang.lisp mentions also Dylan and Smalltalk.

http://www.archivum.info/comp.lang.lisp/2008-02/msg02089.html

which points to this paper on the Interlisp programming environment, if you enjoy reading about the good old days of programming:

I didn’t work on those systems, but I did use a Symbolics Lisp Machine and everyone who developed in those environments miss them. Aspects of $100k+ workstations developed specifically for programming by programmers just didn’t survive the migration to Unix and DOS. On the other hand, if you see one of those machines still around, they look pretty creaky.

You are that guy that keeps writing routines in php to store images in blob fields in a relational database!

I have been looking for that guy, so I can beat him.

I consider programming to be a form of writing, creatively and esthetically, so to say a “programming language is just a user interface” which should move away from text, that makes as much sense to me as saying written language is just a user interface and this thread, not to mention any books you want to write, should move away from text.

I suppose one could stretch the analogy and say, well, people write comics and something like Unity where you can move snippets of script around in a visual representatation of a game is a modern and interesting way of expressing code. I’d go with that (and recommend reading Scott McCloud’s books), but I’m not wholly sold on programming the Unity way (after attaching a handful of scripts, it can get difficult to reason what’s going on), and I’m more concerned with the VB-ization of programming - wizards and drag-and-drop GUI building and all the IDE’s that hide ugly things like shells and compilers and text. Part of the problem is the spate of languages that are just remixes of syntax and old ideas, usually in the direction of increasing complexity. Java is Lisp wrangled into a C++ look-alike (in turn a hack on C which is barely an abstraction layer above assembly language) and Objective C is slowly turning back into Smalltalk. And don’t get me started on all the scripting languages or the MS language du jour (the thing I hate most about Unity is switching between Javascript and C# syntax). Functional languages, as mentioned by others, are clearly an advance, which reminds me - are we going to see F# in Unity?

Anyway, another part of the problem is that programming is mainstream (look at all the Dummies, For Teens, and In X Days books on the shelf) and there are a lot of people who don’t like programming and just want it to be easy, and a lot of them happen to be programmers, because for something you might not like doing, it pays pretty well - the result is like my home remodeling projects, messy and structurally unsound because I don’t have the patience or interest. If you developing an allergy to programming because you’re stuck with a horrible API (I liked learning Java because of the API, I hated Win32 because of, well, Win32), chances are it was designed by a programmer who doesn’t really like to program.

All that said, there are some interesting visual environments for constructing interactive 2D and 3D, e.g. http://www.alice.org/ , http://scratch.mit.edu/ and StarLogo TNG – MIT Scheller Teacher Education Program And for those fond of the written word, I have some friends who have a nifty text-to-3D scene generator at http://www.wordseye.com/

You’re not talking about relational databases here, or are you? Relational databases are by their very principle bad at storing hierarchial data or even worse object-oriented data. Okay, it is being tried again and again … but so far, I wouldn’t call it established by any means (so, usually it’s just proprietary solutions). OO-databases? Hm … haven’t heard of any in a while (but I also lost interested because it turned out that almost everything I use databases for is … guess what: relational data :wink: ).

So, I’m not really sure what kind of database you’re thinking would be so great to store code (storing some metadata is a different story but that’s already done in modern IDEs today, so that’s nothing new).

Just wondering: Have you worked with recent IDEs like Visual Studio or Eclipse? I mean, Visual Studio 2005 or 2008 (which has nothing to do with what Visual Studio was a long time ago when you still used it to code C++ nightmares). And, if you did: Have you had a chance to use the modern features these tools provide? Stuff like Intellisense (which is way more than just simple “code-completion”), code-folding, advanced refactoring, inline documentation (i.e. while you type a method name, you already see the documentation of that method), inline method viewing (available in Eclipse: you can see the actual implementation of a method you’re using while you’re using it - without having to browse to that method).

Just to name a few.

Have you worked with simultanuous roundtrip engineering UML tools? I think Together/J was the first one that really did that very well (for Java but I think it’s now available for most “relevant” programming languages). You can literally make changes to the “visual model view” and see how that changes the code, or the other way round (admittedly, usually only in static class diagrams; but I think sequence diagrams are also supported “pretty well”).

15 years ago, programming was a completely different thing from what it is today. Of course, you can still use all the approaches you did 15 years ago - and then it’ll look like there was no progress. However, if you use what’s there right now, with the concepts available right now … well, you wouldn’t even dream of using Unitron (really, that’s the kind of tool you did use 15 years ago … but I think even Emacs was cooler, back then).

I’ve said it in some other thread before: Using Unitron for programming is almost like using a text-editor for writing coordinates of verts into a text-file for modelling. You just don’t do that today (unless you’re a masochist). It’s fine to hack together a few lines of simple code (but even for that, I wouldn’t use it) - but for any serious development, it puts you 10 or 20 years to the past. IDEs like Visual Studio or Eclipse or not “just a better Unitron” - they are a whole different way of developing software. The one that’s used widely today.

Personally, before trying a “non-code based approach to programming”, please UT, first support what’s standard today and give us proper support for namespaces (well, actually, I’d prefer “packages” but those aren’t available in .NET/Mono, so I’ll be happy with what is “as close as it gets”). MonoBehaviours having to be in the root namespace is really not fun.

And, maybe use proper namespaces for you own API, too. Only two namespaces (one for editor-stuff and one for engine-stuff) really looks way too much like … dare I say it … Win32 (which is that “15 years” ago kind of thing). You don’t design APIs like that today. And you didn’t 10 years ago (that’s one of the few things I really do not like about Unity at all).

The reason I bring this in here: Not having proper namespaces makes using tools like UML modelling tools significantly harder. And all the workarounds that exist don’t help much on that end. So that’s one of the very few things were Unity feels a little “dated”.

In my opinion, if that limitation was removed, you could use UML + “the Unity way of handling game objects and components” in a smooth workflow. Add some of the editor extensions that are already there or coming (Tempest keeps on teasing us, and AngryAnt already got some cool stuff out - and I’m sure there’s much more to come).

Of course: UML is not the “develop cool MMORPG button” that some people ask for (you still need to learn something) … but it’s the form of “visual programming” that’s a standard and is used by lots of people.

@Ethan: Seems like Sean won that contest for now, but I was very close … and, hey, man, we’re doing that without code completion … why don’t I have an IDE for WRITING??? … oh, I know: my postings might get even longer, but think of an IDE that condenses text :wink:

Ok you’re going to have to explain your thinking here in much greater detail.

While I clearly see where you are comming from I’ve to highly disagree.
There is nothing I hate more (really) than visual programming attempts and I’ve been forced to work with different ones in the past.

They are great for designer type of users, who are not able to structure their code as they require it and write large object systems.

But for a programmer they are pure nightmares, because they force you to do stuff in a specific way and often do stuff in a stupid longwinded way that would normally have taken you a few moments.

I agree that it makes sense to design the common structure and object relations through visual tools (Eiffel as an example of a really powerfull environment on that end. But there are quite a few tools that are able to use UML to create real code bodies and vice versa), but there is and never will be an intelligent reason for me to use a similar approach for the common code.
Flow diagrams have not vanished for no reason. If they were any usefull within a 1 - 100M code lines environment, they would still be around or would have been driven further.

But you can not represent massive code bases (especially parallel non streaming code) in a usefull way to make it still maintanable and thats after all the one and only real requirement beside “it does what it is intend to do” code has to meet.

There are special cases where it is possible, and for those situation I see such technics fitting into the picture pretty well.

But they do not and likely never will fit for common development on the whole scale.

This reminds me of my first introduction to Joomla, which is the focus of much unbridled hatred and fury. It’s a Content Management System for a website. Joomla may make certain things easier, but you have to do it the Joomla way, and if you want to do something not included in Joomla…it’s painful.

It’s like if you’re an artist and you have a pencil for drawing. Now imagine me taking away that pencil and replacing it with a rubber stamp of a duck. Now I ask you to sketch me a picture of an automobile.

That’s how I feel with Joomla. They ask me to sketch a picture with a duck stamp. If you want a website, then let me craft you one. Let me sculpt you one. Let me freely make you one. Getting that skill, and technique to make websites took years, and that was just the technical know-how, not even the ‘artistic’ part.

While I can see the appeal of Joomla, and any program which reduces the coding requirements (hell, I’m making one…), there is something far greater and more beautiful about raw code.

Because it is more limitless. It’s the pencil, instead of the stamp, and you can draw anything you want limited only by the graphite and the surface you’re drawing on.

Duck stamps are fun, but are not for everyone.

@technicat: Thanks for the link to Alice - I think that’s a rather interesting project. However, this is not so much about programming - it’s about learning programming. For that, I believe it is a very good approach (I actually consider suggesting that to my 12-year old niece as a step before getting her in contact with Unity) … and even better: Once you’ve learned to “walk” with Alice, you can take your projects to “run” with Java (at least in Alice 3.0 currently under development). From there, moving to C# should be easy.

And I’m sure Quietus will like http://www.wordseye.com/ :wink: … see My fellow Unitoids :wink: