Live data from Hacker News

I no longer understand my PhD dissertation

medium.com

91–100 of 281 posts

Re: I no longer understand my PhD dissertation

#91
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…

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'm fixing someone else’s code right now and a few single line comments would have saved my client thousands of dollars.

Today I put in a log statement to see why the code deletes data from the database if there is no new temperature data for the time period. The cron job has been running all day and so far every time it attempts to delete the data, there is no data to delete.

Another line runs a different script if the time is 15:00. No idea what is magical about that time. I added a bunch of log statements to see what happens at 15:00 that is different from every other hour of the day. So far I have no clue.

I’m sure the original coder had a reason for inserting these bits of code, but damned if I know what it was.

There are dozens of instances like this in the code. A one line comment would have saved me hours of work and the client several thousand dollars.

Re: I no longer understand my PhD dissertation

#92

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.

A good marker for when comments are going to be useful is when something stumps you, and then you fix it and/or figure it out. Chances are, when you read the code again it will stump you again - or on re-reading you might not even realize there was an issue. So I comment the change. It's usually something simple like, "This cast avoids a special case in method X", or along those lines. The comment is the "why" where…

If I run into that situation, I refactor the code so that I can better understand it the next time. To not do so is to waste all that time you spent understanding it.

> It's usually something simple like, "This cast avoids a special case in method X", or along those lines.

If I had an issue like that, I'd fix method X to be more accepting of unclean inputs.

Re: I no longer understand my PhD dissertation

#93

I'm truly shocked by the multiple people in the thread who claim that Math knowledge can be completely erased through as little as a year of non-practice. For me, Math has always resembled riding a bike more than anything else. Sure, the first few moments, the path is a bit overgrown and all the weeds need to be cleared off but it was always significantly easier revisiting a topic than understanding it for the first…

I've recently taken a calculus problem (multidimensional real optimization) I guess for the first time since I was an student. While your description has some merit, there's a huge amount of trivia in the format of "I can do X, I just have to do Y first", "X has no known solution, try something else", and "operation X is very useful, try it". That goes away, and everything gets way harder.

I've always felt that if I had done all of my calculus with Mathematica I would have left college with an excellent grasp on how to use higher level functions provided by Mathematica that would have largely abstracted away all of this.

Of course, the higher level functions might get covered in cobwebs - but I suspect not the same way; I would have kept these higher level skills up to date because:

- I recently went though a couple of books on Bayes and computer vision. I would have used Mathematica - refreshing my memory. - I sometimes need to do some stats / analysis - Refresh... - I recently picked up a Student's guide to Maxwell's equations - Refresh... - I need to help my children with Calculus...

If I had been using a high level tool my whole life I think I actually would make use of calculus and other mathematics.

I'm curious if anyone else feels the same.

Re: I no longer understand my PhD dissertation

#94
post #91

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'm fixing someone else’s code right now and a few single line comments would have saved my client thousands of dollars. Today I put in a log statement to see why the code deletes data from the database if there is no new temperature data for the time period. The cron job has been running all day and so far every time it attempts to delete the data, there is no data to delete. Another line runs a different script if…

I've seen stuff like that before, typically it's intended to be temporary code put in as a way of troubleshooting or achieving a non-standard result but wasn't cleaned up properly. I see that so often that I simply assume it's the case and not even try to run it down any further. Just make it work properly and move on.

Re: I no longer understand my PhD dissertation

#95
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…

And a lot of it comes from trying to sound smart instead of readable.

Sorry, but if I was this guy's advisor, I'd keep his ass in school until he took away his pretentious "it is obvious from ___ that"'s.

Ph. D education just isn't what it used to be.

Re: I no longer understand my PhD dissertation

#96

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.

I find one place where comments are absolutely critical is in external facing APIs. Summary of the purpose of the API, purpose of each method, valid arguments and possible return values. Think how often you need to read the comments for whatever libraries and APIs you use in your work.

I deal with two types of APIs. Well-documented and otherwise. For well-documented APIs, I can simply re-read the documentation to figure out the other side of my code.

For the rest of it, I try to write as cleanly as possible, and as robustly as possible the first time, so I'm not in the dark the next time I have to look at it. If I have to take time out to re-understand how it works, I'll just take the time and not feel guilty about it. The company wanted me to use that dreck, I'm not going to feel bad about having to take more time with it.

I don't think comments would help much in the second situation given decent engineering the first time around. If it's my code, I'll usually recall the idiocy I had to work around when running down whatever issue had me looking at it again.

Re: I no longer understand my PhD dissertation

#97
post #37
post #11

This does not surprise me in the least. Math was always extremely easy for me growing up. Up through my first differential equations class I found almost everything trivial to learn (the one exception is that I always found proving things difficult). I made the mistake of minoring in math and that slowly killed my enjoyment of it. Once I got to differential geometry and advanced matrix theory it all just became too a…

> Up through my first differential equations class I found almost everything trivial to learn Mankind hasn't yet figured out a good way to teach the first Differential Equations course. The first serious Calculus course introduces some level of rigor and formalism, but this alone is not sufficient for Diff Eqs. And the DE courses are typically leaning towards applications, so they tend to succumb to the "fiddle these…

This point is more thoroughly explained under section 7 here: https://web.williams.edu/Mathematics/lg5/Rota.pdf

Re: I no longer understand my PhD dissertation

#98
post #89

As someone who left academia after a PhD in math (been working as a quant in HFT for the last few years, which mostly involves coding in one form or another), I can totally relate! Back then, all those stochastic integrals and measures made much more sense. However, it doesn't seem totally alien -- I'm pretty sure I could go to hacking math if required, but it would require at least several months to get into the flo…

I also left academia after a math PhD. Though in my case, my area was numerical linear algebra, and I entered the aerospace engineering field. A lot of what I was working on was immediately relevant, but I would say only a fraction of what became my dissertation would be counted among it.

Re: I no longer understand my PhD dissertation

#99
post #82
post #64

Earlier quoted context omitted.

> Why can't we just provide a simple real life example first and then go on explaining the details? This. People learn differently, in my case, if I can't get the 'Why' first, I'm not that excited to learn it. I guess making 'simple' real life examples in many cases is hard. I also tend to learn things much better if they came from a real problem/need I have. There was a good discussion about a 'project based univers…

High school math was awful at this in the US. I went through a year of calculus and never knew what the heck it was for.

When I asked in high school what math was for to some professors, they said it was more to 'improve your thinking' than to use it in 'real life'. Now, a math course designed to be progressively easy to grasp, personalized when needed, entertaining and showing lots of examples from real life (e.g. relating algebra with 3d and video games) requires a very talented educator; teaching well is really hard and usually there's not enough time or resources to do it. That's why I think one of the most important skills to develop is to learn how to learn.

Re: I no longer understand my PhD dissertation

#100
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…

> I think that's because mathematical papers place too much value on terseness and abstraction over exposition and intuition. If it only happened on mathematical papers... It is all over the place, in books, classes, etc. Few professors tell you what are they doing and why; they just throw formulas, theorems and symbols at you. Intuition is not given its necessary importance, first because it's hard to grasp some con…

> Few professors tell you what are they doing and why; they just throw formulas, theorems and symbols at you.

That's not true. Proofs are a core process of all mathematics. Writing proofs can take up a majority of your time in some classes.

Post reply on HN