C# - Basic template - Program organization

Electronics Computer Programming Q&A
Post Reply
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

C# - Basic template - Program organization

Post by atferrari »

I imagine a zoo with lots of animals. To deal with their info I organized them somehow.

They all:

* Sleep xx hrs / day.
* Eat food xx Kg / week.

Some of them:

* bellow, cheep, howl or whatever.
* are he and some are she.
* are covered by feathers, leather, bristles or ...
* have names like "Jack", "Tweety", "Pirate" or no name at all.
* walk, run, fly or ...


I would like to be able to do, as an example:

* Compare some felines with some birds to see how much more food each one eats per month.
* For a specific type, let's say siamese cats, to know they gender and names if any.
* What type of cow sleeps more hours / month.
* That is, I need, in some cases to pass / retrieve numeric data, so some of the classes are not all static.

My comments:

* I am not asking for code, of course. It is that I find difficult to organize in my mind kind of a template more or less complete and somehow more complex than most of the examples allow to expect (given online by Microsoft, I mean).
* I realized that once I grasp how to organize namespaces and classes, I could walk faster by myself.
* I am learning just by reading online. Tutorials put their accent in this or that but it seems that what I am asking here is almost taken for granted.
* I have no previous experience with C, C++. Just that old BASIC from 25 years ago and assembler for PIC micros which I write fluently.

My questions:

* a) Is this organization reasonable (classes inside classes inside classes), or there is a better way to work with this?
* b) Could be that I would need another namespace instead of this one only?
* c) Where should I locate Main? Inside the class XXXX_catalogue or...?
* d) Am I too off subject, maybe?


*/

Code: Select all

namespace The_zoo_next_door
{
    class MaybeIncongruent_animals_catalogue
    {
        class bovine
        {
            class Angus
            { }
            class Hereford
            { }
            class Holando
            { }
        }
        class feline
        {
            class domestic
            {
                class siamese
                { }
                class maltese
                { }
            }
            class wild
            {
                class tiger
                { }
                class bobcat
                { }
                class cheetah
                { }
            }
        }
        class birds
        {
            class domestic
            {
                class chicken
                { }
                class goose
                { }
                class canary
                { }
            }
            class wild
            {
                class robin
                { }
                class condor
                { }
                class falcon
                { }
            }
        }
        // Is this the right place?
        static void Main(string[] args)
        { }
    }
}

stevech
Posts: 138
Joined: Mon Jun 05, 2006 10:27 pm
Contact:

Post by stevech »

no-no. Cross-post duplicate.
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

Sorry?

Post by atferrari »

I cannot follow you. :shock: Sorry
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

Post by kheston »

You can get away with almost anything, but it is more conventional to place class definitions in separate files.
Kurt - SF Bay
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Post by Bigglez »

stevech wrote:no-no. Cross-post duplicate.
You have posted this identical question in more than one place....
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Post by Bigglez »

Bigglez wrote:
stevech wrote:no-no. Cross-post duplicate.
atferrari wrote:I cannot follow you. Sorry
You have posted this identical question in more than one place....
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

Posting the same question in several forums

Post by atferrari »

As a member of several forums I have the right to post in each one of them whatever I deem convenient as long I do not go against their regulations.

I did in the past in much more forums that you could imagine an I will do it again if I find it convenient.

As a joke I cannot understand it. If you are being serious about this, Bigglez, you are not entitled to interfere with my activity.
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

Post by kheston »

atferrari,

I completely agree that you aren't technically in violation of your user agreements with either CC or N&V when you cross-post the same message between sites. As a matter of etiquette, however, it is generally uncouth to post identical messages in multiple forums.

I think you probably didn't know so many N&V forum members were also CC forum members and were just trying to increase your question's exposure. This is understandable and would probably have been quickly forgiven had your retort not effectively been, "I can do whatever I want so long as it doesn't break a written rule." A quick mea-culpa here would have gone a long way.

Remember that when you post in forums like this one you are humbly asking for guidance from people that have no obligation whatsoever to help you. Courtesy is one of the few ways people in forums are compensated when they take out valuable time to help others.

Hope this helps.
Kurt - SF Bay
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: Posting the same question in several forums

Post by Bigglez »

atferrari wrote:As a joke I cannot understand it.
It is not a joke.
atferrari wrote:If you are being serious about this, Bigglez, you are not entitled to interfere with my activity.
You are shooting the messenger, I took the time to
answer your question, nothing more.

Another member here brought the issue up with you.

You might want to reconsider your position, or at
least read Kurt's detailed comments for your own
enlightenment.
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

How I see it

Post by atferrari »

kheston wrote:atferrari,

I completely agree that you aren't technically in violation of your user agreements with either CC or N&V when you cross-post the same message between sites. As a matter of etiquette, however, it is generally uncouth to post identical messages in multiple forums.

I think you probably didn't know so many N&V forum members were also CC forum members and were just trying to increase your question's exposure. This is understandable and would probably have been quickly forgiven had your retort not effectively been, "I can do whatever I want so long as it doesn't break a written rule." A quick mea-culpa here would have gone a long way.

Remember that when you post in forums like this one you are humbly asking for guidance from people that have no obligation whatsoever to help you. Courtesy is one of the few ways people in forums are compensated when they take out valuable time to help others.

Hope this helps.
Hola Kurtz,

I understand we are having different perceptions of the same thing:

I posted in several forums the same question because I wanted to receive as many replies as possible for such an ample subject. In other words to ensure that lot of people read my question.

Wahtever reply I got means that someone used his time, will and knowledge to help me.

I cannot help if someone feels ofended because being both members of the same forum where I post my question he sees that I did the same in another one where we are both also members.

Can't you post the same question in two different forums if you like?

Do you have to expect kind of a Big Brother telling you that you can't?

I had the chance to run across repeated posts in forums mostly about Electronics. Eventually I replied once and that is all to it.

Mi reply to Bigglez may sound harsh / wrathful. It obeys to the fact that for a posting in three different forums he was the objector.

Kurtz, do you like the idea of anyone kind of "chasing" you just because you posted the same question in more than one forum? I do not.

In spite of all this I feel happy to be progressing in my learning of C#. Bad is that my job leaves so little time for it.
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: How I see it

Post by Bigglez »

atferrari wrote: Mi(sic) reply to Bigglez may sound harsh / wrathful. It obeys to the fact that for a posting in three different forums he was the objector.
I took the time to explain to you why another poster
on this forum had called you out on your duplicate
posting. Why oh why are you attacking me?

I read two other forums where you post. No big deal.

Post as many places as you want. Post as many times
as you want. Complain as hard as you want. Keep up
your righeous attitude if you want. Be harsh if you want.
Do anything you want. Just don't come back whining that
your posts are being ignored.
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: How I see it

Post by Bigglez »

Bigglez wrote:
atferrari wrote: Mi(sic) reply to Bigglez may sound harsh / wrathful. It obeys to the fact that for a posting in three different forums he was the objector.
I took the time to explain to you why another poster
on this forum had called you out on your duplicate
posting. Why oh why are you attacking me?

I read two other forums where you post. No big deal.

Post as many places as you want. Post as many times
as you want. Complain as hard as you want. Keep up
your righteous attitude if you want. Be harsh if you want.
Do anything you want. Just don't come back whining that
your posts are being ignored.
riki
Posts: 6
Joined: Sun Dec 13, 2009 4:34 am
Contact:

Re: C# - Basic template - Program organization

Post by riki »

From what I have seen of ferraris postings on several different Forums on this planet,I am suprised that anybody would ever reply to his posts.

I am very sure that he is trying to use the forums as a free educational course,which simply is not the function of these chat zones.

It also very obvious that he has not spent a minute in formal electronics education and is self taught.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests