Definitely a newcomer to C# (in fact to any programming after some years
away) and I'm finding lots of examples but they are sometimes confusing.
My concept of (say) QuickBasic was that you write a main program that calls
subroutines, thus breaking the thing up into manageable parts.
I started off assuming that in C# main() would be the program flow with
(say) several forms called in a similar way, each form doing it's part then
returning to the main() flow. Let me give an example.
Initialize stuff
Get a filename (call file input dialogue and validate)
Create Playlist (call creator or add to existing and validate)
Get more or play
(go back for filename or play)
Play (call media player)
Media ended
(go back or stop)
I hope this makes clear what I am asking. I visualized a form called from
main() for input and another for playing with the create playlist either in
the main flow or as a separate method. Playing would be a form of course and
I guess the decision to play more or stop could be in there as well.
Examples I've seen seem to put the majority of the code in the "Player"
form, even calling the "Get a filename" form from it, which leaves main()
doing virtually nothing except kicking off the player form.
The simple question is whether there's a right way and a wrong way to do
this or is it "Who cares as long as it works"? :)
also which is preferred.
Declare a public string fileName and then just have the form that gets
filename set it or is it better to do something like
string fileName getfilename ()
and have the getfilename method return it?
Sorry if these seem like stupid questions but there seem to be some
differences between what the book says and what people usually do if you see
what I mean, I take that to mean I am missing some reasoning here :)
Thanks for any suggestions, I have looked around but not found definitive
answers yet.
Charlie