PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Does anyone flowchart their code?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Does anyone flowchart their code?

Réponse
 
LinkBack Outils de la discussion
Vieux 15/06/2008, 17h58   #1
William Gill
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Does anyone flowchart their code?

I seem to be having a mentally bad period lately . My code is beginning
to be terrible convoluted mess, and I shudder to think what it will be
like to go back in a couple months and try to follow it, so I'm going
back to basics. I need to flowchart what I'm doing. The problem is I
can't seem to find anything that works well,and doesn't cost an arm and
leg. I have an old copy of Smart Draw, but it's out dated and does not
work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
intended to be implemented via word processors, but I haven't done one
in 30 years.

So, does anyone flowchart anymore? If so what do you use/suggest?
  Réponse avec citation
Vieux 15/06/2008, 18h23   #2
Dikkie Dik
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

William Gill wrote:
> I seem to be having a mentally bad period lately . My code is beginning
> to be terrible convoluted mess, and I shudder to think what it will be
> like to go back in a couple months and try to follow it, so I'm going
> back to basics. I need to flowchart what I'm doing. The problem is I
> can't seem to find anything that works well,and doesn't cost an arm and
> leg. I have an old copy of Smart Draw, but it's out dated and does not
> work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
> intended to be implemented via word processors, but I haven't done one
> in 30 years.
>
> So, does anyone flowchart anymore? If so what do you use/suggest?


No. flowcharts and Nassi diagrams were meant for procedural programming.
They come from the time that a program was a "recipe", starting at line
1 and going all the way to line 3456821. I never understood Nassi
diagrams: they are extremely hard to read and even harder to draw. I can
make a program in 1% of the time it would cost me to make the
corresponding Nassi diagram. And afterwards, only the program can be
corrected...

I draw UML diagrams for the parts that need them and put them in my unit
tests (along with other documentation). So every time you run the tests,
you see that the code is documented. The rest of my documentation
accompanies the code or is in the code itself. My code should be
self-explanatory, and if not, the documentation is in the appropriate
section of the module in subversion.
  Réponse avec citation
Vieux 15/06/2008, 18h35   #3
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

On Sun, 15 Jun 2008 12:58:33 -0400, William Gill wrote:

> I seem to be having a mentally bad period lately . My code is
> beginning to be terrible convoluted mess, and I shudder to think
> what it will be like to go back in a couple months and try to follow
> it, so I'm going back to basics. I need to flowchart what I'm doing.
> The problem is I can't seem to find anything that works well,and
> doesn't cost an arm and leg. I have an old copy of Smart Draw, but
> it's out dated and does not work right on WinXP. I seem to remember
> Nassi-Shneiderman Diagrams were intended to be implemented via word
> processors, but I haven't done one in 30 years.
>
> So, does anyone flowchart anymore? If so what do you use/suggest?


I do. I have a nice plastic template that says it was made in 1975,
and a box of cheap mechanical pencils. Two or three redraws and I've
usually got things well enough organized to move on to writing code.
Flowcharting software just mades it too easy to amend the chart to match
the code, and then end up with spagetti programs and spagetti charts to
match.

--
_ o
|/)
  Réponse avec citation
Vieux 15/06/2008, 19h50   #4
William Gill
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

Peter H. Coffin wrote:

>
> I do. I have a nice plastic template that says it was made in 1975,
> and a box of cheap mechanical pencils. Two or three redraws and I've
> usually got things well enough organized to move on to writing code.
> Flowcharting software just mades it too easy to amend the chart to match
> the code, and then end up with spagetti programs and spagetti charts to
> match.
>

How old school!

I've got a couple of those around somewhere, if I can just remember
where I used them last.

Ah! Here they are. What's this about punched tape and punched cards?
Talk about old school.



  Réponse avec citation
Vieux 15/06/2008, 21h22   #5
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

William Gill wrote:
> I seem to be having a mentally bad period lately . My code is beginning
> to be terrible convoluted mess, and I shudder to think what it will be
> like to go back in a couple months and try to follow it, so I'm going
> back to basics. I need to flowchart what I'm doing. The problem is I
> can't seem to find anything that works well,and doesn't cost an arm and
> leg. I have an old copy of Smart Draw, but it's out dated and does not
> work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
> intended to be implemented via word processors, but I haven't done one
> in 30 years.
>
> So, does anyone flowchart anymore? If so what do you use/suggest?


I'm with Dikkie. I design and document the design before writing code.
But I do it using OO methodologies.

I may not have a complete detailed spec for every single class - i.e.
database-related classes may have some shortcuts. But I still document
first, code later.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  Réponse avec citation
Vieux 15/06/2008, 21h31   #6
Manuel Lemos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

on 06/15/2008 01:58 PM William Gill said the following:
> I seem to be having a mentally bad period lately . My code is beginning
> to be terrible convoluted mess, and I shudder to think what it will be
> like to go back in a couple months and try to follow it, so I'm going
> back to basics. I need to flowchart what I'm doing. The problem is I
> can't seem to find anything that works well,and doesn't cost an arm and
> leg. I have an old copy of Smart Draw, but it's out dated and does not
> work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
> intended to be implemented via word processors, but I haven't done one
> in 30 years.
>
> So, does anyone flowchart anymore? If so what do you use/suggest?


I think the problem is that you are focusing in code rather than in the
project.


--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
  Réponse avec citation
Vieux 15/06/2008, 21h35   #7
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

Manuel Lemos wrote:
> on 06/15/2008 01:58 PM William Gill said the following:
>> I seem to be having a mentally bad period lately . My code is beginning
>> to be terrible convoluted mess, and I shudder to think what it will be
>> like to go back in a couple months and try to follow it, so I'm going
>> back to basics. I need to flowchart what I'm doing. The problem is I
>> can't seem to find anything that works well,and doesn't cost an arm and
>> leg. I have an old copy of Smart Draw, but it's out dated and does not
>> work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
>> intended to be implemented via word processors, but I haven't done one
>> in 30 years.
>>
>> So, does anyone flowchart anymore? If so what do you use/suggest?

>
> I think the problem is that you are focusing in code rather than in the
> project.
>
>


The design is the way you ensure the code matches the requirements of
the project.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 15/06/2008, 21h51   #8
Manuel Lemos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Does anyone flowchart their code?

Hello,

on 06/15/2008 01:58 PM William Gill said the following:
> I seem to be having a mentally bad period lately . My code is beginning
> to be terrible convoluted mess, and I shudder to think what it will be
> like to go back in a couple months and try to follow it, so I'm going
> back to basics. I need to flowchart what I'm doing. The problem is I
> can't seem to find anything that works well,and doesn't cost an arm and
> leg. I have an old copy of Smart Draw, but it's out dated and does not
> work right on WinXP. I seem to remember Nassi-Shneiderman Diagrams were
> intended to be implemented via word processors, but I haven't done one
> in 30 years.
>
> So, does anyone flowchart anymore? If so what do you use/suggest?


I think the problem is that you are focusing in code rather than in the
project.

Flow charts may be OK for trivial projects, but for larger projects you
need to specify and plan the implementation before you start or else you
will stumble into many needs that were not anticipated, and may make you
take a different approach.

Traditional good practices are proposed by RUP (Rational Unified
Project) on which you can plan your project in implementation in terms
of use cases.

Before you ever get to the code, it is useful to draw some use case
diagrams or sequence diagrams. Then you can narrow the details by
documenting the use case steps, exceptional situations that you need to
handle, pre-conditions, post-conditions, etc.

Then you finally can start modeling you application data objects and
write code to implement the use cases.

Personally I use a methodology named Use Case Mapping to depart from use
case documentation to a PHP project implementation. You may want to read
this article about the subject. If you are not familiar with concepts
such as UML, Use Cases, RUP, etc., this document gives you a good
overview on the subject as well describes a practical implementation.

http://www.meta-language.net/metastorage-example.html

As for modeling tools, I recommend any good UML tool. UML defines a set
of visual artifacts to describe your application diagrams, such as use
case diagrams, sequence diagrams, class diagrams, entity-relationship
diagrams, etc..

Under Linux I use Umbrello. Umbrello can also run on Windows and Mac
using a KDE installation for those systems.

http://uml.sourceforge.net/index.php

I think there are other free UML tools for Windows and Mac based in Java
like Poseidon.

http://www.gentleware.com/products.html

--

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h47.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18929 seconds with 16 queries