If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

CMS, Framework, or Pure PHP?

Started by Enrinuanuch, Aug 03, 2023, 12:19 AM

Previous topic - Next topic

EnrinuanuchTopic starter

Hello, let's start with this: I am a beginner PHP programmer with a decent understanding of html/css and a basic grasp of javascript syntax. I can also create simple PHP scripts that interact with databases. Recently, I was given the opportunity to develop an updated website for my university's department. The design is almost complete, and now I need to decide on the server-side implementation. However, being new to this field, I'm unsure of how to proceed without ending up with messy code that combines PHP and HTML in a single file. Here's an outline of the website's functionality:

1) Adding, deleting, and updating information such as news and photos.
2) Uploading new files.
3) Potential future feature: user registration.

Now, onto the specific questions:

1) Should I use a Content Management System (CMS), a framework, or write the code from scratch using pure PHP with MVC architecture? My inclination is to use a framework or build from scratch, but considering the availability of pre-existing CMSs, would it be more efficient to use one instead of reinventing the wheel?
2) If I choose not to use a CMS, is it advisable to develop the website in pure PHP without any frameworks? Or would it be preferable to gain more experience before diving into framework development?
  •  


kyouxngofi

1) Choosing between a CMS, a framework, or building from scratch depends on several factors. A CMS like WordPress or Drupal can offer a quick setup and ease of use for content management tasks. However, they may have limitations in terms of customization and scalability. If you have specific requirements and want more control over the codebase, using a framework like Laravel or Symfony might be a better choice. Frameworks provide a structured way of building web applications and often include features like routing, database integration, and authentication.

Building from scratch with pure PHP and an MVC architecture can give you the most flexibility and control over your code. It allows you to tailor the application exactly to your needs and provides a great learning experience. However, it also requires more development time and knowledge of best practices.

Consider the trade-offs between time, flexibility, and your personal learning goals when making your decision. If you're working on a tight deadline or prefer a more straightforward solution, using a CMS or framework could save you time and effort. But if you have the time and desire to learn, building from scratch can provide valuable experience and allow for greater customization.

2) Developing the website in pure PHP without any frameworks is definitely possible, especially for a project of this scale. It can be a good way to understand the fundamentals of web development and gain hands-on experience. However, keep in mind that frameworks offer various advantages such as built-in security measures, database integrations, and templating systems. They also enforce best practices and provide a community for support.

If you choose to go with pure PHP, make sure to follow best practices like separating your concerns (e.g., separating HTML, PHP logic, and database queries). This will help keep your code organized and maintainable. As you gain more experience, you can explore frameworks and see how they can enhance your development process.

additional considerations and suggestions:

1) Code Organization: Regardless of whether you choose a CMS, framework, or pure PHP approach, strive for good code organization. Use a modular approach by separating concerns into different files or classes. This improves code maintainability and makes it easier to understand and modify later on.

2) Scalability: Consider the future growth and scalability of your website. If you anticipate adding more features or expanding functionality in the future, using a framework or building from scratch with an MVC architecture might be a better choice. They provide a solid foundation for managing complexity and scaling the application.

3) Learning Goals: If your primary goal is to learn and gain experience, building from scratch with pure PHP or using a framework can offer valuable insights into web development. Frameworks often come with extensive dоcumentation and resources that can help you understand best practices and industry standards.

4) Time Constraints: Consider the timeframe for completing the project. CMSs usually offer quick setup and pre-built functionality, which can save time. Frameworks can also speed up development by providing ready-made components and tools. Building from scratch can take longer due to the need to handle every aspect of the application yourself.

5) Community Support: Consider the availability of support and community resources when making your decision. CMSs and well-established frameworks often have active communities and forums where you can find help and guidance. This can be beneficial, especially if you're new to web development.

In the end, the choice between a CMS, framework, or building from scratch depends on your specific project requirements, learning goals, time constraints, and level of expertise. Evaluate these factors and make an informed decision that aligns with your needs and priorities.
  •  

Elussilsok

If the goal is to reduce labor costs, one option is to use a CMS like Wordpress with a Custom Pages plugin and build the entire site around it. This approach may be faster and possibly more reliable due to the availability of a pre-existing solution. However, in terms of benefits, there won't be much for you.
On the other hand, if the focus is on gaining valuable experience, it would be worth considering a more robust framework such as Symfony2, Yii2, or Laravel. Developing the project using one of these frameworks would provide a wealth of useful experience, especially if you have not worked with frameworks before. It will be challenging and time-consuming, but the knowledge gained will be much more beneficial.

It is important to note that the benefits are mostly for you, as your inexperience may result in some minor mistakes that could cause issues for the department.
I would not recommend choosing pure PHP without any experience, as it would likely be a waste of time and offer no benefits to anyone involved.
Ultimately, the decision lies with you regarding whose benefit you prioritize - your own or the department's. In my opinion, at university, it would be wise to prioritize your own growth and development.
  •  

MilaLauviax

I recommend utilizing a Framework, as it allows you to save time and gain valuable experience. On the other hand, using a CMS is suitable when you need to build a website quickly with minimal experience. The use of pure PHP tends to fade away quickly due to its abundance of unnecessary actions.

For an enhanced learning experience, I suggest writing your projects in pure PHP while incorporating design patterns. Developing your own CMS or framework can be extremely beneficial, although it requires a significant amount of time investment.

Therefore:
- If your goal is to swiftly create a website, a CMS is recommended. This approach aligns with the practices of web studios, enabling fast and cost-effective solutions.
- For website creation and long-term support and development, a Framework is the clear choice.
- If you aim to create a website for personal use or for learning purposes, pure PHP is the way to go.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...