Welcome Guest, Not a member yet? Register   Sign In
Best way to learn to program websites
#1

[eluser]DonCoryon[/eluser]
I am a business major but I have a high level of interest in programming/building websites. I have messed around with some of the "point and click" programs, Drupal, Word Press, MyBB. I like all of them, but I always want to change this or that I can never figure out how. Thus I want to learn to code PHP then perhaps I can actually work with the software or build my own. CI seems very interesting because I think I would have more fun building my own software then tweaking someone elses.

My question to you all is should I learn to code PHP, through books and online tutorials, then learn CI or can I start right here at CI to save time?

Any help on someone trying to "self teach" is appreciated.
#2

[eluser]Tom Schlick[/eluser]
you need to have a solid foundation of php before you start with ci. it is possible to dive right into ci but you will have more trouble in the long run because you will not get the basics behind why certain things are done. id recommend

http://nettuts.com and http://blog.themeforest.net

they both have tutorials on getting starting with php that are screencasts as well as codeigniter screencasts... they will help you a great deal. also you probably want to pick up a reference guide to php for quick questions.

good luck to you sir and welcome to the codeigniter community!
#3

[eluser]jedd[/eluser]
I'm with trs21219 -- I think you'd want a bit of PHP under your belt before you started mucking around with any PHP frameworks. While CI would be much easier to get into than, say, Zend .. I reckon it would just be too confusing to try to start with the language and the framework.

Of course, it's impossible for any one person to have approached this from both directions, so this is pretty speculative stuff. The nice thing with PHP, though, is that it's something you can very easily start to dip your toe in - starting with some basic HTML pages, you can trivially modify them with a few lines of PHP, and then work up from there. How fast you could pick up enough PHP to be comfortable to then start experimenting with a framework is very much down to how much time you can allocate, and what your aptitude is for new languages (which correlates to how many other programming languages you've had some exposure to). Having said that, PHP in turn kind of requires you to have a modicum of understanding of HTML, and consequently CSS.
#4

[eluser]Colin Williams[/eluser]
Plenty of PHP books on your local book store shelves I'm sure.
#5

[eluser]DonCoryon[/eluser]
Thank you for the replies. I agree with both your assessments. I should probably get a few months of straight PHP under my belt to learn the "why" before I learn the "how" with the framework. This is probably why I can only get so far with the CMS's as well. I have been successful to some extent tweaking Drupal, I even contributed four themes back to the community, but I never really understood why that things were done, I was just able to mimic examples.

Thanks for the warm welcome.
#6

[eluser]Colin Williams[/eluser]
The best thing I ever did for myself when learning to program was to print out a script that I was very confused with. I sat down with it during an afternoon at Saturday school with a red pen and yellow highlighter and just dissected the thing. Syntax is usually fairly easy to figure out and is of course easy to reference, but programming is mostly about knowing how to structure logic appropriately.

So, a good first step might be to print out some CI code (I suggest system/codeigniter/CodeIgniter.php) and just sit down and figure out how it works.
#7

[eluser]mikeyhell[/eluser]
[quote author="trs21219" date="1255318668"]you need to have a solid foundation of php before you start with ci.[/quote]

I don't think this is really true. Any new programmer I deal with I start them out with codeigniter which accomplishes two main goals. First, they get a powerful framework that is easy for them to start coding(safely) in. By safely, I mean that their code is *less likely* to be a hack waiting to happen. I work primarily with companies who's sites have been compromised and almost every case it's because the coders are unaware of these issues and/or they are trying to accomplish their goals from scratch and have no real method or workflow. Second, they get a very solid understanding of MVC and site architecture. MVC obviously isn't the only design patter, but it's much better to know one than to let a person loose cowboy coding away and hope that they produce quality work. I primarily code in symfony and kohana and it's difficult to find good programmers that know both of those much less one of those and when I do chances are they learned a different style of programming or a different use of those frameworks that what I use them for. My solution to this is to build programmers up with a solid foundation using CI and transition them into Kohana and eventually into Symfony. I now have 4 very skilled programmers who I've taught this way and it's worked out very well and in a very short amount of time(less than 6 months). There are some caveats to this, mainly having projects running in all 3 of my prefered frameworks at one time which can sometimes slow development and confuse workflow and second initial investment into coders skill level is costly.
#8

[eluser]BrianDHall[/eluser]
The thing to keep in mind is most of us who've been around a while did not have any of these tools available to us when we started, so our advice must be taken with a grain of salt.

I learned PHP using Notepad, a free PHP hosting account, and reading the PHP.net manual. That is really all you need to get started, its a damn good manual.

The issue is every additional thing you try to learn is...well, something else to learn. Trying to do everything at once sometimes makes it harder to learn anything.

However, neither CI nor PHP are particularly hard subjects to learn. I actually don't think it'd be bad to start right here, because you can easily download XAMPP/WampServer and get working locally, grab either a simple editor like EditPlus or Notepad++ or an IDE if you area really already familiar with getting them working or if you know someone who can get you started (they tend to be confusing, lots going on there), and then getting CI's welcome page isn't terribly harder than getting a regular hello world script running.

You will have to be comfortable working with things you don't fully understand at first, and if you are OK with that then you might like it. Some people have a problem with doing something that they don't really understand how it all works, because typing $this->input->post('login') - there is a lot of meaning there, and you have to be ok with using statements like this without really understanding at first what the hell is going on.

I didn't have a debugger for years, nor an IDE to provide in-line syntax warnings, but in retrospect this might have made things harder to learn rather than easier.

My advice would be to go ahead and go with whatever excites you most. If you like the look of CI and think it'd be fun, go ahead and try to get started. Bookmark Php.net manual and CI manual, and get going. It will only take a few days for you determine if its just too much and you need to go back to something more basic, if you are able to get along with all these technologies and work your through it as you go.
#9

[eluser]DonCoryon[/eluser]
Do you think if I learn CI first would that give me "bad habits" if I ever used a different system for a project? I would thinking learning PHP first then I could expand and learn different frameworks and CMSs.
#10

[eluser]BrianDHall[/eluser]
[quote author="DonCoryon" date="1255386024"]Do you think if I learn CI first would that give me "bad habits" if I ever used a different system for a project? I would thinking learning PHP first then I could expand and learn different frameworks and CMSs.[/quote]

It's not so much "bad habits" as it is "habits" - all habits are inherently problematic when their assumptions change.

In pure PHP it is easy to get used to making spaghetti code (mixing content, data, and logic), programming procedurally with little use of OOP.

All CMS and frameworks are deeply different in how they use PHP and what other tools they make use of. Symfony, for instance, is perhaps as rooted in the command line as Ruby On Rails, and of late they tend to prefer Java-style passing of parameters. This makes it unique, as the bakery makes CakePHP unique, and the large amount of bundled Zend libraries makes it unique, etc.

The extra structure of a framework may be good as it actively steers you away from unwise choices and tries to assist your efforts with common libraries and helpers.

No matter what you learn, it will never be The Right Way - because there is no one true god of computer programming. Some methods are just less bad than others.

And everything you learn will, at some point, need to be unlearned. New situations will call for different ways of doing things. I suppose I'm tending to think of pure PHP as "the way we use to do it" - and frameworks are the result of thousands of people coming to similar conclusions on better and worse ways of going about common tasks.

It seems logical to me to go ahead and borrow from the latest and greatest ideas. CI is unusually nice because most of the time it is like you aren't really working with a framework, it tends to do very little unless you want it to and does difficult to understand magic only rarely.

You'll generally be able to copy/paste code right into a function, or heck even a view for that matter, and it will work. This way you aren't limited to learning purely from CI tutorials, because there aren't many.

Really, its just purely up to what you enjoy so that will dictate how fast you can learn any of it. Don't be afraid of learning the wrong way - it's all the wrong way.

Computer science is young and dumb, we haven't managed to cross even a percentage of what is possible, so just keep an open mind and do whatever gets the job done.




Theme © iAndrew 2016 - Forum software by © MyBB