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

Interestingly, 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.



I'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.


There 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.


That 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.


It's almost as if algebra would also make more sense with better variable names, rather than simple letters...


It 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.




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

Search: