Welcome Guest, Not a member yet? Register   Sign In
Opinions on using CI to teach a PHP 'newb'
#1

[eluser]Lone[/eluser]
Just wanted to gather some opinions from the people in here about training/teaching people PHP using CI as their starting point.

I have a good friend that is interested in learning some coding (particularly PHP) and I was thinking maybe it is best to just teach him using CI as the starting point - of course some basic PHP stuff but essentially get him doing examples using CI.

What is everyone's opinion on doing this? Personally I think it is a good idea as it gets a new programmer learning (the ever so great) MVC structure from day which whenever down the track for whatever reason they need to do their own work they will still build with in mind. Also, I think starting out with CI forms a great starting base where they won't need to do all of those repetitive annoying tasks you usually have to do when starting from scratch.

I guess the main downside is that they would have problems interpreting other sites built in different ways - but I think this is a given for any of us when looking at some other 'foreign' code and working out just how it is structured.
#2

[eluser]Michael Wales[/eluser]
I think CI is a great entry point for a PHP newbie. Derek Allard has a great post with some reasons why - one of the biggest reasons, CI will protect a newbie from writing a script that renders his server insecure.
#3

[eluser]kevinprince[/eluser]
Definitely wish Id put the effort and time I have invested into Codeigniter now at the beginning it would of made my life much much easier.

However do start on the basics of, what an IF, ELSE, SWITCH etc is the difference between them and other common functions before jumping into CI. Maybe lie and say you have to use a framework to work with a database Wink
#4

[eluser]Michael Wales[/eluser]
Yeah, I think the basic syntax level stuff definitely needs to be completed first - but that should take no more than one day.

When I was first learning I created a small cheat-sheet card, laminated it, and taped it to the end of my monitor. Anytime I forgot the syntax on something, I could just glance over at it rather than hitting the php.net documentation.

Also, php.net documentation is a must! After you teach them syntax, teach them how to use the documentation. Give them a few small issues (I need to reverse an array, I need to convert a MySQL DATE field to a Unix timestamp + 3 hours) and have them go find the functions to do it. Whether they get the code right or not - you simply have to understand how to use the php.net documentation.

Then you can get to CI.
#5

[eluser]Lone[/eluser]
Thanks fro the link Michael - great to see Derek thinking along the same lines as well.

The basic syntax certainly needs to be done first, but I was thinking you can pretty just just make a sample controller/view to test this out with them as well - but maybe just a single page would be best for a quick start.

Very true about using the php.net documentation - a lot of the comments are often quite handy on there as well.
#6

[eluser]Jesse Schutt[/eluser]
A very helpful thread...

I am totally new to php and I am struggling on how to teach myself. I have a fairly solid grip on xhtml and css, but I have the need to branch out into dynamically driven sites as well as retrieval of information through forms.

Any other advice would be appreciated!

Jesse
#7

[eluser]Derek Allard[/eluser]
I've not too much to add, but I will say that the best way to learn something is to "do" (oh, how very Kung-Fu the legend continues of me...). I'd say, pick a small project or a hobby project you've been thinking about, and build it. You'll learn SO much by fighting against real limits.

Then, go back and try to build it again. Think of your html stuff. I bet you look back at what you first did (which you were very proud of at the time) now and think "boy, look at all this stuff I could do better". That's how PHP and CI works also Wink
#8

[eluser]Aea[/eluser]
I share a different view from many of the other people here, I don't believe a framework is exactly the best manner in which something like PHP should be learned. I think that having a solid understanding of PHP will be very important if your friend wants to gain any traction as a programmer. A framework makes implementation easier, it's no substitute for knowing how a particular process / bit of code works. CI is a little bit different since it doesn't try to babysit you, but provides a very limited set of polished (and some absolutely horrible) libraries. Have your friend try to learn programming from scratch until he can make a relatively decent application, then introduce him to CI, this has two benefits: first, he won't feel intimidated and lost when he starts working with CI, and he'll be able to understand the necessity for a framework rather then trusting your decision. I know it sounds like a rather illogical statement, but when I was very new and I looked through CI I was wondering : 'Why the hell do I need objects?,' 'Why would I want to separate my code?,' but when I had some experience (all my work is personal, so I don't have extensive experience in a variety of different fields), I appreciated what CI offered me.




Theme © iAndrew 2016 - Forum software by © MyBB