...

View Full Version : Where to go next?



SDP2006
01-04-2004, 09:14 PM
I'm so lost about where to take my track of learning PHP Next. Here is what I can do.

- Basics of inserting data/selecting data from database through PHP Scripts
- Basic GD, very basic.
- Files, writing to files, creating with PHP
- Including (hard stuff, isn't it :))
- Query Strings
- Using and implementing $_GET & $_POST and other Global variables
- Just scratching the surface of OOP.

I wanna learn OOP, but I'm not sure. What do you guys think?

- Thanks

me'
01-04-2004, 09:50 PM
What do you want to do with PHP? I'd say XML parsing would be an excellent one to add to your list, but the rest is up to you.

SDP2006
01-04-2004, 09:53 PM
That would be good. I'm definitely going for OOP.

What exactly is XML Parsing? :)

me'
01-04-2004, 09:57 PM
Taking XML files and doing what you will with them. IMO, the easiest way of doing this is with XSLT and the XSLT functions provided with PHP (requires Sablotron to run). This has been documentet several times already, so I'll give you a couple of refs: My original thread (http://www.codingforums.com/showthread.php?s=&threadid=30545&highlight=Sablotron)
Sablotron homepage (http://www.gingerall.com/charlie/ga/xml/p_sab.xml)
Using the XSLT functions with PHP (http://www.php.net/manual/en/ref.xslt.php)
Learn XSLT at w3schools (http://www.w3schools.com/xsl/default.asp)HTH

mordred
01-05-2004, 12:12 AM
@SDP2006: Investing more time and energy into OOP will certainly pay off. Also, you won't run out of things to learn for a very long time. Frameworks, unit tests, n-tier architecture, design patterns, MVC, <insert favorite OOP buzzword>...

Two things that come to my mind which are worth learning too:

- Regular Expressions
- Sockets/Network Programming. Just some simple HTTP for a beginning

But XML processing will keep you busy too.

@me':
I have to admit I find it rather strange that you refer to XSLT as the easiest way to process XML documents. I don't think so at all, for XSLT you need to feel comfortable with declarative programming, recursion, a lot of XML concepts like namespaces, XPath and some more gotchas that aren't on my radar right now. Only think of the Muench method for grouping selections.
Granted, people are different, maybe XSLT is much more intuitive than it was for me. :)

me'
01-05-2004, 12:12 PM
@me':
I have to admit I find it rather strange that you refer to XSLT as the easiest way to process XML documents. I don't think so at all, for XSLT you need to feel comfortable with declarative programming, recursion, a lot of XML concepts like namespaces, XPath and some more gotchas that aren't on my radar right now. Only think of the Muench method for grouping selections.
Granted, people are different, maybe XSLT is much more intuitive than it was for me. Indeed, I picked up XSLT after a couple of examples and a trial session, and I'm now using it fanatically within my CMS. You don't really need to know about namespaces to learn basic XSLT, XPath is easy, but recursion? How does that come into XSLT? By declarative programming I assume you mean declaring variables before usage, but that's easy, just stick a few <xsl:param>s at the top of your code if you're passing it parameters.

mordred
01-05-2004, 01:54 PM
Hmh, I thought almost all processing in the XSL file was done
recursively. You definitely do need recursive techniques when you want to apply things like generating a list of numbers, what you normally would with iterations/loops in a different language. See the first example on this page
http://www.dpawson.co.uk/xsl/sect2/recursion.html

Declarative programming leaves the execution flow at the computer. With imperative programming, you tell exactly what steps the computer should take, as opposed to declarative programming, where you define the results you want to get. SQL is also declarative. Perhaps that wasn't the best explanation, here's another one, much much better:
http://gnosis.cx/publish/programming/xml_models_xslt.html

It's not that I say that declarative programming is bad, it is just... different, and sometimes you need to twist your head a little. It's definitely worth learning, and also fun, but I wouldn't necessarily say it's particularly easy (especially if you're only used to imperative concepts). That's maybe the only point where our opinions differ. :)

me'
01-05-2004, 02:01 PM
Okay, so maybe I haven't delved as deep into XSLT as I thought I had :o I haven't really explored <xsl:if>, <xsl:choose> or the more programming languagey elements to XSLT.

After skimming that article, I see what you mean about declarative programming, and indeed I sometimes find it fustrating that XSLT isn't imperative (things like, I'll have a run of paragraphs, marked up with <paragraph>, but there might be an <image> in there too. This results in quite a lot of conditionals surfacing that needn't really be there if XSLT was imperative), but most of the time it's great as it is, and seems well suited to XML, where (most of the time, exceptions in dated things like RSS) it doesn't matter what order the nodes are in.

If you think about the DOM, you might call a function like getElementsByTagName that returns the elements in order of appearance. How often is this order useful? 99% of the time, you'll loop through, doing something to all the nodes. You're emulating declarative programming.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum