I’m a developer with 15-years of experience in the .Net stack as well as an interest in Angular.I’m known for taking legacy projects and updating them so they can be maintainable and have new features
You write that it is a method, not a standalone function. So it belongs to an object, probably an object of type Patient. So what about calling it GetIdByChartId()? It makes no sense to put information into a name that is obvious from the context.
I’m a developer with 15-years of experience in the .Net stack as well as an interest in Angular.I’m known for taking legacy projects and updating them so they can be maintainable and have new features
Loved this, thank you!
I've been ranting about a method I found in one of our old libraries for the last couple of weeks.
GetIdById()
, really? What the heck is that supposed to even do?After digging into it and figuring out what it did I eventually renamed it to
GetPatientIdByChartId()
Ha. I wish it had just contained
return id;
Your rename makes a lot more sense than the original. "GetIdById" sounds like the code equivalent of trying to divide something by zero if you ask me!
You write that it is a method, not a standalone function. So it belongs to an object, probably an object of type
Patient
. So what about calling itGetIdByChartId()
? It makes no sense to put information into a name that is obvious from the context.Because it was a standalone function. I tend to use method and function interchangeably when I really shouldn't.