Pure PHP Or PHP framework?

Results 1 to 10 of 10
  1. #1
    Member RakisTa is offline
    MemberRank
    Nov 2012 Join Date
    53Posts

    Pure PHP Or PHP framework?


    RaGEZONE Recommends

    RaGEZONE Recommends

    I have an upcoming project and our instructor lets us decide which method to use
    I'm just confused where i'll hard code it from scratch or use a php framework?

    Thaaanks guys! Love lots!


  2. #2
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,089Posts

    Re: Pure PHP Or PHP framework?

    Up to you, really. Frameworks have methods pre-made that baseline PHP won't have, and there are lots of employers that will want you to know a PHP framework. However coding your own PHP from scratch is a good learning curve, because you want to understand the language BEFORE using a framework.

    If you're comfortable with PHP, then use a framework. If you're not comfortable, use this opportunity to brush up on coding your own PHP.
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

  3. #3
    ◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜ Taiga is offline
    ModeratorRank
    May 2007 Join Date
    InternetLocation
    2,480Posts

    Re: Pure PHP Or PHP framework?

    Quote Originally Posted by fallenfate View Post
    If you're comfortable with PHP, then use a framework. If you're not comfortable, use this opportunity to brush up on coding your own PHP.
    Perfectly sums up what I was going to say.


    Moderator & Developer
    I CAN NOT HELP YOU WITH YOUR SERVER, USE THE CORRECT HELP SECTION INSTEAD.
    I AM ONLY TAIGA ON RAGEZONE!
    BE CAREFUL WITH IMPOSTORS!


    DO NOT PM ME FOR GAME RELATED QUESTIONS, THESE MESSAGES WILL BE IGNORED!

    The Rules | Discord | MMORPG Extra | Contact Me


  4. #4
    Member RakisTa is offline
    MemberRank
    Nov 2012 Join Date
    53Posts

    Re: Pure PHP Or PHP framework?

    How about security-wise how do the two compare?

    Is it safe to use pure php in like coding for clients ? Or using a framework provides more security ?

  5. #5
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,089Posts

    Re: Pure PHP Or PHP framework?

    In terms of security they're both identical.

    You need to understand that a framework is really just another way of writing PHP, it's still built using the same language, so it has the same potential to be secure and insecure. Frameworks have functionality out of the box to help prevent some security issues, but you can create the same functionality in PHP yourself as well. All frameworks do is offer another way of writing PHP, with new functions that give you more flexibility and security at a quicker speed to maximise efficiency.

    Everything PHP frameworks can do, you can do in regular PHP, just differently. If you're still learning PHP, stick to using basic PHP. If you're decent at PHP and can understand the language in-and-out, then you can use a framework. Otherwise stick to normal PHP.
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

  6. #6
    Programmer TimeBomb is online now
    ModeratorRank
    May 2008 Join Date
    United StatesLocation
    1,253Posts

    Re: Pure PHP Or PHP framework?

    If you're inexperienced and the project is small, it's a good opportunity to learn by trying to write it yourself.

    If you're inexperienced and the project is not small, you will likely find that you are able to build a product or application faster using a framework. If the project is results-focused, a framework may help you get to your intended result faster and with the end result having a more maintainable code base.

    Do read through Getting Started docs, documentation related to what you'll be using the framework for, and quality open source implementations of the framework to get an idea of how to use the framework effectively.

    That being said, if you have a lot of time on your hands and want to focus more on learning PHP rather than building an app, then trying to make your own code base from scratch can be a great learning experience. There are a lot of antipatterns and pitfalls to be had though, and you may very well rewrite your entire code base numerous times over. Be mindful of that, keep improving, keep reading, and keep questioning both yourself and the code and opinions of others that you read about. Understanding core principals around architectural design patterns is likely going to be important, and won't come to you instantaneously.

    If you're doing work for a client, please use a framework. You get improved maintainability out of the box - other software programmers now or down the line will generally have a much easier time working on a preexisting framework with specific standards, structures, and documentation, rather than anyone's homemade code.

    Security-wise, please choose the framework. While learning about security is good, perhaps by trying to write your own code, using a framework is not only easier, but much more appropriate and safer. A proven framework will generally be written and audited by people that have a lot more experience than you and notably a better eye for security.

    A small team or individual writing home-grown code is much more prone to forgetting or not knowing or incorrectly attempting to handle security issues. Security is easy to screw up for everyone. Things slip through the cracks, this happens to the best of us. So don't take chances. Rather than writing their own code, even professional software engineers will generally leave important security implementations, e.g. password hashing, to well-tested open source solutions.

    Best of luck, and whatever you choose, make sure to have fun with it :).
    Last edited by TimeBomb; 3 Weeks Ago at 09:49 AM.

  7. #7
    Programmer cyberinferno is offline
    True MemberRank
    Jun 2009 Join Date
    BangaloreLocation
    469Posts

    Re: Pure PHP Or PHP framework?

    In my opinion, if you know some PHP and you have a new project, then you should start learning the following things

    * Using composer dependency manager in your project
    * A modern PHP framework like Laravel or Yii2

    I say this because you can save lot of your time as most of features that are needed for any project i.e. boilerplate code is already written in a framework. Frameworks also make you stick to a well defined code structure so there's less chance of making your code a mess. Composer helps you import 3rd party code without much hassle.

    tl;dr USE A FRAMEWORK FOR ANY PROJECT SO YOUR CODE LOOKS SANE EVEN AFTER A DECADE
    Have a look at my simple Discord bot https://github.com/cyberinferno/discord-chum

  8. #8
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,089Posts

    Re: Pure PHP Or PHP framework?

    Let's also factor in that this is for their upcoming project in their course, so they have limited time. Might be time better spent using raw PHP opposed to learning a framework right at this moment. @RakisTa what type of project is it, what's the project scope?
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.

  9. #9
    Member RakisTa is offline
    MemberRank
    Nov 2012 Join Date
    53Posts

    Re: Pure PHP Or PHP framework?

    Quote Originally Posted by fallenfate View Post
    Let's also factor in that this is for their upcoming project in their course, so they have limited time. Might be time better spent using raw PHP opposed to learning a framework right at this moment. @RakisTa what type of project is it, what's the project scope?
    The project that we're going to do is a loaning system that involves several functions ( Accounting stuff)
    and I was planning on doing a similar project for a client.

    Gonna go for pure PHP for the project and framework for the client right?

    what framework would you guys suggest for me to start off ?

  10. #10
    Mod and Dev - C9, 4Story fallenfate is online now
    ModeratorRank
    Oct 2014 Join Date
    Arad DomanLocation
    1,089Posts

    Re: Pure PHP Or PHP framework?

    For your school project I recommend using PHP without a framework, on the side it will be worth learning a framework for when you get to the client project, yep. Need to check the client requirements though, if they want it to interface with their software system, or become available as a web app (which is quite popular these days), PHP won't be all that you need.

    As for what framework to learn, I recommend Laravel or Magento (if e-commerce).
    If I helped you, please click the Like button at bottom-left of my posts. Thank you! :)
    I am also vasheni at deviantArt.com.




Advertisement