Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm all for writing more readable code. Why hasn't pseudocode won ages ago?


Looking at Python, Ruby, Pascal or BASIC, I'm wondering how much closer one can get to (what you call) pseudocode without sacrificing formal consistency and, well, usefulness. AppleScript is lurking just around the corner, and you do not want that.

Also, syntax is superficial. Sure, some languages remain clunky and verbose even after getting to know them, but more often than not there's a reason why a language "looks" the way it does. Take J, for instance. It's a syntactical nightmare at first. But once you get used to the intricacies and discover the semantics, its code becomes oddly efficient and you wouldn't want it any other way.

[EDIT: Moreover, graphical representations of code aren't as desirable as you'd think they are. You can find plenty of attempts at turning UML (and similar stuff) into a proper programming language. It's about as cool and helpful as using Word when you could have emacs and LaTeX.]


(OP here) I don't think plain-text source code will ever be replaced as the main way of writing programs.

It is simple, transparent, has accumulated very large number of tools for analyzing and editing it (think of all the UNIX utilities or the complexity of IDEs).

However most of the non-plain-text methods (like UML) help you get a bird-eye view of what you are creating.

Also Humble can be embedded in rich text (like HTML) so it may have some niche uses as a real programming language.

I have built a prototype blog that you could re-program with Humble via WYSIWYG editing some time ago. It was brittle (you could break the website by errors in the main template) and slow, but it was fun to do everything in the browser.


Creating a programming system where the primary representation of a program is not text, but rather a dynamic data structure is the core idea behind Intentional Programming (Charles Simonyi's post-Microsoft company).

    http://intentsoft.com/technology/overview.html
This is Charles's ultimate "going meta" idea to try to advance programming beyond our 1960's metaphor representing programs as raw text.

It's not been widely adopted, so the company is selling it into markets where you want domain experts to be able to "write code" rather than have them hand off a spec to a programmer. It's kind of a domain specific language (DSL) compiler generator.


Thanks, that's interesting. It is really hard to find these kind of systems in the wild.

I've read a bit about the SCID (source code in database) paradigm, and it seems similar, representing the code as a graph database. But it seems mainly about people talking how great it would be instead of implementing it and putting it to the test :P


Is it the same as MSI installers that people are complaining about in the bottom thread? :-)


No, it's different. That's table-based programming.


Maybe we just haven't found a good graphical representation for code yet. For example, UML is too heavily rooted in OO-extremism, which makes it less practical for quickly building solutions to real-world problems.

If we had such a representation, it'd give interesting prospects for programming with a tablet/touch interface.


We have found a good graphical representation for code, in my opinion. We make 'blocks' by tabbing in, draw lines with '/////', and desperately try to make comments seem to hang next to the code to which they refer by putting whitespace in the right place...Code is already 'sort of graphical'; unfortunately, the graphics in question are ASCII art.

I suspect the brain-to-computer interface for tablet/touch interface is too narrow, at least for that kind of thing (input of a big bunch of discrete symbols). Tablet/touch interfaces might be nicer for viewing or better yet debugging code; I'm daydreaming of being able to pull out a variable and 'expand it' in some handwavy fashion.


Yes, it will be awesome, imagine that you could draw real art in your code instead of ASCII art! You could illustrate your code with cartoons instead of stick figures using \ o / :)

On a more serious note, is there any fundamental reason that we'd need a big bunch of discrete symbols? If you look at the evolution of language development, we already went from machine code, which is extremely verbose, to languages like Python/Ruby which are pretty concise.

If we continue this, we'll eventually be high level enough to not think in terms of statements but in terms of data transformations, filters, queries, reductions, etc.

And with touch you could already do a lot with making input context sensitive. Only show the options that make sense at that point. Hardly a need to show a full keyboard unless typing some identifier for the first time.

Anyway, it's very interesting to think about what is possible if you leave behind current assumptions such as code=text.


I think the reason that we need a big bunch of discrete symbols is because our brains are good at spewing these things out in a stream.

For example, I just typed a bunch of words at you. I didn't have to 'interact' with the computer at each step, even though I suppose I could have used a touch interface where I typed the first letters of each word and then hunt around from a list.

We're good at being able to say that something is going to be equal to (-b + sqrt(b^2 - 4ac))/2a, for example, by blasting out a bunch of different symbols that the input system is unlikely to be able to anticipate. I can't type that formula as fast as I can gibber away in English... but I can still do it pretty smoothly without having to drop into a 'select things from some sort of menu' mode.

This is made worse by the myriad of perfectly useful operators in a language like C, as well as all the variables that may be defined at that moment. I think discrete symbols are a fine way of expressing this.

All those things that you talk about 'instead of statements' are fine things, but just as information-dense as a good-quality statement and will still call on you to express an idea drawn from a huge space of possibilities.

Definitely in agreement on how interesting this all is as a concept. This would be my toy project if I had time for toy projects. :-/


I am glad my post inspired this discussion :-)

I bought a tablet only recently and am frustrated that I haven't found a convenient way to write programs with it. I hope some day I will.


National Instruments' LabVIEW is a really good graphical representation of code. However, my experience was that it got frustrating after the program got larger than about 40 subroutines because each subroutine gets its own graphical window (two, actually: one for the UI and one for the code). This leads to a lot of clutter and it gets hard to debug. That and debugging loops or errors in a complex algorithm in a graphical setting is not fun. Text based is a lot more efficient.


Feynman diagrams are the only thing that comes to mind - mathematicians and physicists still use a code-like notation to describe concepts. Are there any examples from those areas to use as a guide?


Of course in the opposite direction you have people who insist that they can develop software as UML diagrams, and you don't want that either.


It did. Have you ever read any COBOL? It reads just like stilted English.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: