Skip to main content
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link
  1. As pointed out beforeAs pointed out before, you have an useless variable ($is_answered). I've removed it as well, since it isn't doing anything there.
  1. As pointed out before, you have an useless variable ($is_answered). I've removed it as well, since it isn't doing anything there.
  1. As pointed out before, you have an useless variable ($is_answered). I've removed it as well, since it isn't doing anything there.
added 66 characters in body
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62

My review will be short is longer than I expected but I will only focus on the function userDatauseData().

I don't think that userDatauseData is a good name.

I strongly recommend to change it to lowercase_and_underscore (a.k.a. snake_case).

Why is that? If you write userdatausedata by mistake, you will have an hard time to look into "Where in the living fudge is this declared???" just to notice that you have misspelled the name of the function and that PHP doesn't care about casing in the function name.

If you write USER_DATAUSE_DATA, User_DataUse_Data or any variation, it is easier to find the name. Implicitly you split the name by the _ and compare part by part.
Try this experiment:

But, even if you change the name to user_datause_data, it will be a bad name.

Why is that? Well, the name gives the idea that you are trying to get the useruse some data to do something. But youwhat is it doing? I don't evenknow, I have a single return!to read the whole function to know.

My review will be short is longer than I expected but I will only focus on the function userData().

I don't think that userData is a good name.

I strongly recommend to change it to lowercase_and_underscore.

Why is that? If you write userdata by mistake, you will have an hard time to look into "Where in the living fudge is this declared???" just to notice that you have misspelled the name of the function and that PHP doesn't care about casing in the function name.

If you write USER_DATA, User_Data or any variation, it is easier to find the name. Implicitly you split the name by the _ and compare part by part.
Try this experiment:

But, even if you change the name to user_data, it will be a bad name.

Why is that? Well, the name gives the idea that you are trying to get the user data. But you don't even have a single return!

My review will be short is longer than I expected but I will only focus on the function useData().

I don't think that useData is a good name.

I strongly recommend to change it to lowercase_and_underscore (a.k.a. snake_case).

Why is that? If you write usedata by mistake, you will have an hard time to look into "Where in the living fudge is this declared???" just to notice that you have misspelled the name of the function and that PHP doesn't care about casing in the function name.

If you write USE_DATA, Use_Data or any variation, it is easier to find the name. Implicitly you split the name by the _ and compare part by part.
Try this experiment:

But, even if you change the name to use_data, it will be a bad name.

Why is that? Well, the name gives the idea that you are trying to use some data to do something. But what is it doing? I don't know, I have to read the whole function to know.

added 134 characters in body
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62
Loading
fixed spelling
Source Link
Quill
  • 11.9k
  • 5
  • 40
  • 93
Loading
Added a few side-notes that touch a very important matter.
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62
Loading
Added a few side-notes that touch a very important matter.
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62
Loading
added 8 characters in body
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62
Loading
added 195 characters in body
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62
Loading
Source Link
Ismael Miguel
  • 6.1k
  • 2
  • 23
  • 62
Loading