4 ms·
I know this is a favorite idea that is often quoted. But as a plodding person doing research in CS, I don't find that programming enhances big-level understand
by sn41 6y ago
I know this is a favorite idea that is often quoted. But as a plodding person doing research in CS, I don't find that programming enhances big-level understanding. It may refine some of the nuances one does not notice in the first pass, but after a tiring debugging session, I don't usually find any flashes of insight about the overall problem.
An example: rotation and balancing of binary trees - does battling the inevitable core dumps during implementation really enhance any understanding of the principle of the algorithm?
- lgas 6y agoIf your goal in implementing rotation and balancing of binary trees is to better understand a poorly understood idea then you're probably better off using a language like Haskell that is garbaged collected and doesn't have nulls so you can both avoid having any core dumps and also have a smart compiler to help guide you to the solution and the understanding.
- theelous3 6y agoThis is the right mindset. Language and idioms are important to teaching and learning. I see people using python to teach/learn something like array iteration and do for i in range(len(my_list)): print(my_list[i]) What they have done, is conflated the implementation they think is computer sciencey from learning C, and the essence of list iteration. Python is a great language for learning about iteration: for item in my_list: print(item) Here it's much closer to the essence of the lesson. C is good for teaching about array indexing in the loop and exposing how the loop variable is reused: for ( int i = 0; i < myArraySize; i += 1 ) { printf("%d\n", myArray[i]); } If you're trying to understand something in programming or through programming, there are right languages for the job, and it's a tricky affair.
- redis_mlc 6y agoYou're correct, it's better to know the algorithm on paper before starting to program it. An extreme example of that is MySQL's InnoDB. It was written by 4 math PhDs who focused on rigor and correctness, which is why InnoDB is one of the most outstanding codebases in Open Source. The Internet basically runs on InnoDB. Having said that, programming experience will make you more logical over time, which can help with analysis.
- Memosyne 6y ago> The Internet basically runs on InnoDB. Can you explain what you mean by this statement?
- lmm 6y agoIf you're using a non-joke programming language you'll never see a core dump. Something like a notebook/worksheet where you can change something and then see how the changes propagate is definitely an easier way to understand something like rotating/balancing binary trees than trying to do it on paper. It's like the difference between understanding Shakespeare on stage and trying to understand Shakespeare by reading the scripts.
- sk0g 6y agoC/C++ are a joke? What is your operating system, by far the biggest program you run, written in?
- frou_dh 6y agoNightmarish C code that's had a million vulnerabilities beaten out of it through blood, sweat and tears.
- sk0g 6y agoWhere do I find a language free of bugs, vulnerabilities, and anything else that may impact security, while being able to develop things at a sane pace?
- mpfundstein 6y agolets stop the time it takes until the first guy comes along screaming: RUUUUST...
- exdsq 6y agoRUUUUST
- cameronbrown 6y agoI'll be that guy: Golang!
- sn41 6y ago
- mnky9800n 6y agoI think it helps in physics because you very quickly condense a large number of different mechanical situations into basically one numerical integration problem. Students quickly are able to calculate anything forces related and are able to see how every class of mechanics problem is basically the same problem. This is difficult traditionally because the mathematical tricks, such as rotating coordinate systems, take over the physics.
- dntbnmpls 6y ago> An example: rotation and balancing of binary trees - does battling the inevitable core dumps during implementation really enhance any understanding of the principle of the algorithm? It can especially if it is your first time learning about AVL, red black trees, etc. The process of implementing, debugging, etc can help you understand the algorithm and its underlying principles. Even more it shows you the practical merits and limitations. There have been times when I thought I understood an algorithm or data structure until I had to code it and then realized I didn't really understand it. But generally speaking, you don't need programming to understand "big-level" stuff in CS no more than you need a pen and paper to understand mathematics. Church and Turing didn't program and they helped create computer science.
- jgwil2 6y agoIn my experience, it's easy to be hand-wavy about the details of algorithms without even realizing it. Programming forces a level of rigorous thinking and, importantly, allows you to get feedback from the machine. A recent example I went through as an exercise was writing a regular expression engine. I understood the desired behavior and the theory of finite automata (or thought I did) but in programming it I was forced again and again to review the concepts and proofs in a very detailed and rigorous fashion. One last thing I would add is that I agree that language- or machine- specific details can get in the way of high-level understanding; this may be inevitable to a certain extent but choosing a language that fits the abstraction level of the problem helps a lot.