C # What is the difference between writing attributes and methods in a class and separating attributes and methods !!

Source: Internet
Author: User
Such as question ..

When I used to perform classes, I wrote all the attributes and methods together ..
I also know that the class attributes and methods can be separated, but I think it is not the same ..

Some time ago, I made a forum like discuz .. At that time, we put the attributes and methods in a class ..

These days, the attributes and methods are separated .. It is a feeling that the methods are separated, so they can be placed in multiple classes ..

In this way, you can classify methods .. Calling and writing are much easier,Code.. Unlike before ..

All the code is in a class .. Difficult to find .. When there is a lot of code .. The idea is still confusing ..

Therefore, I personally suggest separating class attributes from methods. [Emphasize again: methods can be classified and managed]

ProgramExperience Peng note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.