Before keep on going, and just code like madness, I'd like to find a way, a
methodic way, that allows me to separate (not physically, not the files, but
logically), those project parts.
How can I logically separate CSS from Javascript, from PHP, etc... ?
I've read about singletons, and DI, and factories, but WOW... let's keep it
simple for now, I have no more than some weeks of PHP, I just want to
organize the best I can. So keeping in mind that I'm a newbie, what would be
your best advices, for start doing this this way?
Thanks a lot,
Márcio
I’m the most newbie you can get. I can learn and I’m avid for doing so, but I’m very newbie php and OOP programmer, if I can call me that. :)
Thanks,
Márcio
Thanks a lot for your advice I will read more about those topics.
Still, I was reading about MVC and it was not easy to understand where the javascript + php separation on a possible ajax application can work there… But I will keep reading.
About frameworks, well, I’d like to avoid them for now. I really want to learn. I was having great pleasure dealing with PDO and make a database connection, I’d like to learn PHP foundations more than custom framework code, if that’s the case. But maybe I’m misjudging frameworks… ?
Maybe having a structure and using some classes here and there for the hardest parts can do the trick? But again, in this case, what organization should I take to allow stability and scalability, are those impossible goals for a newbie?
Note that, as a learner, I don’t want to use one single piece of code that I cannot properly understand, and that’s also a challenge… :)
Regards,
Thanks a million Robert and Bruno.
@Bruno Reis
If part of my learning process to also know the structure. So I’m more on a mood to create (even if it’s little, and not well constructed) my own structure, but I absolutely need one, and that’s a point that I want to state clearly ;).
@Robert Gonzalez
I’m not a expert on all that disciplines, for example, CSS and Javascript are a DOM world where I only grasp. But I know there places on the all picture. And despite new on programming “by hand” I’m not that new on web-development. So I do believe I pass all the disciplines that you have stated, not as a master, but as someone capable of understanding how they are related to each other, and to get the basics done. I already have the basics like loops, conditionals, var types, using procedural to.
It’s because I have done this the “wrong way”, that I’m trying to appeal on a better way.
And your last statement is not at all trivial for me:
“is not that hard to do once you figure out what your structure will look like.”
And that is where my question resides: “Where should I learn about structure?” How can I, newbie, do little things, starting by very simples tasks (like a database connection shared by all classes) but doing that on a well structured logic way?
MVC could be an answer but, gash, it’s hard to get there with no information architectural bases or something…
Should I go with a bunch of includes, scripts, requires etc … ?
Regards,
Márcio