Live data from Hacker News

I no longer understand my PhD dissertation

medium.com

211–220 of 281 posts

Re: I no longer understand my PhD dissertation

#211
post #63

Earlier quoted context omitted.

I started taking readability very seriously once I started going back to extend old code and finding I couldn't immediately understand what it was doing. Now, if I have that problem, it's now two problems. The original problem, and the readability problem. The readability problem is solved first, and the original problem can only be solved afterward. I don't see comments helping me, I could spend the time better by m…

> I don't see comments helping me... I don't know why people say this type of thing, as if there's some choice you have to make between good names and comments. You can have both, and there are absolutely times when comments are necessary . Too many comments may be a "smell", but code that doesn't require any comments at all is very unlikely.

I think a lot of coders jump to comments as a first resort rather than trying to make the code clear. In theory it's not a tradeoff, but in practice I've seen a lot of heavily-commented code with single-letter variable names. My rule of thumb would something like "never write a comment until you've spent at least 5 minutes trying to make the comment unnecessary".

Re: I no longer understand my PhD dissertation

#212

Earlier quoted context omitted.

The downside of course is that comments aren't compiled/run - so they often become out of date. "Often" might actually be an understatement. I can't tell you how many times I've been reading a comment that runs quite contrary to what the code really does. You then end up reading the code to reason about it anyway, paying two taxes. After too many of those experiences, you just end up going straight to the code as the…

I'm sure a lot of people are hoping that one day we can generate code just by writing the comments and leaving the machine to do the rest. I certainly am.

More structured alternatives to comments make that kind of thing much more possible, e.g. https://hackage.haskell.org/package/djinn

Re: I no longer understand my PhD dissertation

#213
post #86

Earlier quoted context omitted.

> there are absolutely times when comments are necessary . I'll have to take your word for it, because I've yet to run into that situation.

Comments are incredibly useful for that bit of code that you spent hours trying to make it work and you couldn't figure out a way to name things well or to improve it. That's where a comment is priceless.

In my book it goes 1. types 2. tests 3. method/variable names 4. comments. If you can't make the code clear any other way then add a comment, but it should be a last resort.

Re: I no longer understand my PhD dissertation

#214

I've been working with Haskell* for a couple of years and it is quite often that I work with code that I don't fully understand. I'll come across a terse bit of code, then carefully take it apart to see what it does (by taking bits and pieces out and giving them names instead of passing in using point-free notation and also adding type annotations). Once I see the whole picture, I make my own change and then carefull…

> If I left this verbose and other bits verbose then it would be hard to see the whole picture. I really can't sympathize with this. How exactly is this helping any one at all, if you have to struggle with it yourself? Is it a bunch of dense monolithic code? Decompose into smaller methods / separate files. Setup your text-editor/IDE in an effective way for quickly navigating across large chunks of related code. Imho…

I find there's a huge difference between code that fits on a single screen and code that doesn't (and I've heard claims this is backed by research). So I'd far rather have lines that I have to stare at for a while to unpack than lines that are individually simple but I have to scroll up and down or jump back and forth to see the whole method.

Re: I no longer understand my PhD dissertation

#215

As a PhD in spplied math, I must say I concur wholeheartedly with the author. The true value of a PhD in a quantitative field is less about specific domain knowledge, and more in the set of general problem solving skills you pick up.

This raises an interesting question. Is the PhD process the best way to acquire those general problem solving skills? Or is there a better way to learn them?

An interesting question indeed, but too broad to make much progress on. If you have ideas for a) an incremental change to the PhD process that would improve this or b) an alternative that might work better then please do pursue them. (Remember that the credential aspect is important as well as the actual learning).

Re: I no longer understand my PhD dissertation

#216
post #141
post #14

TLDR: The author independently re-discovered what you may know as Old Code Syndrome. I think that's because mathematical papers place too much value on terseness and abstraction over exposition and intuition. This guy's basically in the position of a fairly new developer who's just been asked to do non-trivial update of his own code for the first time. All those clever one-liners he put into his code made him feel sm…

It would be really nice if all it took to understand difficult mathematics were some easy programming tricks. The problem with looking at old code is you forget what is going on or what the purpose of different components are. The problem with looking at old mathematics is that it is genuinely very difficult to understand. You work very hard to be an expert in a field and get to a level where you can read a cutting-e…

Leslie Lamport wrote a paper on this subject over 20 years ago.

http://research.microsoft.com/en-us/um/people/lamport/pubs/l...

As far as I can tell, nobody has really adopted any of his proposals yet, and most papers continue to be written in pseudo-prose. Remember, mathematics used to be written in full prose (e.g. "the square of the hypotenuse is equal to the sum of the squares of the other two sides") and it took hundreds of years for us to realise that "x^2 + y^2 = z^2" was a better notation.

While mathematics may be "genuinely very difficult to understand", so is any complex piece of software. Software engineering techniques might be useful to mathematicians, even if they are all new-fangled and modern.

Re: I no longer understand my PhD dissertation

#217
post #199

Earlier quoted context omitted.

I don't think that programming and math are the same in a practical sense. I am studying math and CS and they're fairly different. Programs deal with specific things, types and data that you manipulate and see with your eyes. Maths deal with abstract concepts for which finding examples can be pretty difficult. Also, while programming, you can design your functions and their interfaces before writing them down. In mat…

> Programs deal with specific things, types and data that you manipulate and see with your eyes. Maths deal with abstract concepts for which finding examples can be pretty difficult. Have you forgotten the pains that you went through trying to understand the difference between values, pointers and references, lexical and dynamic scoping, static and dynamic typing, and the like? Can you see them with your eyes? Have y…

I'm not saying those concepts are not difficult. But values, pointers and references are something that relate to memory. You can simulate in a paper how is a value or a pointer managed in a program. Same with scopes and static typing. There are specific examples for all of those.

Some concepts in mathematics are way above the abstraction level that you mention. For example, the projective plane, or nowhere-differentiable functions, or geometry in higher dimensions; those are concepts that not only do not have any physical equivalent, but are also very difficult to grasp and imagine in your head.

Re: I no longer understand my PhD dissertation

#218

Earlier quoted context omitted.

since when are standard tools of good education 'cute little tricks'? mathematics is hard. mathematicians are some of the smartest people in the world. yet the current tendency to not do these things or not do them enough is a consequence of a certain culture, efficiency constraints and even the near universal use of LaTeX.

I completely agree on the culture point: Programming and math _is_ essentially the same (Curry Howard isomorphism) and the problems are indeed equally complex. The difference is that programming is driven on economical terms, hence agility, flexibility, etc. has been developed. Mathematics is driven in the university sphere, where mostly intrinsic motivation drives. Not many mathematics professors have the urge to si…

Programming is a subset of math, namely, the part of math that deals with algorithms. There are many parts of math that are not contained in programming. For example, floating point numbers are finite representations of real numbers, but since floats are finite, without some math theory beyond just algorithms, there is no way to understand them. There are may similar examples.

Re: I no longer understand my PhD dissertation

#219
post #141

Earlier quoted context omitted.

It would be really nice if all it took to understand difficult mathematics were some easy programming tricks. The problem with looking at old code is you forget what is going on or what the purpose of different components are. The problem with looking at old mathematics is that it is genuinely very difficult to understand. You work very hard to be an expert in a field and get to a level where you can read a cutting-e…

It's also the jargon. I remember years ago telling a coworker that I was an ACM member and subscribed to the SIGPLAN proceedings. He looked at me and with all sincerity asked, "You can understand those things??" To which I responded, "About half," but I totally sympathized with his question. Both Math and CS need the reincarnation of Richard Feynman to come and shake things up a bit. There's too much of the 'dazzle t…

Einstein also said "make things simple and not simpler". They will always be things that are irreducible.

Re: I no longer understand my PhD dissertation

#220
post #176

Earlier quoted context omitted.

From my experience of both academia and life in general, I'd say traditional tertiary education -- meaning lectures and research work from undergraduate upwards in a university setting -- is actually quite a poor way to learn anything. I'd say the ideal way to develop knowledge, understanding and skill in almost any field is a combination of systematic practice and receiving personalised guidance and training from so…

Both the CS and maths undergrad courses at my uni were structured with voluntary lectures coupled with compulsory group study with 10-15 students led by a post-grad TA for many of the larger courses. I skipped most of the lectures, and focused on the group study, and it was far more rewarding.

That sounds like an all-too-familiar story.

On the subject of lectures, it does slightly surprise me that in 2016 we still have researchers with neither much interest in teaching nor the presentation skills to do it well being asked/compelled to deliver undergraduate lecture courses at individual universities. You'd think with the easy access to video presentations and supporting materials now offered by the Internet, universities might have collaborated by now to build the personal elements of tuition around video lectures given by academics who do have the interest and are gifted presenters.

On the other hand, I suppose that would expose how little personal attention many students actually receive in return for the fees and debts they take on, and universities don't want to encourage potential students to question how much real value they provide. Surely it would be more reliable and efficient as an education method if they focused their efforts on small group tuition and individual guidance, though.

Post reply on HN