Jump to content
Larry Ullman's Book Forums

My Project Diary


Edward
 Share

Recommended Posts

Yes, I agree with the both of you, Buttercream and Antonio. After so many years of dealing with the PHP manual on php.net, I've gotten used to it, but that doesn't mean I enjoy using it or still don't get confused from time to time.

 

In regards to the callback, callback functions are a big part of JS and event-driven languages. The concept is that you can't always perform some processing right now, so when it's possible to do the processing, then the callback (function) is called, and processing is then performed.

 

Recently, I've seen a lot of concepts from JS leaking over into other languages (e.g., callbacks, anonymous functions, etc.). It's kind of funny, considering how much JS used to be hated on by "real" programmers. Now, it's not only up their with the big dogs, but it's becoming the standard use to set new paradigms in programming.

Funny how that works.

 

Anyway, to get back on topic, I agree with what Antonio said in that actual code is worth more than a thousand words. My advice: Try to use the function, and see what happens. After you have some idea of how it works, then you can probably read the manual and make some sense out of it.

  • Upvote 2
Link to comment
Share on other sites

Guest Deleted

Hartley: Oh I understand array_map just fine now and I think it's awesome. When the manual dissapointed me, I left and researched on Google. When I found the following page, and read the first answer, the light bulb went on: http://stackoverflow.com/questions/3713517/php-shortest-longest-string-in-array

 

I sorta get callbacks. I've caught on to the principle that some functions let you feed it a function name as one of the arguments, and that it uses that function name to call the function. However, I'm not used to talking about callbacks or reading about callbacks, so I can be a little slow to catch on when they're the topic of discussion.

 

Antonio: There have been times when I thought the CI manual was too sparse, but I felt that if they added some more articles it would patch the holes.

Link to comment
Share on other sites

Buttercream, not to correct you (again), but it's Hartley, not Harley. I'm not related to the motorcycle company at all.

Also, good SO link. Thanks.

 

Anyway, callbacks can be a confusing topic at first, I agree. No one ever really explains what they are, and they just assume that you know. Callbacks and the event-driven approach to programming is much different from the procedural and even OOP way of doing things, so it takes a bit of getting used to.

 

All the same, you seem to get it plenty fine now.

  • Upvote 1
Link to comment
Share on other sites

Guest Deleted

Wow, I totally thought I wrote Hartley. You say I've done that before? I must not be pressing the t key down hard enough or something. That's weird. Lately I've also had trouble typing simultaneously, I keep messing the t even though I thought I typed it o.0 Maybe my keyboard is broken.

 

I kinda have a love-hate relationship with SO. On one hand, its often my only source of answers, on the other, I had a bad experience there. I went on there, and I read the rules, but apparently I didn't understand them like they wanted me to because NOBODY liked the question I posted and I got bashed for "being lazy" and "not reading the rules." I guess my post was too specific or something. Well, after that I said to heck with posting on there. I didn't want to deal with people that are hostile to SO newbies.

Link to comment
Share on other sites

Yeah, the SO community can be harsh. I've had one question I asked before closed for being inappropriate (although I felt like it was totally legit). Don't let that one experience ruin your perception of the site.

 

It has a lot of bad questions and answers, but it also has some real gems.

  • Upvote 1
Link to comment
Share on other sites

The php manual tends to be my first go to when I need help with a function but I completely agree with the comments that it is difficult to make sense of. I mainly use it to confirm that I am using the correct parameters in the correct order and am expecting the correct return value. If I need more help, I look at the examples which I learn alot from and check out SO and a couple of other forums.

 

I don't think I've ever posted on SO but the first time I posted on another forum, the response was pretty harsh, totally not helpful and the responders clearly hadnt even read the question. That experience totally put me off forums in general for awhile but they are good places to learn and get help so I've persevered. This one and thewebdesignforum.co.uk are helpful. So is css-tricks but the php forum is heavily wp biased.

 

Edward - I've really enjoyed your project diary and have learned alot from it, though I haven't been able to keep up with all of it. You're so right in that there are so many things to learn. I'm currently learning ruby with a view to learning ruby on rails as there is a lot of demand for those skills. If you do get the time occasionally do provide an update, I'm sure many will be interested to see the final product.

  • Upvote 1
Link to comment
Share on other sites

Guest Deleted

marguax: I use the manual for that a lot. In fact I almost always have it open in a tag. I constantly forget what functions take what parameter and in what order.

 

Speaking of forums, I've had bad treatment on forums but usually it wasn't too terrible. It mostly consisted of people getting irritated because I didn't know to read the FAQ before posting. If you followed the rules, they left you alone. Now chats were another story. I stopped going in PHP chats many years ago because to get any question answered, you had to endure 5 minutes of insults, and then they might get around to answering. It usually went like this:

Me: Hi, I'm trying to do such and such, but I'm getting this error. Here is my code, can anybody tell me what is wrong?

Person 1: You should be ashamed.

Person 2: I smell an idiot.

Person 1: How can anybody code so badly?

Person 3: I don't think he'll ever learn.

Me: Umm, it's she actually.

Person 2: That explains why you're stupid!

Person 1: Can I date you?

Person 3: He's lying. Girls don't program. They're too busy painting their nails.

Me: *sigh* Is this really a help forum? It's called "PHP Help"

Person 1: If you were smart, you wouldn't need help.

Person 2: The answer is you need to do this this and that. Duh! I knew how to do that when I was 5 years old.

 

 

Kudos to you guys for being nicer than them :)

Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...
  • 1 month later...

My php is much better now, i hae had to rewrite parts of my project as my coding got better. The thing is when you improve things change the way you think and the way you structure things. So its quite hard because you have to go back and fix things. I am using model classes much better now, i have many many for each modell. This helps to cut down the code and help me organize things much more. So programming is really difficult especially on a big website, when you get better you have to keep fixing things so the process takes longer and longer the bigger the website gets. I think the main problem is i try to keep everyhing perfect and its not possible you just have to get things to work.

Link to comment
Share on other sites

I feel the same way you do Edward. When I first started learning, I didn't understand patterns, now I understand the need for them. I also really grappled with oop. It may slow down the project initially, but will speed up other aspects and also any new ones you start.

 

Are you using tdd? I've found that really helps but I do still struggle with writing them, particularly controller tests.

 

Its great that you've stuck with it your project.

  • Upvote 1
Link to comment
Share on other sites

  • 4 months later...
 Share

×
×
  • Create New...