4 ms·
I am pro PHP, but this is honestly an awful display of PHP usage. Templates mixed with logic inside the main php file? Check. Not using Composer for dependency
by zapt02 12y ago
I am pro PHP, but this is honestly an awful display of PHP usage. Templates mixed with logic inside the main php file? Check. Not using Composer for dependency management? Check. Reinventing the wheel when it comes to routing instead of using a battle-tested component like the Symfony Router? Check. Three strikes, you're out!
- dewey 12y agoOne of it's features is that it's "A single PHP file of less than 100 lines of code." - Adding all these things you listed would just make it more complicated for no good reason. I'm all for sticking to best practises but in that case it'd make no sense. This is supposed to be deployed easily on shared web hosts, installing dependencies wouldn't work there.
- zapt02 12y agoWell it could be 5 lines of code. To edit the output you would have to fork the project for no good reason. Templating exists so you don't have to do stuff like that. Regarding dependencies, you can provide a pre-built zip archive with the dependencies installed already. Then it's just a matter of uploading the folder.
- deleted 12y ago[deleted]
- josephernest 12y agoHere is a discussion exactly about "Why mixing templates and logic is not necessarily bad": http://www.thisisvoid.org/article/03 http://www.thisisvoid.org/article/03 I have a math research background: if you can prove something in 2 pages with no extra tool, it's far better than doing the same by invoking a big difficult Theorem. Moreover, I am not a profesionnal developer. And for me, installing Apache+PHP is enough. I don't want to add more tools, more layers. The list could be endless: Let's use Symfony, Composer, Brew (random name here, I don't know what is Brew)... and at the end I'll have a big big thing... I really want to keep it simple... Each new layer is like "minus 10 points" for my project ;)
- zapt02 12y agohey joseph, I read your post, and empathize with the notion of "less is more". The problem arises when you want to extend Void. Instead of providing a good way to do so (using templates and a hook system), you force people to code in a single file without structure that quickly becomes a mess. If you never plan to do anything else with Void than what is provided, that's fine, but in my experience website development just doesn't work like that.
- josephernest 11y agoReally, are you sure? Have a look here: https://github.com/josephernest/void#faq https://github.com/josephernest/void#faq * Adding code highlighting? 3 lines of code to add in index.php * Adding analytics (unique visitor count)? 3 lines of code to add in index.php * Adding Disqus comments ? Less than 10 lines to copy/paste. Is it this you call a mess? I've used at least 10 CMS before, and what I call a mess is more: having to create a SQL DB, having to login/logout all the time, having to understand how the marvellous "install-a-plugin-to-extend-the-CMS" system works...