Thanks, I forgot I can make the entire struct final.
Yet, I wouldn't get rid of the backing field... I don't like to make a class/struct use property getters instead of using their fields directly... that's really a personal choice.
In any case, I will mark the struct as readonly. Thanks for reminding me of that!
Question... if I have an array of my struct... the array itself is readonly... yet I can modify the contents of the array... should I mark the class readonly because I never replace one array by another, or not, as there are mutator methods to change the contents of the inner array?
The real class implements IEquatable and IComparable. I simply didn't want to make the code to huge for this discussion.
And, even though Marshal methods aren't marked as unsafe they are, by definition, unsafe. In fact, reflection itself is not called unsafe, although you can create empty instances of classes that do not define default constructors and the like...
Skipping the class/struct/readonly/whatever discussions, and commenting on the subject line topic: Enums.
My programming childhood (i.e. as a university freshman) was with Pascal, which provided true enums. Not named integers. In the C language class, replacing integer #define with enum is just syntactical sugar. They are integers in disguise. Or not really disguise - it is just a very thin veil.
The very idea behind enums is that they are not integers, no matter what C programmers say. January, February and so on are months, not integers! May is May. It takes a C programmer to get into an argument whether the month of May "really" is 4 or 5. Well, the C programmer would never be in doubt. Also, half of May is March, that is obvious, isn't it? (Half of June is also March.)
Noooo! Enums are countable (enumerable, if you prefer). So are apples. That doesn't make an apple an integer.
If you are really talking about integers, they are integers. Replacing the digit 0 with 'D0', 1 with 'D1' and so on does not, not in any way whatsoever, 'improve legibility'. Quite to the contrary; it hides the fact that you are in fact talking about integer numbers. The reader has to look up the definition of 'D4' to see what it represents: Is it the binary integer 4, or is is the character code for the '4' digit character, or something quite different, such as 'dictionary entry with key 4'?
Enums have no place in this context of yours - not even in the C-style 'enums are named integers' style. You are handling true integers. Declare them as true integers, and nothing else.
(And: If Pascal had still been alive, you could have had exactly what you are trying to achieve defining new subrange type such as TYPE SingleDigitInteger = 0 ..9; and the compiler + runtime system would catch all attempts to set a variable/field of this type to a value outside its defined range. It would still be a numeric integer. Unfortunately, Pascal, and a lot of great ideas it represented, died several decades ago.)
I am creating a new kind of "development" platform that uses a custom data model (custom classes etc...). The thing is that the development is going to require a significant amount of collaboration and work by different users (members of a team), potentially all at once. All data needs to stored in one place. In the end it would work somewhat similar to a code management system but it isn't code being developed and that comparison is somewhat superficial. A centralized system harvests tasks (based on information gathered) from the internet and those tasks get distributed among specialists to look at the data, standardize it, format it, build upon it, and submit it for integration into the main "fork"/trunk so to speak. I am probably looking at a client-server model but since this approach to data storage, programming, and most importantly, data sharing is entirely new to me, I am not certain which model to use and not sure where to look to find information to teach me how to build such an application/data model. Internet searches so far get too broad of results that aren't helpful (such as how to use and distribute a database or information on data services). Any pointers to get me started? I am also looking for a secure place/server to store the data for people on the team to access. It doesn't need to be incredibly big. Frankly Google Drive is plenty of space. Not sure how I would leverage that though (through the software).
It is merged after it is reviewed. Once I gain confidence that a team member is doing what I need them to, following the vision I have, they would have rights to merge it themselves.
"Can multiple people be touching the same data at the same time?" Same target/source files... yes. Same actual data, no (though theoretically it could happen... would probably have to write checks/locks into the code). The approach I intend on taking is to hire different people with different strengths and backgrounds so each individual task would only be touched by one team member.
To be honest, what you have described so far instantly led me to think of event sourcing. The idea behind this is that you don't change state, instead you save a new event everytime something changes. So, when you view the "thing", behind the scenes, every event is replayed to create the state as it currently is. When you accept the review, you could create a snapshot of the fully played event if you wanted to provide a "final state" for that particular item.
development is going to require a significant amount of collaboration and work by different users (members of a team), potentially all at once. All data needs to stored in one place. In the end it would work somewhat similar to a code management system but it isn't code being developed and that comparison is somewhat superficial.
How would you motivate anyone else to participate in such a vague plan ?
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
Wow... you guys make all kinds of incorrect assumptions and right now I am so angry that I may just quit this forum myself after being a member for years. I have NEVER been treated this way here before. No need to kick me off. This is a legitimate question. I only use this forum when I need help. I am programming it myself if I can. I don't want help with the actual programming if I can avoid it so I am not looking for programmers. You people don't even have the expertise I am looking for so bug off. Otherwise answer my question. I just need some advice.
LOL. IF I remain on this site, I will post the patent here when I get it. If I am able to finish the project, it will happen. I love how you all feel your experience in programming entitles you to points. I find it terribly ironic I can upvote my own comments. Honestly, I don't give a rats butt about my reputation here. I only come to help myself and others in repayment. It's really a shame that folks like you pick and choose to ruin it for other people. You guys continue to make erroneous assumptions about everything under the sun, talking about everything EXCEPT the answer to the question I asked. After this crap treatment I won't bother coming here again to ask questions. So rest easy and pat yourself on the back for making your point on a job well done. I also won't have anything nice to say about this forum anymore. I know you don't care but oh well... can't help that. I am an elementary school teacher for Pete's sake.
Actually both apply here. Honestly, I am having difficulty with the pricing model because yes... what I am building will provide a much needed resource in education and instructional design (both public and private) and I don't want people to have to pay significant sums of money for the "much needed" aspect of what I am building. At the same time, it would be nice to make some money because as a teacher I get paid relatively little.
LOL. I am not this vague when talking to people about the actual project. I already have two other people who seem rather interested in working on it and have asked me to let them know when I am ready to go. I am being vague here because most details aren't really necessary to share and because the project (end result) will be patented. I can't exactly discuss specific details on a public forum if I want to file for a patent. Whatever details people need to be shared I will share if asked for (and don't require me to be too explicit in detail).
I asked a single, non-specific question. "Any pointers on where to get started?" Yes. I know I was "vague" in the details. I was that way on purpose given the nature of the project. However, I feel I gave enough to answer the question by giving a basic run-down of the kind of application it was. I ask and people just assume I am recruiter misusing the forum. I am also not asking a detailed question, nor am I looking for a detailed answer (which I realize is probably not in line with the default around here). Just pointers; a basic idea for me to look up. I don't need specifics. I can find them myself. I even gave an example in the "details" of the kind of answer I was looking for: "client-server." If people focused on the question as is rather than "details" there would be fewer conflicts and frustrations. If one needs specifics to answer the question, then ask. It's that simple. The first person to answer (Pete) asked a legitimate question looking for details and I answered him with the details he needed. No problems on either side. He also didn't assume a negative spin, even in his later comment in which he suggested I was either altruistic or motivated by money.
Last Visit: 31-Dec-99 18:00 Last Update: 25-Sep-23 0:38