Hacker News new | ask | show | jobs
by arkh 548 days ago
Let's say I have a methodA somewhere in my code.

I decide to rename it and add a parameter: my IDE knows what I'm doing as it can change the new name everywhere the method is used. My versioning tool not so much: it can tell me some lines changed but it does not expose the fact "methodA has been renamed to superMethodB", that's something the user has to put in a commit file.

Add a moment when this method is refactored as 2 new methods and it starts being harder to follow in diff files. Most code forges already link commits to tickets: why not be able to directly link code constructs changes to tickets to telemetry artifacts? Mostly hidden through the IDE "task" management but all present in whatever ends in versioning. You could get git blame on steroids.

1 comments

Store ASTs in git instead of text, "reconstruct" the text when displaying to the developer and roundtrip.

Add some execution context and annotations to the AST and you could even do "git blame" in your debugger.

code can be thought of as serialized ast, and you need to serialize ast somehow anyways for storage
Yes and no, code comes with affordances like whitespace and comment layouts that are for humans that are unnecessary excess for ASTs.