5 Replies - 19000 Views - Last Post: 02 May 2012 - 10:58 PM

#1 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Sharpening my PHP skills and being more efficient.

Post icon  Posted 30 April 2012 - 10:05 PM

I feel sort of like my skills with PHP are degrading... Many concepts I see are foreign to me and all too often I tend to over complicate things in an attempt to make my systems as intricate as can be. I'm pretty sure if an employer asked me what my worst feature would be, it's that I bite off more than I can chew as well as over complicating things. Can anyone point me in the right direction as to how to sharpen my PHP skills and possibly learn new (simple) methods?

Is This A Good Question/Topic? 1
  • +

Replies To: Sharpening my PHP skills and being more efficient.

#2 hiddenghost  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 39
  • View blog
  • Posts: 621
  • Joined: 15-December 09

Re: Sharpening my PHP skills and being more efficient.

Posted 01 May 2012 - 04:44 PM

When I first started out I loved the idea of the most complicated method.
Not just interconnected messes.
Like regex man. Use the regex and angels will sing. You know?
Kind of like tripping acid. Eventually you'll want to get off the ride.

Seriously though.
What I have learned to do is write the function call first.
That way I know what it's going to do before I write one bit of logic.

This works because if complexity is warranted the function call dictates that.
In my point of view nothing is wrong with complexity, but if a function call dictates simplicity over complexity that's the way to go.

Take for instance:
<?php
$para = useTheParagraphTag('A string between paragraph tags.'); // Maybe simple.
$table = createHTMLTable(array(array('string 1', 'string 2'), array('value 1', 'value 2'))); // Probably complicated.
?>

Those functions don't represent actual usable code. They are potential calls waiting to be defined. This works with object methods too.

Also I like to think that functions are not just for encapsulation of often used code.
They are useful for hiding complexity.
Where complexity is applicable to a solution hide it in a function.

I'm certainly no expert. I can still say, the argument over complexity ends where results begin. At least until you find a simpler way.

This post has been edited by hiddenghost: 01 May 2012 - 04:52 PM

Was This Post Helpful? 0
  • +
  • -

#3 hiddenghost  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 39
  • View blog
  • Posts: 621
  • Joined: 15-December 09

Re: Sharpening my PHP skills and being more efficient.

Posted 01 May 2012 - 04:50 PM

Quote

I mainly strive towards creating clean, fast, and unique solutions for day to day problems. I try to never take the fast route out of a problem and instead aim towards the best solution.

Keep doing that.

What kind of concepts are foreign to you?
Was This Post Helpful? 0
  • +
  • -

#4 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: Sharpening my PHP skills and being more efficient.

Posted 01 May 2012 - 04:58 PM

Develop and keep perfecting your own style of doing things and stick to it. Each project you do you will find ways to make your methods better and easier. It basically just takes time and experience.
Was This Post Helpful? 0
  • +
  • -

#5 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: Sharpening my PHP skills and being more efficient.

Posted 02 May 2012 - 07:11 PM

Thanks for the advice... I'll continue using PHP and testing out new methods and ideas until I find something solid that I like...

I think I figured out how to get past my complexity problem. Mainly I would have a basic idea of the site in my head and then start programming... And get a better idea while I'm working. Eventually by the end of the project I've switched methods/ideas/styles 3 or 4 times, making for some horrible code. I've never been able to complete very large projects because of this. But now I always write up documentation about the project before I even start. I write down how the file system should look like, what every file and folder does, a walkthrough for the user (and admin), etc.

It works great. I'm much more efficient now that I know what I'm supposed to be doing.
Was This Post Helpful? 0
  • +
  • -

#6 sBorg  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 28
  • Joined: 24-March 12

Re: Sharpening my PHP skills and being more efficient.

Posted 02 May 2012 - 10:58 PM

It is always good to create a workplan for whatever you intend to do. There is a reason why Flow Charts/Pseudo codes exist and are still taught to beginners!

I usually breakdown the complete thing into logical parts, complete each of them and then integrate into the main application/project. It helps you keep a track of your progress and you can focus on one part at a time without worrying about the whole flow.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1