Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do the same way like you. My logic was that I can tell where the value is coming from. I would use the same type but different name.

Is it coming from a client via http? Then it needs to be checked and saved

The database? then it has an id field which could be null in other cases.

Or I just create a new instance?

Naming things is hard tho, sometimes I do think I should just name them the same and stop caring. I'm not sure if I gain productivity but it gives me some comfort that I can instantly tell the source of the data.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: