How do you design your code?
-
I’ve been trying out different methods for planning out projects and code. I've tried some things like mindmanager http://www.mindjet.com/us/[^] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there. So, I was wondering what everyone else uses for this sort of thing? Is there a built in productivity tool for doing your code architecture that I'm missing or a nice third party app that gives me a nice visual representation for colleagues but doesn't slow down my code writing process 'Thanks 'DrewG
werD420 wrote:
I've tried some things like mindmanager http://www.mindjet.com/us/\[^\] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there.
I use freemind for logical design. That being the breakdown of physical tasks from larger to smaller, which is what a mind-mapper is designed to do. When I reach a comfortable level, the nodes are designed as UML physical design. UML creates the headers and function blanks that are filled in, if any changes are made to the physical design of a class it is re-imported back to UML. Also, the UML diagrams are based on the main types of Design Patterns, plus the expanded set for parallel processes. Given that much of my code is parallel, not all the designs exactly match the well known gang-of-four, but there are extended sets which I and others have added to for new parallel patterns and converted patterns (for instance parallel builder, rather than sequential builder designs).
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I’ve been trying out different methods for planning out projects and code. I've tried some things like mindmanager http://www.mindjet.com/us/[^] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there. So, I was wondering what everyone else uses for this sort of thing? Is there a built in productivity tool for doing your code architecture that I'm missing or a nice third party app that gives me a nice visual representation for colleagues but doesn't slow down my code writing process 'Thanks 'DrewG
Good grief. A question that is both simple and complicated at the same time. I start designing my code by thinking about the user and the problem. I come up with an idea of the data that needs to be managed and I figure out what needs to be persisted. From that I start with a schema using an schema editor I wrote to get some basic tables. I start mocking up some UI's either on paper or in a designer to see what sort of views I need to visualize the data. Once I have the views I can wire them up to the UI's and do some testing of the user workflow/storyboard. I figure out an initial plan for the different components and their relationships to each other, which I diagram out in Visio. If the interactions are complicated enough, I use UML sequence diagrams. If I'm writing an API or a framework, I'll do some class modeling, but mostly for high-level application components, I write execution workflows using pre-canned methods. I figure out what application specific stuff needs to go into plug-ins that the execution workflow can interface with. If the application needs to manage runtime state, I'll usually do a state diagram in Visio then enter the state information in this XML state designer I use. Sometimes determining state transitions is complicated so I use this XML decision tree designer to create the if-then-else decision tree. That same component is used not just for state but for other things like validation and certain types of business logic. On occasion, I'll use UML actor diagrams to create a high level view of the actors and the interaction between the actors. Umm, I think that's about it. I'm too sleepy to think of anything more. Marc
-
Good grief. A question that is both simple and complicated at the same time. I start designing my code by thinking about the user and the problem. I come up with an idea of the data that needs to be managed and I figure out what needs to be persisted. From that I start with a schema using an schema editor I wrote to get some basic tables. I start mocking up some UI's either on paper or in a designer to see what sort of views I need to visualize the data. Once I have the views I can wire them up to the UI's and do some testing of the user workflow/storyboard. I figure out an initial plan for the different components and their relationships to each other, which I diagram out in Visio. If the interactions are complicated enough, I use UML sequence diagrams. If I'm writing an API or a framework, I'll do some class modeling, but mostly for high-level application components, I write execution workflows using pre-canned methods. I figure out what application specific stuff needs to go into plug-ins that the execution workflow can interface with. If the application needs to manage runtime state, I'll usually do a state diagram in Visio then enter the state information in this XML state designer I use. Sometimes determining state transitions is complicated so I use this XML decision tree designer to create the if-then-else decision tree. That same component is used not just for state but for other things like validation and certain types of business logic. On occasion, I'll use UML actor diagrams to create a high level view of the actors and the interaction between the actors. Umm, I think that's about it. I'm too sleepy to think of anything more. Marc
Marc Clifton wrote:
I'm too sleepy to think of anything more.
Go to bed see u tomorrow.
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
-
I’ve been trying out different methods for planning out projects and code. I've tried some things like mindmanager http://www.mindjet.com/us/[^] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there. So, I was wondering what everyone else uses for this sort of thing? Is there a built in productivity tool for doing your code architecture that I'm missing or a nice third party app that gives me a nice visual representation for colleagues but doesn't slow down my code writing process 'Thanks 'DrewG
I personally follow some steps that I defined for myself. 1.) I start out by writing a list of requirements in xml, prioritized. No schema, just simple xml. 2.) Following the list, make sure I know how to implement every single one of them. If I don't, I create a so-call spike solution to figure out how something is done in code. This step is important, otherwise, your estimation will most likely inaccurate. 3.) At this point, I create some uml diagrams to visualize the how things should look like. Don't try to specifies all type members in Uml diagrams, you really don't want to spend time maintaining it just to keep it in-sync with your code. 4.) Create a schedule at this point and use excel or xml to sort out the tasks. 5.) Code & Test :)
-
pjd1001 wrote:
a borne natural programmer would never ask just a question.
assuming you meant "such a question" im gonna have to disagree with that. i would think that a natural programmer would be able to more gracefully perform certain tasks.. but usage scenarios and intense risk analysis are often the last thing a development team member worries about(or should be worrying about) in an enterprise environment. This is generally left to the software architect who then hands down to the development team and so on. Dont get me wrong im not gonna spend three weeks planning out a personal project just to pass it on to me(the development team) but Im not alway just working with myself and unfortunately not everyone is always on the same page so I seek automation and communication. as for the Weeds reference
pjd1001 wrote:
they all went to writers school, and they all learned to write in the same way - like houses made of ticky tacky
whoever said that thinking things out eliminated creativity?
I wonder how many contemporary novel's you've read lately - operative word is contemporary, which I'll define as written in this century. If a programmer's doing weapons guidance software, the first thing he/she thinks about is risk analysis, if a cruise missile backfires you don't want to be on that ship. Same deal for imbedded medical systems (heart monitors, pacemakers etc), its got to run for several years non stop. The guys who built Voyager probably never heard of a software architect. Rgds Phild - BTW a former software architect for a major financial institution.
-
werD420 wrote:
I've tried some things like mindmanager http://www.mindjet.com/us/\[^\] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there.
I use freemind for logical design. That being the breakdown of physical tasks from larger to smaller, which is what a mind-mapper is designed to do. When I reach a comfortable level, the nodes are designed as UML physical design. UML creates the headers and function blanks that are filled in, if any changes are made to the physical design of a class it is re-imported back to UML. Also, the UML diagrams are based on the main types of Design Patterns, plus the expanded set for parallel processes. Given that much of my code is parallel, not all the designs exactly match the well known gang-of-four, but there are extended sets which I and others have added to for new parallel patterns and converted patterns (for instance parallel builder, rather than sequential builder designs).
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Good Grief - programming used to be fun, I'm glad I no longer have to do it for a living. I can't help but wonder if all this stuff is why we can't put men on the moon anymore, or win wars, or write decent novels. I gunna write some code, communicating is for the birds c'ya all
-
Good Grief - programming used to be fun, I'm glad I no longer have to do it for a living. I can't help but wonder if all this stuff is why we can't put men on the moon anymore, or win wars, or write decent novels. I gunna write some code, communicating is for the birds c'ya all
pjd1001 wrote:
programming used to be fun, I'm glad I no longer have to do it for a living.
programming still is. I can freemind the logical design for a 1 year project in one day. UML diagrams take a little longer, but since they generate the code outline of the same diagram, you have lost no time, you return the design time back into your source. When you get used to the tools, sometimes you can actually save time up front. But ignoring any upfront savings, the net result is time-savings over the life of a project. Upfront design done properly helps prevent you from rewriting your code a dozen times during the lifetime of the project, or telling your customer to f*** off and give him something he doesn't want. so design is a win-win if you actually do it and do it right. Not thinking about a project is more grief; and planning for it, designing your code, means you can have more enjoyable time. Unless you enjoy giving inferior projects and making customers unhappy. In which case, well, that is why others get the contracts. :) Coding without thinking for parallel is the reason many programmers think parallel programming is so difficult. It is actually pretty simply, BUT you can't do it without thinking about the issues and planning for them.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I wonder how many contemporary novel's you've read lately - operative word is contemporary, which I'll define as written in this century. If a programmer's doing weapons guidance software, the first thing he/she thinks about is risk analysis, if a cruise missile backfires you don't want to be on that ship. Same deal for imbedded medical systems (heart monitors, pacemakers etc), its got to run for several years non stop. The guys who built Voyager probably never heard of a software architect. Rgds Phild - BTW a former software architect for a major financial institution.
pjd1001 wrote:
The guys who built Voyager probably never heard of a software architect.
actually, quite wrong, VERY wrong in fact. Voyager was outlined in proposals before a single piece of hardware existed, about 10 years before any hardware existed. Designs were modified when funding was awarded, and before hardware was purchased. Designs were then locked down during hardware build and software build. This is because many contractors working on one project MUST have a design to make sure everyone does the job right. NASA is probably the heaviest on redundancy and design. Really the wrong choice. The same goes for weapons guidance, massive design up front, from detailed proposals listing capability down to the last feature, to final design submitted to the government/military for approval before code is built. There was also a document standard prior to CMMI that was for military contracts that required much of the CMMI design before build, verify design post build, etc. If anything the original Army documentation standard made CMMI Level 5 look like childs' scratching in the mud by comparison. Flowcharts one box per code line before code is built, with no return, since flow charts were done originally by hand and then typed as code later. You really need to work on your examples if you actually want to prove your points. And actually... as far as risk analysis, prior to thinking about the ship and a backfire, the FIRST risk accounted for is how to prevent the technology from falling into enemy hands. Safety is there too, but it comes a close second to security.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
I wonder how many contemporary novel's you've read lately - operative word is contemporary, which I'll define as written in this century. If a programmer's doing weapons guidance software, the first thing he/she thinks about is risk analysis, if a cruise missile backfires you don't want to be on that ship. Same deal for imbedded medical systems (heart monitors, pacemakers etc), its got to run for several years non stop. The guys who built Voyager probably never heard of a software architect. Rgds Phild - BTW a former software architect for a major financial institution.
/off topic
pjd1001 wrote:
I wonder how many contemporary novel's you've read lately - operative word is contemporary, which I'll define as written in this century.
umm, not that this is relevant at all to the OP, but since you wonder;P.. i was published in a magazine(a cheap one circulated to participating schools across the country) for being in the top 40(in the participating schools nationwide) for accelerated reader points(ie. passing reading comprehension test for large novels and the likes) in the sixth grade... in the last week not so many... and not to be picky but novels is the plural of novel not novel's /end off topic I think that we are talking about, or at least have a different interpretation of, what a programmer is in contrast to a lead developer or architect. In my eyes, a programmer (or development team member) writes code that complies with business rules and business needs. The programmer does not go out to the business and ask what it needs, instead the business talks to an architect(or a developer well versed in platform advantages and design patterns). Then either through meetings with staff or by him or herself(if they wanna be cool like that and take all the credit for when things break:)), the architect/lead developer comes up with a design and brings this to his staff of programmers who write up the code and perform unit tests and things like this. That way people skilled at writing code do just that, write code, and people skilled at requirements/risk based application design, design applications. I would assume that people writing code for nasa projects such as voyager or other embedded systems have great skill at design patterns and application modeling(architecture) as well as a great need to have a well thought out design process that everyone is aware of. That way you dont have redundant functionality brought on by multiple programmers just "writing code" to get the task at hand done. A heart monitor especially would have this need, as it would have to be very very light on battery pull so software size would need to be minimal yet complete/
-
I’ve been trying out different methods for planning out projects and code. I've tried some things like mindmanager http://www.mindjet.com/us/[^] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there. So, I was wondering what everyone else uses for this sort of thing? Is there a built in productivity tool for doing your code architecture that I'm missing or a nice third party app that gives me a nice visual representation for colleagues but doesn't slow down my code writing process 'Thanks 'DrewG
werD420 wrote:
How do you design your code?
"In pastel colours, with artful accents." who has been peeking at my freemind clouds? Those designs are off-limits you know....
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
werD420 wrote:
I've tried some things like mindmanager http://www.mindjet.com/us/\[^\] and freemind but still usually end up just typing a rough draft/outline in visual studio and fill in the blanks from there.
I use freemind for logical design. That being the breakdown of physical tasks from larger to smaller, which is what a mind-mapper is designed to do. When I reach a comfortable level, the nodes are designed as UML physical design. UML creates the headers and function blanks that are filled in, if any changes are made to the physical design of a class it is re-imported back to UML. Also, the UML diagrams are based on the main types of Design Patterns, plus the expanded set for parallel processes. Given that much of my code is parallel, not all the designs exactly match the well known gang-of-four, but there are extended sets which I and others have added to for new parallel patterns and converted patterns (for instance parallel builder, rather than sequential builder designs).
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
Very Interesting post. I haven't dealt much with UML, but its a very exciting concept. I've just read the introduction to UML on the OMG site and im about to crack into the spec now. Are there any UML tools that you've found exceptional for certain tasks like generating UML from existing code or vice-versa? or any other resources/communities you've found helpful? Thanks a lot
-
werD420 wrote:
How do you design your code?
"In pastel colours, with artful accents." who has been peeking at my freemind clouds? Those designs are off-limits you know....
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
El Corazon wrote:
"In pastel colours, with artful accents." who has been peeking at my freemind clouds? Those designs are off-limits you know....
Woohoo! I couldn't help but think of the other night when I thought about my mindmap "I need some background colors to add some distinction to this" :-O
-
Very Interesting post. I haven't dealt much with UML, but its a very exciting concept. I've just read the introduction to UML on the OMG site and im about to crack into the spec now. Are there any UML tools that you've found exceptional for certain tasks like generating UML from existing code or vice-versa? or any other resources/communities you've found helpful? Thanks a lot
-
Very Interesting post. I haven't dealt much with UML, but its a very exciting concept. I've just read the introduction to UML on the OMG site and im about to crack into the spec now. Are there any UML tools that you've found exceptional for certain tasks like generating UML from existing code or vice-versa? or any other resources/communities you've found helpful? Thanks a lot
werD420 wrote:
Are there any UML tools that you've found exceptional for certain tasks like generating UML from existing code or vice-versa? or any other resources/communities you've found helpful?
StarUML has a few bugs and qwerks, but will get the job done. Enterprise Architect is far more advanced, but costs a pretty penny. Metamill I have used successfully also. If you are willing to put in the effort to learn the tools, those and many others will help you. I do suggest getting one that will generate a skeleton, or better yet modify existing methods (adding a parameter, or a method, or a property, etc.). This can save you some of the redundant code outlining after design is done. the design generates the skeleton and you put in the rest. It just helps return some of your design time.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
El Corazon wrote:
"In pastel colours, with artful accents." who has been peeking at my freemind clouds? Those designs are off-limits you know....
Woohoo! I couldn't help but think of the other night when I thought about my mindmap "I need some background colors to add some distinction to this" :-O
werD420 wrote:
Woohoo! I couldn't help but think of the other night when I thought about my mindmap "I need some background colors to add some distinction to this"
check out the clouds... a nice cyan cloud for configuration, a nice magenta cloud for drawing (drawing is a "warm color" operation). A distinct green is good for realtime I/O (very important, needs to stand out, plus green means "go!"). And remember, parallel operations are always a cool color. :)
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
Good grief. A question that is both simple and complicated at the same time. I start designing my code by thinking about the user and the problem. I come up with an idea of the data that needs to be managed and I figure out what needs to be persisted. From that I start with a schema using an schema editor I wrote to get some basic tables. I start mocking up some UI's either on paper or in a designer to see what sort of views I need to visualize the data. Once I have the views I can wire them up to the UI's and do some testing of the user workflow/storyboard. I figure out an initial plan for the different components and their relationships to each other, which I diagram out in Visio. If the interactions are complicated enough, I use UML sequence diagrams. If I'm writing an API or a framework, I'll do some class modeling, but mostly for high-level application components, I write execution workflows using pre-canned methods. I figure out what application specific stuff needs to go into plug-ins that the execution workflow can interface with. If the application needs to manage runtime state, I'll usually do a state diagram in Visio then enter the state information in this XML state designer I use. Sometimes determining state transitions is complicated so I use this XML decision tree designer to create the if-then-else decision tree. That same component is used not just for state but for other things like validation and certain types of business logic. On occasion, I'll use UML actor diagrams to create a high level view of the actors and the interaction between the actors. Umm, I think that's about it. I'm too sleepy to think of anything more. Marc
Marc Clifton wrote:
Good grief. A question that is both simple and complicated at the same time.
I try my damndest to confuse myself like a pro :laugh: Great post, I appreciate the insight into your process. I think that creating execution workflows and/or story boards for different scenarios is a must for future scalability. Maybe I should be diving into the new visio as well to see what 2007 brings. Thanks
-
I personally follow some steps that I defined for myself. 1.) I start out by writing a list of requirements in xml, prioritized. No schema, just simple xml. 2.) Following the list, make sure I know how to implement every single one of them. If I don't, I create a so-call spike solution to figure out how something is done in code. This step is important, otherwise, your estimation will most likely inaccurate. 3.) At this point, I create some uml diagrams to visualize the how things should look like. Don't try to specifies all type members in Uml diagrams, you really don't want to spend time maintaining it just to keep it in-sync with your code. 4.) Create a schedule at this point and use excel or xml to sort out the tasks. 5.) Code & Test :)
.jpg wrote:
2.) Following the list, make sure I know how to implement every single one of them. If I don't, I create a so-call spike solution to figure out how something is done in code. This step is important, otherwise, your estimation will most likely inaccurate.
Like Gi-Joe says "Knowing Is Half The Battle!" I tend to keep a dev solution open for random forms and functionality tests at all times throughout the day. that way I don't clutter my solutions but I can still test or demonstrate as needed. I believe even the Microsoft Solutions Framework has a learning phase where team skills are measured against application needs and skill/training is aquired/handed out appropriately. Thanks For The Insight, It Is Greatly Appreciated
-
i think about it, then i start typing. things rarely end up looking like my initial estimation, but they end up doing what they need to do.
image processing toolkits | batch image processing | blogging
Similar approach here. Think a bit and try to get a basic concept of how it would work in my head. Once I have that i tend to create classes in the top down approach.. highest level to hide the details, then dummy classes/methods etc. to build as I go along
'Howard
-
werD420 wrote:
Are there any UML tools that you've found exceptional for certain tasks like generating UML from existing code or vice-versa? or any other resources/communities you've found helpful?
StarUML has a few bugs and qwerks, but will get the job done. Enterprise Architect is far more advanced, but costs a pretty penny. Metamill I have used successfully also. If you are willing to put in the effort to learn the tools, those and many others will help you. I do suggest getting one that will generate a skeleton, or better yet modify existing methods (adding a parameter, or a method, or a property, etc.). This can save you some of the redundant code outlining after design is done. the design generates the skeleton and you put in the rest. It just helps return some of your design time.
_________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
-
werD420 wrote:
Are there any UML tools that you've found exceptional for certain tasks like generating UML from existing code or vice-versa?
I've found Enterprise Architect[^] to be really handy. Cheers, Drew.