Live data from Hacker News

I no longer understand my PhD dissertation

medium.com

191–200 of 281 posts

Re: I no longer understand my PhD dissertation

#191

An interesting read. But I think the author should have explicitly written out the point he is really making: you can't be too careful about making your writing clear, even to yourself. I recall reading (I'd point to the book with a link if I could remember in what book I read this) that mathematicians who occasionally write expository articles on mathematics for the general public are often told by their professiona…

It's almost like you want the source code as well as the compiled program.

Re: I no longer understand my PhD dissertation

#192
post #177
post #108

Earlier quoted context omitted.

Comments are not for how or what, the code does that just fine. Comments are for why . Sometimes the why is obvious, then you don't need a comment. The rest of the time, add that comment. Even if it's something like "Steve in accounting asked me to put this in."

Such comments are best added in commit messages. If you add JIRA task number to each commit it's almost always already there (because in the task there will be your discussion with Steve). And when you change the line because Tom asked you to change it again - you don't need to remember to remove the comment about Steve.

Sorry, but that is ridiculous.

I have recently started working on an existing project which is all new to me. Having to go through git commits looking for relevant comments is just a silly suggestion. Its far more useful when I am browsing through the code, trying to understand it, to see a comment beside the relevant piece of code, not hidden away in git commit messages.

Re: I no longer understand my PhD dissertation

#193

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…

I think it's about balancing various things. Having less code is good unless there's a hidden catch you need to be aware of or it takes a few weeks to unravel what the code does.

I prefer code that is understandable right away, is consistent and doesn't have any surprises.

Re: I no longer understand my PhD dissertation

#194
post #190
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…

> Programming has existed for, say, 50-100 years. We have recorded mathematical history going back thousands, with contributions from most of the most brilliant human beings to ever exist. Mathematics with a solid logic foundation has also existed only for the past century, and writing programs is actually equivalent to doing a mathematical proof as some have already pointed out. The actual problem is that when progr…

To clarify the last sentence: I am not criticizing mathematicians for not doing formal proofs. Often mathematical publications are not final "products" but explorations into new methods. Requiring formal proofs on every publication, with the status quo of computer-assisted proving, will surely impeded the development of mathematics. What I am saying is that I hope one day with the development of computer-assisted proving, the chores involved in doing formal proofs will be reduced to such a degree that mathematicians are more inclined to do them than not.

Re: I no longer understand my PhD dissertation

#195

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 there is a world of difference between terseness that helps readability and code re-factoring vs. terseness that makes you want to bang your head against the monitor.

That said I think the requirements, or say qualities which define good code and good dissertation's are quite different. Code needs to be maintained, refactored and altered throughout it's lifetime, a dissertation might only need to be built up and understood once to prove a particular result which can be re-used after that.

Re: I no longer understand my PhD dissertation

#196
post #192
post #177

Earlier quoted context omitted.

Such comments are best added in commit messages. If you add JIRA task number to each commit it's almost always already there (because in the task there will be your discussion with Steve). And when you change the line because Tom asked you to change it again - you don't need to remember to remove the comment about Steve.

Sorry, but that is ridiculous. I have recently started working on an existing project which is all new to me. Having to go through git commits looking for relevant comments is just a silly suggestion. Its far more useful when I am browsing through the code, trying to understand it, to see a comment beside the relevant piece of code, not hidden away in git commit messages.

No need to apologize for different opinion.

IMHO comments aren't there for newcomers. You are a newcomer for a month or 2. You are a developer for years most often. Besides, how is

    //Steve in accounting asked me to put this in
    foobifyTheBaz(bazPtr, foobificationParams);
more helpful for newcomers than just

    foobifyTheBaz(bazPtr, foobificationParams);
Comments answering "why" are very important when bugfixing/changing stuff. You want to know if sth was intentional or just accidental, and if it was part of the change that you have to override, or some independent change, so you know which behaviour should stay, and which should change. You should always look at the git blame of the region you change anyway before making a change (it often turns out your change was there before and commit message has the reason why you shouldn't change it back).

And you don't look for git commits. You enable git blame annotations in your IDE and hover over the relevant lines to immediately know who, when, and why changed that particular line. That's why commit messages are as important as good naming IMHO.

By the way, when you have code like:

    //Steve in accounting asked me to put this in
    foobifyTheBaz(bazPtr, foobificationParams);
    barifyTheBaz(bazPtr, barificationParams);
    if (mu(bazPtr)) {
        rebazifyTheBaz(bazPtr);
    }
How do you know which lines the comment refers to and if you should delete it or not when Tom asked you to change barifyTheBaz invocation? That's the main advantage of commit messages over comments - they are always fresh and encode the exact lines they refer to.

Re: I no longer understand my PhD dissertation

#197

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?

Well the PhD process lets you experience failure without putting much more than your self esteem in danger...

Re: I no longer understand my PhD dissertation

#198

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…

Proof assistants are in some ways very similar to what you described. Coq [1] is a popular example. It helps control complexity of larger proofs and verifies that everything that is derived is correct.

[1] https://coq.inria.fr/

Re: I no longer understand my PhD dissertation

#199

Earlier quoted context omitted.

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…

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 you ever tried fully explaining any of those to a non-CS major in half an hour? :)

Abstractness is pretty subjective. For non-programmers, even the idea of CPU and memory can be abstract. And it doesn't help to open up a computer and point to the hardware; that is like claiming a mathematical paper is not abstract by pointing to the very concrete paper and ink that embodies it.

Re: I no longer understand my PhD dissertation

#200
I took a course on formal logic on courses. I put all of the questions and exercises into anki, a spaced repitition program. This ensures I will always remember it and get it in my head at an intuitive level.

Basically it's like flash cards that decay exponentially. The first review is in one day, the second in two days, then 4 days, and so on.

Post reply on HN