DEV Community

Discussion on: Writing Good Method & Variable Names

Collapse
 
ledinscak profile image
ledo

I once implemented model class Room, with supported classes RoomView and of course RoomService :-)
Nice article by the way, only thing I do not like in examples here is to use "list" or any other data typ word in names. I prefer simply to use plural nouns. So instead of getListOfProducts simply getProducts.

Collapse
 
dbanty profile image
Dylan Anthony

I can see using the data type in the name for some weakly typed languages. Like if you’re not on the latest Python and type annotations are a pain, it’s nice to be able to see what you’re doing.

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

I have no excuse, I almost exclusively write in C#. sheepish grin

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

True, you're right. Using the variable will show clearly that it's a list - it's probably a bit redunant. Thank you!