5 ms·
My problem with computer science pseudocode
- mememememememe 14y agoCRS book is okay... but it's way too complex for undergraduate. I rather listen to lectures than reading this book. I think even talent programmers have to agree with me that CRS is a reference, not a textbook for teaching. It's only for people who have done enough algorithms and data structure and want a reference book.
- Turing_Machine 14y agoIf you're looking for algorithms with real code, Sedgewick is pretty good. http://www.amazon.com/gp/product/032157351X http://www.amazon.com/gp/product/032157351X Disclaimer: I haven't actually seen this edition, which uses Java. My old edition uses C. Disclaimer #2: I still look into my copies of Sedgewick and Knuth fairly regularly. CLR(S), not so much. Your mileage may vary.
- pawelwentpawel 14y agoI remember going through Introduction to Algorithms back in high school. Not only I had problems with understanding it in general but in addition it was a translation. A very bad translation. I'm a big fan of The Algorithm Design Manual by Skiena. This is the book that I usually recommend.
- Xcelerate 14y agoThis is a general problem with academic books/papers. Authors rarely focus on making their work as easily understandable as possible. Instead, the goal almost seems to be the opposite -- how obscure sounding can I make this paper (so that I appear really smart) while still maintaining correctness? It's very frustrating. We get it: you're smart. Now quit using words like "complecting" and quit using elliptic modular forms when addition and subtraction would suffice instead. EDIT: Alright, so the downvotes indicate my post was a little rant-ish (I don't get downvoted much on here so it disturbs me when I do). I apologize for that. There were a few papers that I read recently where some of the words were very obtuse and I couldn't think of a good reason for choosing those over simpler and more communicative words. "Authors rarely..." was likewise an exaggeration. But I do stand by my point that clear communication is something I think technically-oriented people should focus on. Perhaps courses could be offered where you describe a complex subject and then others in the class comment on what areas were the most confusing. This is different than a peer-review process in that you're not necessarily focusing on the accuracy of the material but the clarity of its expression.
- johnbender 14y agoI understand where you're coming from (in your frustration at least), but where most academic papers are concerned this isn't an issue of attempting to sound "smart", it's an issue of audience. The audience of most academic writing is other experts in the same field, and the goal is to convey the contribution. Without the necessary abstractions, and therefore the requirement of understanding them, the task of composing works on meaningful contributions would be absurdly difficult.
- xanmas 14y agoSpeaking as the author of multiple academic articles (theoretical physics), I would fundamentally disagree with your assessment. We usually are trying our absolute hardest to communicate a new advance in the field in anywhere from 4-8 pages, references and introduction included. We're essentially trying to sum up (in my case) 2 years of work in as short of a space as possible so, to do this, we assume that the reader has a working knowledge of the foundations of the field but provide references to this. The references serve to 1) provide evidence for unoriginal claims that you make (every sentence that communications an unoriginal result should have a citation) and 2) allow those who are unfamiliar with the field to pick up the basics as quickly as possible. Unfortunately, some of our prose is a bit obtuse because it's reasonably common for scientists to blow off their humanities courses because they're not science -- not realizing that most of our career will depend on the quality of our writing. You shouldn't confuse our incompetence with malice though.
- Xcelerate 14y agoSorry, I guess a few bad experiences lately have given me in to hyperbole. I do research myself and at least with some of the papers I've read recently, I've noticed questionable vocabulary choices. I can't think of a reason for using certain obtuse words when a simpler word would be much clearer, but as you say, perhaps it is just the word that the researcher thought most apt.
- scott_s 14y agoOne's ability to use simple words to describe complex concepts is a function of not just understanding of the concept itself, but also mastery of the language. Consider that many (most?) of the research papers you've read were written by non-native English speakers. In my experience, people who are native English speakers have an easier time being both precise and concise.
- m0skit0 14y agoI have to diagree with your PoV for recursion. I personally don't have any problems if an alogrithm is iterative or recursive, specially if the recursivity is as simple as in your example. In fact, in such cases recursivity is even simpler to understand than iteration IMHO.
- johnbender 14y agoI came here to say something similar. I would go further and assert that once you're comfortable with recursion it's nearly always preferable where reasoning about execution is the primary concern. Discarding the mental overhead associated with index accounting and temporary variable state has a lot of value.
- acqq 14y agoI read the book much better than Rodrigo's Python code. The book writes about "max-heaps." Rodrigo tries to rewrite is to apply it on an array, uses confusing names where simple one letter names suffice, rewrites tail recursion which is anyway obvious that it can be substituted with a while loop, producing, at least for me, much less readable code. By the way, even in the production code I do use one letter names for local variables in the functions that span a few lines and where their use is obvious.
- jmaicher 14y agoUnfortunately I can't see the pseudo code you are criticizing. But I have a degree in CS and I'm familiar with the notion of pseudo code and the way it's usually written in academic papers. I agree with you that the way code is written matters a lot in practice. But in academic papers, usually the idea, the runtime and the correctness of algorithms have a higher priority than implementation details. Sure, you can write more readable pseudo code, but I haven't come across an algorithm in a paper that I wasn't able to understand. In fact, I do often like the way it is written. Who says that computer scientists are necessarily great programmers? That's not the case. Universities (at least in Germany) doesn't teach you how to be an "elite grade developer", as you said. They teach fundamental concepts in computer science. Why recursion? If you approach a problem with mathematics then thinking in terms of functions and recursion is very natural. Recursion is a fundamental mathematical concept and it's often easier to reason about recursive functions (inductive proofs).
- ObnoxiousJul 14y agoI noticed http://en.wikipedia.org/wiki/Binary_heap http://en.wikipedia.org/wiki/Binary_heap had a (slighlty) improved version of the binary Heap copy pasted from the same book.
- deleted 14y ago[deleted]
- comex 14y agoSince Google Books seems to not always want to display the code, here's a screenshot: http://imgur.com/q7TII http://imgur.com/q7TII