To programmers

Hello programmers.

I’m playing with PHP since the day I joined this community. Since them, I’ve be playing almost daily with that language.

I cannot say I’ve done no progress because I would be lying. Still, in February I will do 3 years on PHP development and I still don’t feel solid on solving programming problems.

I’m on a phase that I can… hmm… try more or less, understand almost all the code that is provided to me BUT, still can’t come with a clever solution myself.

Just wondering… :slight_smile: From your earlier years, do you recall this state? Or you have not pass by it?

Regards,
Márcio

maybe it’s the way you have been “playing” with php that has unfortunately slowed your progress.

if you have been just looking at code from forums like this or randomly elsewhere on the www without any real structure in your learning process it, imho, could be very easy to miss important concepts or not understand them correctly.

if you haven’t done or aren’t working systematically through the learning process I would suggest possibly working through a set of tutorials. in parallel to this you could go to your local library and borrow a good text book on php and work through it and its exercises/projects.

Thanks a lot.
I take your advice. I will find my time to read some books so that I can gain that structural knowledge of this.

But… I will keep playing. I just can’t take it serious in a strong ethical sense, what can I do? :wink: That doesn’t mean, HOWEVER inconsideration. :slight_smile:

K. Regards,
Márcio

Specifically what issues are you having trouble solving yourself?

Do you program for a living? A lot of it really comes down to work experience dealing with situations that aren’t your own. I don’t think I would have ever been able to to understand the things I do now if it hadn’t been for dealing with actual, work related situations. Learning at your own pace, what you want to is very different than being forced to, given a problem that must be solved for a specific business related circumstance.

At the end of the day, theory is great but its nothing without execution and application to practical circumstances to achieve business related goals.

Yes…

Without execution we can’t learn more, But using theoritical tutorials we can have some basic ideas. Anyway thanks for this link and useful topic.

Well…

If I see a pagination code I understand it.
If someone asks me: “do a pagination” I can’t do it. I take ages to understand what is required.

If I see a code of some basic zend structures, I understand them.
If someone asks me, can you please create a page to show user details… I get stuck on the process. However, once I see it, it’s easy.

I’m starting to get the code, but not the structure that makes it.

So, I’m wondering if this makes part of the process or, if otherwise, it’s an alert sign, to grab some books.

I guess the last is the case. And I also guess that That is a good advice to follow. Still, when you are stuck with work, and you have to hack hack and more hack, where the hell do we find the time to follow tutorials?
The ophthalmologist is my best friend already!

Oh well, bad days, who don’t have them. :wink:

Márcio

Although it was not with PHP (I’m using Coldfusion), but I remember having similar problems years ago. At one point some of of my friends, doing the same work, said to me!

You know what your problem is? You think about it to complicated .
And that was indeed my problem. I always was always looking for way to complicated solutions. Since that time I think about it in an easier way.

it sounds like you have an understanding of the basics of PHP but to help you develop your skills to think logically and go on to build your own applications from scratch I think you’re going to have to bite the bullet and set your self a project to build from scratch.

As you build it you can use :google: and forums like this and books etc as references to help you when you get stuck.

A good “learning” project you might want to consider building from scratch could be a “log in” application.

If you’re not confident with working with databases then for purpose of this “learning project” you could simply use a comma delimited text file as your “database” to store user details.

So thinking logically the initial requirements would be

  1. create a text file or dtabase table with some pretend user details in it.

  2. create a login form.

  3. when the “login” button is clicked, send the username and password entered by the use to a php script.

  4. the php script then checks the username/password to see if they exist in you “database”

  5. if they do, then get the user access level for that user (say either “user” or “admin”). If they don’t, display an error message and redirect back to the login page.

  6. if the user’s access level is admin, redirect them to adminHome.php and if it is user, redirect them to userHome.php

After you got the login process working you can then expand on it by providing a button on the login page for new users to register. You can also then build forms and the back-end php code for users to change their password. For the admin users, you could build a form and back-end php code to add/edit or delete users from the database.

But as others have also suggested, you probably need to start building your own applications.

Building your own applications will also help you develop your own debugging skills, which imho is a very important skill to have. If you don’t have skills in debugging (which involves thinking logically and laterally) you will be continually relying on others to do it for you or to guide you along the way.

Anyway, just my :twocents:

also, to help you work out the requirements and general process, you can start off by drawing a simple flow diagram showing the tasks you would need to do in their order if you had to achieve the final goal by hand and not with a computer program.

steps 1-6 in my previous post are a sort of flow diagram, but in words.

There is a fine line between thinking to little and thinking to much. On one end you get sloppy code and on the other a convoluted mess. The right place to be is somewhere in between in my opinion. Don’t think to much but don’t think to little. Anticipate possible change, patterns, good practice, feature enhancements, etc but don’t let it consume development strategy.

@oikram

Sounds like you need to set some achievable, concrete goals and work on some projects. Theory and the “proper” way shouldn’t hold you back. Just do things the way you know how and stop questioning your decisions. Perhaps, they are worst decisions ever, perhaps not, but at least your starting and by starting and failing you will learn to do things properly and become a better developer. No one woke up one day and was just an amazing programmer. It takes time and failure to succeed. The worst thing you can do is never start at all, than starting incorrectly. Hopefully you know enough to avoid major security based mistakes, but the pattern stuff, good practice, MVC, etc is all just good practice. Yeah, its nice to know and have in the tool set but getting there requires doing things the wrong way a couple times first.

That isn’t to say people of this forum and others won’t hammer you on proper practice, MVC, etc but there comes a point when you just have say no and move on with what you have, based on your skill set. Everything else will come in time. It seems like many of the new comers are attempting to start at the top based on the criticism received by more experienced programmers regarding advanced topics, I myself am guilty. Its important to know when to say something is good enough and move on knowing that it can always be better. That is something that can be said whether you’ve been programming for a month or 10 years. Though with the ladder its more a question based on the budget involved than anything, which makes it a little easier, perhaps.

So stop worrying about whether something should be in a class, a method, what a methods name should be, if the database adapter should represented by a class, if query should be outside the HTML, if something isn’t the best way of achieving a goal and just do it. Honestly, that is the only way to get better, make mistakes and learn from those mistakes. No amount of theory, book learning, tutorials can live up to the lessons learned via actual mistakes or failure, small or large. Its true in life and its true just the same in programming or any other profession.

Yeah you’re right in that. I personally find it very helpful, when i step away from it for a little while instead of insisting to find solutions there and then. I take a walk or whatever. And what helps me as well is to think the other way around. Instead of thinking first about everything needed to reach a certain result, I start with the result and work backwards. I.E. What is the goal and how can I reach that and then divide the process in smaller portions.