4 ms·
I'm all for writing more readable code. Why hasn't pseudocode won ages ago?
by keyle 16y ago
I'm all for writing more readable code. Why hasn't pseudocode won ages ago?
- apl 16y agoLooking 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.]
- arethuza 16y agoOf 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.
- emilis_info 16y ago(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.
- mckoss 16y agoCreating 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.
- wladimir 16y agoThanks, 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
- emilis_info 16y agoIs it the same as MSI installers that people are complaining about in the bottom thread? :-)
- wladimir 16y agoNo, it's different. That's table-based programming.
- wladimir 16y agoMaybe 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.
- kyleburton 16y agoFeynman 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?
- onan_barbarian 16y agoWe 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.
- wladimir 16y agoYes, 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.
- gaius 16y agoIt did. Have you ever read any COBOL? It reads just like stilted English.