Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. How do you design your code?

How do you design your code?

Scheduled Pinned Locked Moved The Lounge
csharpvisual-studiocomdesigntools
70 Posts 34 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U urbane tiger

    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.

    W Offline
    W Offline
    werD
    wrote on last edited by
    #15

    /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/

    U 1 Reply Last reply
    0
    • W werD

      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

      E Offline
      E Offline
      El Corazon
      wrote on last edited by
      #16

      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)

      W 1 Reply Last reply
      0
      • E El Corazon

        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)

        W Offline
        W Offline
        werD
        wrote on last edited by
        #17

        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

        L E T 3 Replies Last reply
        0
        • E El Corazon

          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)

          W Offline
          W Offline
          werD
          wrote on last edited by
          #18

          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

          E 1 Reply Last reply
          0
          • W werD

            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

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #19

            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.

            W 1 Reply Last reply
            0
            • W werD

              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

              E Offline
              E Offline
              El Corazon
              wrote on last edited by
              #20

              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)

              W 1 Reply Last reply
              0
              • W werD

                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

                E Offline
                E Offline
                El Corazon
                wrote on last edited by
                #21

                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)

                W 1 Reply Last reply
                0
                • M Marc Clifton

                  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

                  Thyme In The Country
                  Interacx
                  My Blog

                  W Offline
                  W Offline
                  werD
                  wrote on last edited by
                  #22

                  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

                  1 Reply Last reply
                  0
                  • J jpg 0

                    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 :)

                    W Offline
                    W Offline
                    werD
                    wrote on last edited by
                    #23

                    .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

                    1 Reply Last reply
                    0
                    • C Chris Losinger

                      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

                      H Offline
                      H Offline
                      Howard Richards
                      wrote on last edited by
                      #24

                      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

                      1 Reply Last reply
                      0
                      • E El Corazon

                        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)

                        W Offline
                        W Offline
                        werD
                        wrote on last edited by
                        #25

                        Thanks again

                        1 Reply Last reply
                        0
                        • L Lost User

                          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.

                          W Offline
                          W Offline
                          werD
                          wrote on last edited by
                          #26

                          Thanks! I'll look into it

                          1 Reply Last reply
                          0
                          • W werD

                            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

                            K Offline
                            K Offline
                            Krenshau75
                            wrote on last edited by
                            #27

                            Not very hight tech, but I use a pen and notebook. I have tried software and such, like StarUML, but I realized that I would have to learn so much just to make it right that I went back to a pen and paper. I will still learn UML, just not "today".

                            Ben

                            W 1 Reply Last reply
                            0
                            • W werD

                              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

                              S Offline
                              S Offline
                              Sitina
                              wrote on last edited by
                              #28

                              I generally try to design it in my mind/sometimes I use paper/pencil, but when it goes to taking these ideas into computer, I prefer freemind[^] Jiri Sitina

                              1 Reply Last reply
                              0
                              • W werD

                                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

                                S Offline
                                S Offline
                                Stuart Dootson
                                wrote on last edited by
                                #29

                                For me, it's all about breaking the problem into chunks that are small enough that I can get a real grasp on them. I'll likely document them with some form of 'box and line' drawing that illustrates the layering of the components or their interactions and some text that gives the scope and responsibilities of each of the components. I've always been of the opinion that you don't want to get too het up about the design - I've worked on safety-critical projects that (quite reasonably, given the constraints on these projects) have very detailed design. You really don't want to do that for your average PC application.

                                W 1 Reply Last reply
                                0
                                • W werD

                                  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

                                  D Offline
                                  D Offline
                                  dazfuller
                                  wrote on last edited by
                                  #30

                                  It depends, at work if I'm starting a large project I'll design it all in UML first. We've just started using Enterprise Architect for that and it can create you're base classes and method stubs for you but I'm kind of picky over code layout and presentation so I code it all by hand anyway. At home and for some smaller projects I'll sketch out a diagram of what I want first, build the business objects, design and write the data access layer if I need one, write the presentation layer, hook it all together and then create the GUI. You know I can remember a time when I'd just write it and re-factor it if needed, when the hell did this start getting so long and complex? One thing I'll avoid at all costs is anything which creates code for me (except for the GUI part), I use to use Dreamweaver and that tainted my opinion of automatically generated code for life. Now I'm going to go and get a coffee, review a weeks worth of Dilbert cartoons and reminisce about the good old days when programming was programming and not object lifetime diagrams :laugh:

                                  1 Reply Last reply
                                  0
                                  • W werD

                                    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

                                    P Offline
                                    P Offline
                                    paulgafa
                                    wrote on last edited by
                                    #31

                                    Coding without a plan??? how can you see your targets... Even Harry Potter had a plan and that made it successful!!!!

                                    R 1 Reply Last reply
                                    0
                                    • P paulgafa

                                      Coding without a plan??? how can you see your targets... Even Harry Potter had a plan and that made it successful!!!!

                                      R Offline
                                      R Offline
                                      Rich Leyshon
                                      wrote on last edited by
                                      #32

                                      Here's my perspective as someone who has returned to programming after a break of 20 years (who stole my Pascal compiler and my 6502 assembler?) - when all these fancy design aids weren't even dreamt of! Here, I'm not referring to anything big, just an addition to a project that will probably not require more than 3,000 lines or so. Working on my own app I get nobody to give me a set of requirements so the first step is always to make the decision as to what is the most useful functionality to include out of the list of ideas that is always at the back of miy mind. I decided there was one feature that was of vital importance to add to the (nearly complete project). I spent most of the weekend just thinking about this from a user's point of view. By definition, the process would have to involve quite a bit of user interaction so what would be the easiest method for a user? Having narrowed this down to two techniques, I then began to think about (roughly) how I could accomplish the task, in outline and two different "technologies" soon became leaders of the pack. I preferred the use of one (because it involved one less step that the user could get wrong) but thought it might be a lot harder to implement than the other. Spent a few hours experimenting with a test (on the harder method) to extract and analyze data from a certain file type to ensure that I could do what I wanted. It worked thus deciding whih technology to use. The result of this test re-inforced further thought about which way to implement the process from the user's point of view. I'm now strting to think about how the UI should behave and this leads to thoughts about data structures, what the user could do "wrong" etc. I then started to design some pages of user information as though I was writing an insruction manual. Get someone else to read it. Is it as clear as you imagined? At this stage, the words can run away with you and suddenly you have a document three times the size you imagined as the brain suddenly thinks of refinements or problems that hadn't occured to me before. With the big decisions taken, I then used Word (yeah sorry) to type out a skeleton design in what, in 1983, was called pigeon Algol. This tended not to get down to the method level but quite close to it. From this position, it was very quick to go to code. Day 1 (Monday) and I have 1250 lines of code, unit tested and working which is far superior to my output when I've started to code with a less clear idea of what I want to achieve. I genu

                                      W 1 Reply Last reply
                                      0
                                      • W werD

                                        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

                                        F Offline
                                        F Offline
                                        Feng Qi
                                        wrote on last edited by
                                        #33

                                        I think mindmanager and freemind are too hard for me. So I use paper and pencil or visio instead;P

                                        1 Reply Last reply
                                        0
                                        • W werD

                                          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

                                          W Offline
                                          W Offline
                                          W Balboos GHB
                                          wrote on last edited by
                                          #34

                                          You just do it. In all sincerity - it's just sort of there. Or, put another way, you kind of know what to do. Some of that comes from experience - but much of experience is learning defensive techniques against the enemy hoards (i.e., end users). Now, that doesn't mean you don't occasionally slash-and-burn something (visual or code), and I don't mean because the specs were changed. You will occasionally have a rethink. The rest is simply problem solving for the occasional new situation (grin). How matter-of-fact it all is! In all seriousness, I counsel you against too many bells & whistles in your design tools. They should be there to do the dirty work when you are manifesting your thoughts. When you stop getting "I just thought of a better way" moments, you may consider seeking employment in a less challanging environment.

                                          "The difference between genius and stupidity is that genius has its limits." - Albert Einstein

                                          W 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups