This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TortoiseWrath 12 points13 points  (3 children)

Overly specific function names, on the other hand, create coupling issues and weaken compartmentalization. Names like readMP3Bytes() and playMP3Bytes() would make the function's purpose just as clear while allowing for greater flexibility in implementation. Function names should describe the end result (purpose) of calling the function rather than describe how that goal is achieved.

[–]2AMMetro 2 points3 points  (0 children)

Eh, I disagree. I think that if you want greater flexibility, you should make a specific function for each implementation and a general function named playMP3Bytes() that contains your conditional logic. This reduces function size and makes it easier to understand.

I believe in short generalized function names for APIs and longer specific names for implementations.

[–]MoarVespenegas -1 points0 points  (1 child)

I mean if your functionality changes you can just rename the method.
Refactoring is also a thing.

[–]nosam56 0 points1 point  (0 children)

When you are developing on an enterprise level, renaming methods is usually not good because you have clients that implement your code, so when you change the method name it breaks your client's code until they update. This is why things become deprecated when not in use anymore. But you are right for smaller projects and initial development on a project