PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Nov 22, 2017 10:56 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Tue Feb 16, 2016 6:01 am 
Offline
Forum Newbie

Joined: Thu Feb 11, 2016 1:13 am
Posts: 15
Once again let me thank you all.
I am very much a monkey see, monkey do. programmer.
Having taught myself from the get go.

Does anyone have a suitable practice idea or solution that would enable me to wrap my head around this.
What I am saying is, maybe a small project where I can write a form for example and have someone comment it, and I can build on that as I go along.
Or does anyone know of a good tutorial that can help walk me through some of these ideas.

I have a feeling a lot of what I am missing on my coding is what would have been drummed into me if I had attended a college to study and I now need to play catch up lol.


Top
 Profile  
 
PostPosted: Tue Feb 16, 2016 8:12 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6391
Location: Montreal, Canada
Read up on DRY, SOLID, STUPID, and GRASP. Working on something like code katas may help them sink in.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Feb 16, 2016 4:56 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13447
Location: New York, NY, US
terenceb wrote:
Once again let me thank you all.
I am very much a monkey see, monkey do. programmer.
Having taught myself from the get go.

I have a feeling a lot of what I am missing on my coding is what would have been drummed into me if I had attended a college to study and I now need to play catch up lol.

Quite honestly, you could have gone to college and had a lot of bad classes teaching you Java and still not know these ideas. And even if you were taught them, you would not have really understood them until you did what all of us did. We tried to implement something by intuiting a solution, realizing the solution was not very good, doing research and asking question, and learning these counter-intuitive concepts. We all thought "why didn't I think of that" each step along the way as we learned software design. And we all learn new things all the time. Welcome to the club.

Here are a couple of links for Design Patterns. They show best practice solutions for problems using the concepts mentioned above which you should read about too (e.g., DRY, SOLID, STUPID, GRASP, YAGNI, etc.).

Basic Principles and Patterns (there may be better sites than this one): http://www.oodesign.com/

Martin Fowler's catalog of higher level application architectural patterns: http://martinfowler.com/eaaCatalog/
terenceb wrote:
Does anyone have a suitable practice idea or solution that would enable me to wrap my head around this.
What I am saying is, maybe a small project where I can write a form for example and have someone comment it, and I can build on that as I go along.
Or does anyone know of a good tutorial that can help walk me through some of these ideas.

I think refactoring this software would be the great thing to do. We would be glad to help. However, if you want to start from scratch, you could do that too. That might give you some insight into the kinds of questions to ask yourself or others (i.e., "User Stories") before you start. Refactoring and analysis are both essential skills. You can learn about both with either approach to this code. Either way, we'd be glad to walk you though the process.

As a general discussion, web forms are a common and interesting design problem. Frameworks often provide a lot of magic to abstract their implementations. It might be an interesting discussion to start by designing a basic form manager. I'd be interested to hear the ideas of the many of the excellent minds around here. And perhaps others would benefit from reading it too. Once that was done, you could walk through implementing your code above with the knowledge you acquired creating the form manager.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Wed Feb 17, 2016 1:02 am 
Offline
Forum Newbie

Joined: Thu Feb 11, 2016 1:13 am
Posts: 15
I would interested in doing the
Quote:
It might be an interesting discussion to start by designing a basic form manager.


The code above is too abstract to break down and tackle in this concept. I would also like to keep the work I am doing for my present company separate from anything I am doing here.

First off what is
Quote:
a basic form manager
.
A simple MVC implementation or something else?

Q: Is this the right place to do this, or should it be moved to a new thread and started off properly as in.
Give the exercise and let people submit their code and or pieces of code for suggestions

Ideas?


Top
 Profile  
 
PostPosted: Wed Feb 17, 2016 11:49 am 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13447
Location: New York, NY, US
terenceb wrote:
I would interested in doing the
Quote:
It might be an interesting discussion to start by designing a basic form manager.


The code above is too abstract to break down and tackle in this concept. I would also like to keep the work I am doing for my present company separate from anything I am doing here.

That makes sense. Anything you did here could cover the same concepts but would not need to be actual client code.
terenceb wrote:
First off what is
Quote:
a basic form manager
.
A simple MVC implementation or something else?

That would be the first question to ask. What is the basic workflow of a HTML/HTTP form? What are the various states? What are the various concerns? Are there best practices related to web forms? What architecture you are fitting this form manager into?
terenceb wrote:
Q: Is this the right place to do this, or should it be moved to a new thread and started off properly as in.
Give the exercise and let people submit their code and or pieces of code for suggestions

Ideas?
It should be started in a new thread. I think it should proceed as an Agile type design discussion where we state the goals (usually from User Stories), set priorities, and spiral through the development process -- shipping a working form every cycle. If you are interested, start a new thread and try to state the User Story for the form above. As we discussed, it can be generalized/abstracted a little. But since they asked for a form with some peculiar features, it might be interesting to keep them in mind and see if they affect the design of the more basic case we would need to build first before adding those features. I suspect that some of what is in the code above will be moved out into code that is pre/post the concerns of this forms code.

_________________
(#10850)


Top
 Profile  
 
PostPosted: Thu Feb 18, 2016 1:11 am 
Offline
Forum Newbie

Joined: Thu Feb 11, 2016 1:13 am
Posts: 15
Hi Christopher.
I created a new thread called Agile Design - Do's and Dont's http://forums.devnetwork.net/viewtopic.php?f=19&t=142322

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group