VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 04:10:26 09/16/04 Thu
Author: Ryan
Subject: TDD Purpose
In reply to: Leigh Miranda 's message, "TDD program format TMA F" on 11:22:05 07/17/04 Sat

I'll do my best to explain the real depth of a TDD. Your example was 'get a card' and 'turn it face up'. This is undertood easily on the TDD. But if you were to replace this with VB code your TDD wouldnt make sense. Just like if your put

get a card and turn it face up

in your program that wouldnt make any sense to the computer. The TDD helps the programmer understand his/her steps and requirements in a program. A TDD doesnt dictate how your create your program or what your programming consists of. A TDD breaks your application and programming down into parts. Each part has a little piece of programming. So take it one step at a time. Deal with the first step and write the programming for it. You will be amazed at how it all starts to come together.

Now I understand your thoughts when you say because the computer wont understand what these commands are!!?? or am i to presume that the computer already has this information? i.e knows what a card is and how to use it. You need to strip VB down a little and see it as it really is. The computer doesnt know what a card is. Infact, a computer will never know what a card is. But you can tell it what to do with the shape on the screen that you and I would see as a card. When your telling it what do you do it by reference to the shape. You name your shape control something simple that you and other programmers will understand such as shpCard. So now you can have a form, with a shape control called shpCard. What do you want to do to that card. Well, anything you do to it has to be in reference to its name. Such as make it disappear...
shpCard.Visible = False
But you wanted to turn it over. You and me would physically pick up the card and turn it around then place it back down. The computer doesnt think like this. So you do more breaking down. The computer gets card. So you have some code that randomly shifts through a list of 52 cards and then picks one. You use a Randomiser in your code and you must tell the computer the name of each and every card and create a reference to it. 1-52 would do fine. So imigine your programs finds its card of choice at random. You want to see it. So, with every card has a picture linked to it. You have a code that loads the picture into your shape control called shpCard and then you see your card.

Well I hope that helps. I wrote so much because I know you still have that initial thinking that is hard to shake of when your beginning visual basic and others might need it.

[ Next Thread | Previous Thread | Next Message | Previous Message ]

Post a message:
This forum requires an account to post.
[ Create Account ]
[ Login ]
[ Contact Forum Admin ]


Forum timezone: GMT+0
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.