Skip to main content
deleted 24 characters in body; edited title
Source Link

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing every re-usable constdata as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/temaplatestemplates/images ill use a CONSTconst ADM_IMAGES )
  • session names
  • cookie names
  • random things like MAX_IMAGE_SIZE, THUMB SIZETHUMB_SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these constsconstants... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use LOTS of consts.them in this excess

If not, how else could these conststhis data be encapsulated to be useful AND easy enough to reach in my application? Also bearing readability in mind.

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing every re-usable const as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/temaplates/images ill use a CONST ADM_IMAGES )
  • session names
  • cookie names
  • random things like MAX_IMAGE_SIZE, THUMB SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these consts... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use LOTS of consts.

If not, how else could these consts be encapsulated to be useful AND easy enough to reach in my application?

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing re-usable data as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/templates/images ill use const ADM_IMAGES )
  • session names
  • cookie names
  • random things like MAX_IMAGE_SIZE, THUMB_SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these constants... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use them in this excess

If not, how else could this data be encapsulated to be useful AND easy enough to reach in my application? Also bearing readability in mind.

deleted 24 characters in body; edited title
Source Link

Is there a limit on how many global variablesconsts are used before an application is considered bad programming?

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing every re-usable variableconst as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/temaplates/images ill use a CONST ADM_IMAGES )
  • session variable names
  • cookie variable names
  • random things like MAX_IMAGE_SIZE, THUMB SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these consts... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use LOTS of consts.

If not, how else could these variablesconsts be encapsulated to be useful AND easy enough to reach in my application?

Is there a limit on how many global variables are used before an application is considered bad programming?

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing every re-usable variable as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/temaplates/images ill use a CONST ADM_IMAGES )
  • session variable names
  • cookie variable names
  • random things like MAX_IMAGE_SIZE, THUMB SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these consts... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use LOTS of consts.

If not, how else could these variables be encapsulated to be useful AND easy enough to reach in my application?

Is there a limit on how many global consts are used before an application is considered bad programming?

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing every re-usable const as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/temaplates/images ill use a CONST ADM_IMAGES )
  • session names
  • cookie names
  • random things like MAX_IMAGE_SIZE, THUMB SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these consts... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use LOTS of consts.

If not, how else could these consts be encapsulated to be useful AND easy enough to reach in my application?

Source Link

Is there a limit on how many global variables are used before an application is considered bad programming?

Basically, I develop websites, some large with many crud operations, etc...

However I've gotten into the habit of storing every re-usable variable as a constant in my PHP applications

I currently have 44 constants defined in one application.

These range from:

  • Database config
  • Home page for admin and guest
  • url slug names
  • declaring development mode
  • declaring maintenance mode
  • a few directory shortcuts ( instead of writing /admin/temaplates/images ill use a CONST ADM_IMAGES )
  • session variable names
  • cookie variable names
  • random things like MAX_IMAGE_SIZE, THUMB SIZE and MAX_LOGIN_ATTEMPTS

I don't have any problems using all these consts... It's kind of helpful having all these in my application.

I just wanted to know if its a 'good practise' to use LOTS of consts.

If not, how else could these variables be encapsulated to be useful AND easy enough to reach in my application?