Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean frameworkabout a good lightweight and clean framework

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccessanswer about htaccess and one on StackOverflow about a good lightweight and clean framework

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

added 7 characters in body
Source Link
Nicole
  • 28.3k
  • 12
  • 101
  • 143

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Such asSomething like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Such as the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

I think the most important step (or at least the step with the highest return-on-investment) is to begin using a framework (pre-built or one you've written) with a single entry point1

This is the best way to practice DRY (Don't Repeat Yourself) in PHP and will help you realize separation of processing code and display code.

This will also allow you to begin to see how OO can actually be used in PHP. Right now, Objects are hard for your to imagine because of all the "magic" code, as you call it. Request handling and business logic (where OO is well suited) are very different things. Request handling can be done with OO but it's not absolutely necessary, and the objects will be distinctly different from the objects you need in your application.

Once your request-handling is separated and following a distinct and consistent pattern, Objects related to your application will fall naturally into the controller methods without mixing into the request-handling, which would make your code feel cluttered.

When doing this, set up a good __autoload function so that you don't have to import every class in your app for every request. Classes won't be loaded until needed.


1: Something like the framework I described in an answer about htaccess and one on StackOverflow about a good lightweight and clean framework

Source Link
Nicole
  • 28.3k
  • 12
  • 101
  • 143
Loading