This is embarrassing. I spent a fair bit of time at work today trying to read and parse xml.files in php. The only information I had to hand was that instantiating a simpleXMLElement object would give me a reference of some kind to the object contents.
If it were not for one of the examples, and to a greater extent the tutorials I found online, I would not have been able to use simpleXMLElemet. I do remember back when I was learning to program, all that was available was the API, but I seem to need to see it in action these days and I feel a bit behind my colleagues in this sense.
When I went to http://ie.php.net/manual/en/class.simplexmlelement.php, I thought "ok, theres my class. Let's see how the constructor works and we'll have a handle on the xml file".
So I checked the constructor documentation here http://ie.php.net/manual/en/simplexmlel ... struct.php, not fully understanding the argument representation but I tried anyway.
I got errors that I unfortunately don't recall at the moment, but it was a tutorial from a google search that got me up and running in the end of the day.
Can anyone refresh me on the art of reading and API? Do any of you actually work solely from APIs nowadays? It's eight years since I've programmed and my employer knows that I'll take *some* time to get back up to speed - but I want to do that as quickly as possible before my employer regrets taking me on.
Many thanks,
Ten
Colleagues use APIs, I use tutorials..
Moderator: General Moderators
-
tenleftfingers
- Forum Newbie
- Posts: 9
- Joined: Thu Oct 13, 2011 6:19 pm
- Location: Ireland
Re: Colleagues use APIs, I use tutorials..
Hi
SimpleXMLElement is a good example here
If you have no idea how does it work you will spend a lot of time figuring out how to deal with it. I like to see/run an example first and then go to API see what are my other options
It's bad idea to work only with examples (you can miss a lot of important stuff) and it's a waste of time to study only API (try to figure out everything from scratch)
SimpleXMLElement is a good example here
If you have no idea how does it work you will spend a lot of time figuring out how to deal with it. I like to see/run an example first and then go to API see what are my other options
-
tenleftfingers
- Forum Newbie
- Posts: 9
- Joined: Thu Oct 13, 2011 6:19 pm
- Location: Ireland
Re: Colleagues use APIs, I use tutorials..
Thanks maxx99. I guess my colleagues have prior knowlege about what they're using so they don't need the examples as much as I do. I'm using a mix of both and it's going well for me 