Page 1 of 2
what gave you the most hassle?
Posted: Thu Apr 15, 2004 7:46 am
by malcolmboston
Just wondering what you guys have had problems with whilst learning PHP.
upto now my biggest problem has been scanning directories etc, still dont fully understand the syntax, have pretty much sailed through the rest upto now
<-- expecting lots of peeps to talk about classes...........
Posted: Thu Apr 15, 2004 4:48 pm
by d3ad1ysp0rk
regex. Never learnt it, probably never will master it either..
Posted: Thu Apr 15, 2004 5:03 pm
by tim
for sure will go with Punk on this too.... //1!!
Posted: Thu Apr 15, 2004 5:24 pm
by Weirdan
Did you mean \\1 ?

Posted: Thu Apr 15, 2004 5:29 pm
by markl999
s/\/\/1/\\\\1/

Posted: Thu Apr 15, 2004 5:29 pm
by tim
see, most hassel =]
i always mix up my forward/back slashes
i always type \\ after the http: in the address bar. i'm horrible
:/ edit - this is going to turn into a sub-pattern/back reference topic.

Posted: Thu Apr 15, 2004 6:28 pm
by JAM
Weirdan wrote:Did you mean \\1 ? ;)
Haha... Good one. :twisted:
Personally, I hated (and still do) regexps and OOP, even though the later is a very big buildingstone in PHP... :?
Posted: Thu Apr 15, 2004 6:44 pm
by llanitedave
I expect OOP to give me the most trouble, since I seem to have a mental block about it.
PHP itself seems pretty straightforward as a language, although there are a few tricks that trip me up, like headers and redirecting. Mostly so far I stumble over dumb little syntax errors that take me forever to find.
I'm learning javascrpt at the same time as php, and javascript seems more difficult for me.
But my OOP problems will be the same in any language!
Expect to be getting a lot of dumb questions from me in the upcoming months...
Posted: Thu Apr 15, 2004 6:47 pm
by markl999
The problem with OOP is the methodology. The syntax is easy, it's there for all to see on php.net. I found reading/learning about Design Patterns first before learning OOP was more useful. Even if you don't implement the design patterns to the letter in php the whole concept/theory makes designing objects a lot easier.
(imho

)
Posted: Thu Apr 15, 2004 7:23 pm
by Pyrite
For me, setting up php4 on NT4 Server as a CGI Module for IIS 4.0 was a big basturd.
Also, the infamous "Headers already sent" message has always been a thorn in my side. Especially if you send headers once for some stuff, then you can't use the header for redirects later in the same page.
regex is something I won't ever understand.
Working with cookies ...
Trying to mix php and javascript in certain situations ...
Upgrading php and having my code stop working in the past at certain versions was a pain.
Difference in database syntax (which is why I love ADOdb so much).
etc.
Posted: Thu Apr 15, 2004 10:23 pm
by BDKR
Trying to figure out work arounds for things that PHP doesn't natively support. Like threads! Semaphores, fork, and shared memory helped, but I had to do some reading.
Cheers,
BDKR
Posted: Fri Apr 16, 2004 12:48 am
by llanitedave
markl999 wrote:The problem with OOP is the methodology. The syntax is easy, it's there for all to see on php.net. I found reading/learning about Design Patterns first before learning OOP was more useful. Even if you don't implement the design patterns to the letter in php the whole concept/theory makes designing objects a lot easier.
(imho

)
A bit of Karma: A couple of years ago, I found a hard-cover copy of "Design Patterns" by Gamma, Helm, Johnson, and Vlissides under a bush near a dirt road in an isolated area of the Spring Mountains. There wasn't another soul around for miles. It was in perfect condition.
I looked through it a little bit at the time, hoping it might be useful, but really didn't understand much of it. I'm rereading it again now, and getting a lot more now.
You never know what you'll find when hiking in the mountains! I was looking for fossils, but found something a bit more current...
Posted: Fri Apr 16, 2004 6:42 am
by malcolmboston
markl999 wrote:s/\/\/1/\\\\1/

i gotta agree regex is a nightmare
Posted: Fri Apr 16, 2004 9:59 am
by McGruff
llanitedave wrote:I expect OOP to give me the most trouble, since I seem to have a mental block about it.
For me, I'd say everything was difficult until I learned a bit about OOP. I've written my fair share of tangled, un-testable, un-maintainable spaghetti code.
There is a bit of a learning curve but once you get into the OOP way of thinking, everything becomes much simpler rather than more complicated.
Posted: Fri Apr 16, 2004 11:06 am
by BDKR
McGruff wrote:llanitedave wrote:I expect OOP to give me the most trouble, since I seem to have a mental block about it.
For me, I'd say everything was difficult until I learned a bit about OOP. I've written my fair share of tangled, un-testable, un-maintainable spaghetti code.
There is a bit of a learning curve but once you get into the OOP way of thinking, everything becomes much simpler rather than more complicated.
I like and use OOP too (if I didn't, I wouldn't be doing so much with Python these days), but I have a big problem with the idea that the only way to get away from sphagetti is to use OOP. I really don't believe this is correct. One (or a team) can create a very well organized and flexible procedural code base. It may not prove
as flexible as an OO based solution, but it can be done.
Cheers,
BDKR