Show HN: Ease your dev life with these general naming rules
github.com
github.com
https://github.com/kettanaito/naming-cheatsheet#naming-funct...
>There is a useful pattern to follow when naming functions:
>prefix? + action (A) + high context (HC) + low context? (LC)
For example,
1. In MySQL it's common to name columns like user_name
2. In PHP you can use anything, but if you use camelCase, then it might turn out:
$userName = $user->user_name (using ORM for example)
3. In Javascript if I choose to have camelCase, which is common too, it might turn out:
fullName = user.first_name + ' ' + user.last_name
So the mix of conventions is unavoidable which is irritating.
How to deal with that?
So let's say in PHP, the preferred convention is snake_cake, then use it for the whole project. Then if you are working on a JS project, which the team demands camelCase, then just follow it.
There could be some cases, like in your 3rd example, the team applies camelCase for normal variables, and snake_cake for properties. Again, you still have to follow if it is something the team has agreed.
Just a bit annoying :)