Hacker News new | ask | show | jobs
by 2bitencryption 1963 days ago
I love perusing different MS open-source codebases, just to see all the different conventions, styles, and practices used by different teams across the company.

This repo in particular sure shows its age, because just clicking around, this code is totally nonsensical to me, haha. I couldn't even make a guess as to what it's doing.

https://github.com/microsoft/Extensible-Storage-Engine/blob/...

3 comments

This is good feedback for the project, thank you. I have lived with the naming convention, so long that it is second nature ... I didn't even think of documenting it ... I will write up something on the naming convention of ESE on the gibhub project's wiki soon!

Brett Shirley [MSFT] (yes, the Brett Shirley contributor to the project ;-)

As well as stripping comments, did they also strip and replace variable names? This code reminds me of trying to grok autogenerated Java GUI code in CS101.
Nah, it just looks like microsoft's usual hungarian notation https://docs.microsoft.com/en-us/windows/win32/stg/coding-st...
Yes, Hungarian was fresh in 1988 so naturally heavy use in this code base.
I haven't seen Hungarian notation in so long. It's so painful to look at. And yet back in the day I too was convinced it was a good idea.
Confession: I still LOVE it. If I had a green field project today, I would still use it. Brett Shirley [MSFT] ESE Developer.
Yeah it wasn't until after I moved from C++ to other languages that I changed my mind on this (ESE appears to be primarily C++).

When you can 100% rely on your IDE to give you the metadata about a variable using color and/or hover pop-ups, storing that same metadata in the variable name just feels heavy and unnecessary. With C++ IDEs, you will never get 100% accuracy, so you might as well give in and go with Hungarian.

    BOOL    fVisible;
    INT cbKey = 0;
    BOOKMARK        bmSearch;
    ULONG           cbReq;
I don't think so.