I read a couple of threads here about structures and there was / was one about structures and how they should represent immutable values (for example, as a digit - 1) due to their behavior / semantics like value.
But, on the other hand, structures represent things like phone numbers that can change for the same household.
Is this a tough and quick rule?
The phone number does not change; you just get another and discard the old one. The old one is the same as always. The same goes for dates, numbers, etc. - think about it when approaching structures. This is a way to encapsulate a value that simply is; rather than using a value that changes.
Yes, structures should always be unchanged! Variable structures can cause terrible headaches, as their use can create very strange behavior.
, . , : , . 555-555-1234 - 555-555-1234, - 555-555-5678.
, .NET Framework. , WPF Point Size . , , something.Location.X = newX.
something.Location.X = newX
!=
, , , , . int x = 5; x++; . 5++; .
int x = 5; x++;
5++;
, (, myStruct.MyInt++), , MyInt. , , , .
myStruct.MyInt++
? , myStruct.MyInt , , , , .
Source: https://habr.com/ru/post/1733724/More articles:Change the font using the C # font dialog - c #Running SQL Server 2008 Sproc at a lower priority - sql-serverSubtype handling in ASP.NET MVC - polymorphismEncrypt / decrypt an image in ActionScript 3 - securityPassing parameters in a circuit - parameter-passingMySQLdb within python2.5 virtualenv - pythonjQuery.ajax does not cause an error callback for localhost queries - jqueryMATLAB - print schedule with different product names - matlabOpenSSL in ruby: PKCS # 8 format for private key - ruby | fooobar.comHow to use Twitter API to check if user / password is valid? - pythonAll Articles