8 ms·
A Paper Algorithm Notation
- nemo1618 10y agoThis is really neat! It's fun to imagine what true 2D programming could look like, unconstrained by bitmap fonts. I'll state the obvious, though: this isn't going to be useful for the #1 time I need to code on a whiteboard: interviews. Both parties need to be familiar with the syntax in order for it to be useful. Tangentially related: check out these alternative musical notations: https://www.quora.com/What-are-some-alternatives-to-standard-written-music-notation https://www.quora.com/What-are-some-alternatives-to-standard...
- michaelchisari 10y agoA couple years ago, I played around with the idea of a "shorthand" for algorithms, specifically for whiteboard interviews. https://github.com/michaelchisari/scrwl https://github.com/michaelchisari/scrwl It was based on shorthand writing systems that emphasize a minimal amount of strokes, and the ability to continue strokes into each other.
- titanomachy 10y agoDid you get around to writing examples? None show up for me.
- michaelchisari 10y agoI didn't, unfortunately. Other projects ended up taking priority.
- nickpsecurity 10y agoCheck this one out as it's actively developed: http://witheve.com http://witheve.com Most of the visual, programming environments failed. The successful ones still did text for the logic. Scratch, made to teach kids, was a neat hybrid that made text visual in a lego-like way that made connecting pieces easier.
- argonaut 10y agoThis seems overcomplicated. Theoretical computer science papers just write the algorithm in words, using widely accepted mathematical notation wherever they can (e.g. sigma for sums, set notation, and so on).
- seanmcdirmid 10y agoIt seems that this isn't for CS paper writing, but for writing pseudocode during design, which needs much more flexibility than communicating results in a POPL paper.
- nickpsecurity 10y agoRegular pseudocode, formal specs close to programming (eg VDM language), and graphical stuff like Statecharts worked well in industry for a long time. Including for high-assurance systems where ambiguities lead to catastrophic failure. Middle option was advantageous where it was precise enough for tools to catch errors or prove properties. Any of these worked well enough and didn't look as weird as OP to average programmer.
- seanmcdirmid 10y agoThose are fairly established notations that...when hey first came out, weren't as obvious as they appear now. It is unfair to expect that pseudo code notations be static at this point in history when new programming languages that look "weird" pop up all the time.
- taeric 10y agoI've been a huge fan of computer science papers going the literate route. Imagine if more were of the variety of https://smile.amazon.com/dp/0123750792 https://smile.amazon.com/dp/0123750792. Though, I also feel that that adds to the time of creating these papers. So, by my own view this might be more expensive than it is worth.
- argonaut 10y ago
- happynewyear 10y agoLooks like he's got another potential gem here: http://canonical.org/~kragen/memory-models/ http://canonical.org/~kragen/memory-models/
- akkartik 10y agoOh yeah. That whole site is a gem.
- kutkloon7 10y agoHm, I thought the point of pseudocode was that it is simple to write down, and everyone understands it. This misses both of those advantages.
- seanmcdirmid 10y ago"Everyone understands it" is not a goal of psuedocode.
- rootlocus 10y agoSince it abstracts a programming language and allows for simplified syntax and inline explanations, more people can understand it. Why would you think that's not a goal?
- seanmcdirmid 10y agoEveryone understands it implies that everyone understands it, regardless of background or knowledge or whether they know programming or not.
- EpicEng 10y agoOnly to the extremely pedantic.
- seanmcdirmid 10y agoNot pedant at all, I'm sure parent meant exactly what they said.
- EpicEng 10y agoNo reasonable person here would regard "everyone" to include e.g. Sally in accounting. Psuedo code is obviously for people who write code.
- natch 10y agoClearly there is room for improvement in this area. But I'd rather see papers include code snippets. If a widely used and highly readable language is used (Python, for example) then the meaning of what is going on would be much more clear, and in some cases could be immediately tested out with ones own data or at least played with in an existing, widely installed, live system.
- gravypod 10y agoI think ideally a psudo-code should be directly translatable into any programming language. It should be dead simple. It should use all of the best practices of the most common programming languages. It should be typable. None of this garvage of arrows and triangles. I'm not Greek, I don't have that kind of stupid keyboard. Also, it should follow programming practices for variable names. Rather then A, B, C, D, X and the lot use forward_momentum or ForwardMomentum. We're not using typewriters any more. The extra few keystrokes for typing out words, and not symbols, is well worth it.
- nickpsecurity 10y agoInterestingly, exactly how it's done in almost every academic paper or article on software I've read outside some really niche ones. Plus most prototypes in industry that were done as UML, Visual Basic, etc. Python got somewhat popular in this niche as it's quite readable & high-level. The people downvoting these comments don't represent a majority opinion on pseudocode in any way. Quite the opposite.
- gravypod 10y agoI'm an undergrad and I'm currently working with people in the physics. All of their code, python or not, uses N, n, and x as the most common variable names.
- nickpsecurity 10y agoThat is a recurring problem. The structure is easy to follow. Variable names often suck. I think they get it from their Algebra and Calculus classes because that was first type of books I saw using those letters almost exclusively.
- politician 10y agoThere is a real need for a concise notation for collaborative whiteboarding, so I see this as a good start. I'd even go so far to say that as a notation for interviews, if the candidates were informed ahead of time, then I can see it working out better than the current approach for both candidate and interviewers. At the very least, you could see whether the candidate could learn a new notation, and that alone is a pretty valuable signal.
- nickpsecurity 10y ago"At the very least, you could see whether the candidate could learn a new notation, and that alone is a pretty valuable signal." I could see that as a benefit. Much like how they would have to learn unusual requirements or API's on the job then solve problems with them. A notation like this and basic specs might be a useful filter.
- anentropic 10y agocruel and unusual :)
- nateabele 10y agoI think the real question is, why is the amazing interactive simulation medium that we call a computer so abysmal at capturing and representing ideas (particularly ideas about the computer itself) that we have to resort to inventing a new notation for pencil & paper to deal with it?
- kevinwang 10y agoI don't think that's the issue here. It's the verboseness of code/pseudocode which this solves. The understandingness of code was not raised as a problem. This notation is not to say that ideas can be expressed better on paper with this notation, but rather that, in situations where you must use pencil (such as whiteboarding), code is overly verbose and this notation is less so. Then again, I do see some benefits of writing this on paper over writing code on a keyboard, like the flexibility of being able to write wherever you want, and write notes or pictures in the margins. But these are minor. Also I may have misunderstood your comment. Edit: actually, upon rereading: I guess you were referring to this line in the opening paragraph >But our programming languages are very poorly suited for handwriting: they waste the spatial arrangement, ideographic symbols, text size variation, and long lines (e.g. horizontal and vertical rules, boxes, and arrows) that we can easily draw by hand, instead using textual identifiers and nested grammatical structure that can easily be rendered in ASCII (and, in the case of older languages like FORTRAN and COBOL, EBCDIC and FIELDATA too.) which is an interesting thing to think about. So I guess your criticism of modern computers for representing ideas is valid. But I suppose the advantage of the more restricted inputs of a computer (keyboard into a 1d string of ascii text) is the structure that it inherently has, that paper and pencil does not. So there are tradeoffs.
- abecedarius 10y agoOne use is working out ideas when you're not sitting at a desk. You can easily carry around a small notebook which is much more usable than a phone for this. (If you have a favorite on-phone programming environment that's better, I'd like to hear of it.)
- agumonkey 10y agoReminds me of notation used un Old Lisp books (queinnec). Personally I find ml to be much of what concise and unambiguous hand notation should be. Probably why I like it.
- deleted 10y ago[deleted]
- Avshalom 10y agoCOUGH http://www.jsoftware.com/papers/APL.htm http://www.jsoftware.com/papers/APL.htm COUGH
- beagle3 10y agoEverything old is new again Ken Iversion originally designed APL as exactly this - an algorithm notation, then it was noticed that -- since this was well specified -- it could actually be executed. I urge anyone who finds interest in this to read Ken's "the description of finite sequential processes"[0], especially the description of the simplex algorithm[1], which is perhaps the most elegant I've ever seen. I am actually surprised that kragen did not mention APL more, as I know he is familiar with it, and he is usually pretty good about giving credit where credit is due. [0] http://keiapl.info/eemcd/keisimplexpages/keisimplex447.html http://keiapl.info/eemcd/keisimplexpages/keisimplex447.html [1] http://keiapl.info/eemcd/keisimplexpages/keisimplex452.html http://keiapl.info/eemcd/keisimplexpages/keisimplex452.html
- groovy2shoes 10y agoLisp was designed in the same way. As I recall, it was Steve Russell who demonstrated that it could be implemented on machines of the day.
- riazrizvi 10y agoI don't see the point of precise handwritten software notation. Pseudocode is a thinking tool because of its ambiguity and looseness. We need to process problems in a number of passes of increasing precision and correctness, so we want to start with something that is more vague than a programming language. When we are ready for precision we can write the code, using encapsulation to manage how much of the problem we bite off at a time. Also the point about pseudocode being unnecessarily cumbersome is not true IMO, because we don't need to adhere to any language syntax that we find redundant. I've never seen an audience to a whiteboard script complain about a missing colon or self/this keyword when the human context made it unnecessary.
- taeric 10y agoI actually have seen folks complain about missing semicolons. Luckily, they did not take the stance heavily and getting them to discuss it immediately led them to agree it didn't matter. I go so far as to say any coding in stuff like google docs can miss items like semicolons without a bat of an eye from me. Sure, they are typing. But if it is not their normal coding environment, the aesthetics and finer points of the language are... superfluous at best for the points I generally care about in that kind of correspondence.
- wyager 10y agoSometimes precision of a certain variety is useful for thinking out a program's design. When writing Haskell code, I will often write out the "obvious" parts as well as the types I think will be appropriate for the smaller, less obvious parts. You can define the type but leave the implementation undefined. Whether or not this typechecks tells me if I'm on the right path.
- grogenaut 10y agominor nit but this feels very much like it was designed by an academic in that I think you could do this in latex very easily but not at all in a standard text editor. Those horizontal and vertical lines. But otherwise you need a specialized program or a whiteboard to pull this off. Also all those math symbols. I don't know where those live in my input.