Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I am currently working on a small framework just to improve my php-knowledge. This framework should be very simple (minimizing overhead) and flexible in terms of later expansion.</p> </blockquote> <p>Go for it.</p> <blockquote> <p>As a result of reading more advanced tutorials, notes of serious php-developers, different class structures (singletons, Singletons, dependency injection, JIT, ...), oop, mvc, routing, caching... and a lot more I find it very difficult to filter "the proper way" (if there is one) as it seems to me that everyone says something different.</p> </blockquote> <p>That's because some people don't have an understanding why something should be solved in a certain way or why something is terrible practice, but they see something on some framework and they think it's the best thing since sliced bread.</p> <p>Although opinions may differ, you cannot argue with clean code and proper OOP if that is what you are after. In proper OOP singletons and <code>static</code>s have no place. Also what most people call MVC is actually some wrong view on the pattern (mostly because again they have seen some framework do it some way). Which is not always bad, but it is <em>not</em> MVC.</p> <blockquote> <p>Many people praise there opinon as "the best" and say that everything appart from that is evil. In my oppinion there is not a right or false. There are just several ways to achieve one's goal.</p> </blockquote> <p>Not everything that isn't the best is terrible in my opinion. But some stuff is just bad practice. And some pattern are defined in a way to make your applications easier to maintain, debug and test. If you are going to implement some other pattern that's all fine with me, but you will loose the benefits of some other pattern.</p> <p>Generally speaking the first rule of thumb I use when doing OOP programming is following the <a href="http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29" rel="nofollow">SOLID principles</a>.</p> <blockquote> <p>static classes: htmlManager, fileHandler, databaseManager, ...</p> </blockquote> <p>These have no place in proper OOP. Amongst others because the will tightly coupling the classes. Which make maintainability, readability and testability a pain.</p> <blockquote> <p>singletons: none</p> </blockquote> <p>Good, because they are just a fancy <code>global</code>.</p> <blockquote> <p>How do you organise/structure small or even bigger projects?</p> </blockquote> <p>Separation of concerns in both code as structure. One of the pattern can help you with that: <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" rel="nofollow">MVC</a>, <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter" rel="nofollow">MVP</a>, [MVVM](Model View ViewModel). For me personally I like the MVC pattern the most because it has some nice benefits against other patterns.</p> <blockquote> <p>What are your experiences concerning simplicity, logic, performance, readability, expandability and reusability of code?</p> </blockquote> <p>Readability and testablity are the most important. Right after that SOLID (which is also handled by the first point (overlap))</p> <ol> <li>Is there really a "proper way" of coding or it this just interpretation?</li> <li>Is there anything one should not use because it is already obsolete?</li> <li>Performance</li> </ol> <blockquote> <p>Forget about a framework or php Don't do this, don't do that without naming the reason why</p> </blockquote> <p>As I stated before: Just go for it. Do it and screw it up! Best way to learn is actually doing it and making terrible mistakes. I think the framework I made 1 year ago (although imho still better than 90% of what is out there) is a proper piece of crap ™.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload