5 ms·
I 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
by gravypod 10y ago
I 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.
- e12e 10y agoIt's almost as if algebra would also make more sense with better variable names, rather than simple letters...
- nickpsecurity 10y agoIt would. Start with the word problem. Define some variables maybe big or short-hand closer to actual description. Then use algebra with those variables to model the problem in math. Solve it. Others understand it more easily in peer review. Much like programming and code review.
- jonathankoren 10y agoThere is a definitely antipattern that comes from mathematics where variables are cryptic in an effort to look like math, and also I believe to try and show off how smart your are. However, in some domains, the single letter variables become standard. In IR, w means word, d means document, D means the document corpus, and the like. Of course, w sometimes means "weight" when applied to a x, which maybe mean an document d. It's a damn mess.