Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Learning a programming Language
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
x-ecutioner




PostPosted: Sun Jun 21, 2009 2:18 pm   Post subject: Learning a programming Language

hi,

i am interested in learning PHP and have been doing so for 3 years now (very on and off). The reason that I keep switching my priorities is that i keep changing my approach at learning. At times, I think I am better off learning PHP by reading through books on it page by page and then programming. Other times, I think i am better off learning as I go and looking up for loops and other structures in the book. I have experience in turing and experience in HTML, but thats about it.

The question im going for here how do you guys best learn a programming language?

another question that i have is that do you guys know of any PHP textbooks out there? I think that maybe I will be better off learning a concept, doing activities about it, and then moving onto the next unit. I don't tihnk all these o'reilly books etc are suitable for me because i dont have that strong of a programming background yet to just switch from language to language.

any help and/or advice would be appreciated,

thank you:)

x-ecutioner
Sponsor
Sponsor
Sponsor
sponsor
ecookman




PostPosted: Sun Jun 21, 2009 2:29 pm   Post subject: RE:Learning a programming Language

I learn by looking at other codes and projects and dissect each part.

then try to make something out of it
DtY




PostPosted: Sun Jun 21, 2009 2:35 pm   Post subject: RE:Learning a programming Language

I learned PHP from a book called (I think) just "PHP 5", it's probably outdated by now, I learned from it, I think, not too long after PHP 5 came out. It's still a good book though, I doubt there are major changes to the language (at least, I haven't found any). I can't remember who published the book, but it had a rather plain red cover.

I think that if you just learn the basics, then just program and look stuff up as you need it, you'll do fine, especially since this isn't your first language.
I'd suggest you learn:
* echo (which I'm sure you already know)
* Strings (interpolation, single quote vs. double, splicing, concatenation)
* Integers (arithmetic, binary operators, what you know from Turing should transfer pretty seamlessly here)
* Arrays (stacks, queues, hash tables, splicing, searching, forget what you may know about arrays in Turing- PHP's don't suck as much)
* Including other files (There are four functions for this, and it's good to know which you need. Probably every website you make will start with require_once("header.php")Wink
* User interaction (getting input from the user via html forms, get and post, etc.)
Then some stuff that you may not really need, but if you want to learn, no harm:
* Database interaction (SQL queries and the like, if you learn this, you should learn prepared statements right away, most places don't teach them first, but they are much easier, and more secur)
* Templates (files containing a layout that you plug variables into. Ides is to separate programming from layout)
* Object Oriented Programming (IMO, it's overkill in web applications (especially with PHP), but it doesn't hurt to learn)

If you have any questions about any of these topics, feel free to ask
x-ecutioner




PostPosted: Sun Jun 21, 2009 2:47 pm   Post subject: RE:Learning a programming Language

hmm i have a fair grasp on most of those topics
its just i always fail at OOP. I have kind of a hang of it but i always figured it was essential for php apps? and since i kind of dont get it, kind of do, i just got discouraged. Perhaps I should try ecookman's suggestion and learning programming that way. its just often, the programming itself is so complicated. Like, trying to understand wordpress source code would be very confusing for me... do any of you know of any simpler scripts i could refer to? or should i look up as i go along? So if i wanted to make a registration form i guess I could look up how other people do it and base my scripts on that... Its just the process seems so mindless; i dont wanna end up copy pasting and redundant. Why not just learn the concepts of the language correctly to begin with? so i wont have to refer to other people's code?
DtY




PostPosted: Sun Jun 21, 2009 3:45 pm   Post subject: RE:Learning a programming Language

OOP is pretty useless in php, like I said. Chances are, no matter how big your web app is,you're not gonna need OOP.

I'll upload some small PHP scripts I have around, for you to look at Smile Just gimme a minute
DtY




PostPosted: Sun Jun 21, 2009 4:01 pm   Post subject: Re: Learning a programming Language

Attached:

*viewsource.php (You'll need to download geshi to use it)
Any page that includes that will let you view the source with geshi's syntax highlighting by adding ?source to the url. You can see what that looks like over here: http://death2y.uuuq.com/w/watermark.php?source

*bbcode.php
Uses regular expressions to do basic BBCode parsing, does basic tags, smilies (not included), and curse censors.

*Image Watermarker
This isn't actually watermarker, it's stenography, but it's easier to explain it as a watermarker than a stenography tool. It will allow you to upload an image, then redownload it with text hidden. Text is encoded in the lsb of the red channel starting top left, and going right, then left to right on the next row. You can also use it to get the text back out of an image. It's one of my favourite scripts that I wrote Smile
You can see it online here: http://death2y.uuuq.com/w/
(You will need GD image libraries installed to use it, they may be standard with php, I'm not sure)



scripts.php.zip
 Description:
Scripts

Download
 Filename:  scripts.php.zip
 Filesize:  5.51 KB
 Downloaded:  98 Time(s)

x-ecutioner




PostPosted: Sun Jun 21, 2009 5:32 pm   Post subject: RE:Learning a programming Language

awesome i really do appreciate it
thank you so much
just give me a couple hours im not on my own computer right now

definetely ill take a look at all this and keep ya updated

thanks again
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: