The broken inheritance that parent_type provides should indeed be "anti-taught".
I'm going to get to this below, but it is, in fact, mathematically provable that parent_type does not break inheritance at all.
That is an accurate representation. By parent_typing your /gun/ammo to /datum, it strips it of the proper class data that you should be able to rely on.
It doesn't, because it simply places it in a new namespace. You're wrong because your underlying assumptions are that typepaths are an inheritance system, when they are not.
This is exactly what it does. By parent_typing an /obj as a /mob, you will no longer inherit /obj class data, but will instead be artificially classed as a /mob.
No, it does not. If you do
mob/myObj
parent_type = /obj
then /mob/myObj is still a subclass of /obj. It just that the typepath now provides different semantics, but /mob/myObj is a subclass. It inherits its behaviors from the /obj superclass and it fulfills requirements of the superclass and subclass, such as the Liskov substitution principle, which is going to come up again. Furthermore, the virtual machine is aware of the superclass-subclass relation, as demonstrated by this:
mob/myObj
parent_type = /obj
mob/Login()
var/mob/myObj/o = new
world << istype(o, /obj)
It does not work as a namespace, like you seem to think it does, namespaces would provide additional data
This is not how namespaces work in any language that I'm aware of. A namespace is simply an abstract container. There is not and never is additional data associated with it. I'm not even sure what additional data that would entail.
parent_type is an unnecessary full override that essentially creates an entirely new subtype.
This is wrong, assuming you mean subtype to mean subclass. When using the parent_type notation, the relevant class's superclass is the one indicated by parent_type. This is provably true using all formal definitions of a subclass (and especially the Liskov substitution principle, which really is one of the best tools in this case).
What it really comes down to is that this sort of subclassing is not a standard way of doing things, and, as is clear, you do not understand it, nor do you understand how it works. And this scares you.
The thing is, they are simply not scary. And if you understood object-oriented design, you would know this.
A namespace is more accurately comparable to a top level /datum.
No it's not. A top-level /datum is the closest thing BYOND and DM has to a 'pure' class. That is, a class with no associated methods or variables. The closest thing BYOND has to namespaces are typepaths.
It is confusing because /obj/X should behave as an /obj, not as a /mob.
This is true. Unfortunately, this is also regarding the strawman you set up, and it falters in an important way. What is wrong with something like this?
weapon
parent_type = /obj
sword
spear
It is abundantly clear there is nothing in the typepath to indicate what 'weapon' should act like. So, does this mean it should act like 'nothing'?
It is not beneficial because there are more practical, intuitive, and correct methods to create type paths.
Of course, these are practical and while unintuitive at first, they quickly become extremely apparent. Unintuitive does not mean wrong, and something that is unintuitive at first is not forever relegated to unintuitive. You should not let that first impression taint your view of things, for that limits your ability, vastly.
And as for correct? I'd really like to hear a good formal reason for how it is incorrect.
Because you've never used a more complex programming language and, and hell let's admit it, because you're not a real programmer, you can't conceive of how these may be properly used.What was that you said about projecting?
This borders on non-sequitur, because it implies that I have never used a more-complex programming language, when I certainly have. If you want to dick-waggle about the number of languages I've used, there are at least 10, about half of those being languages that compile directly to machine language, and thus have a lot less hand-holding.
I'm not saying his example was wrong, just lacking.
Okay, then let me refine that statement: You're claiming he is wrong because his example is incomplete. I don't know whether that makes more or less sense, but perfect sense it clearly does not make.
If somebody is attempting to explain the Pythagorean theorem to you using an equilateral triangle, then yes, they are doing it wrong. Providing broken examples isn't exactly the best way to teach.
Clearly the point of the statement went over your head. It was to be taken in conjunction with the previous one.
You want me to explain why it isn't effective to create a procedure that does nothing but return another procedure?
Yes, I would like you to explain why encapsulation and separation-of-concerns/abstraction are poor programming practices.
Or why using parent_type to break inheritance isn't an acceptable practice?
This one I really would like you to explain, since it's abundantly clear using formal statements that inheritance is not broken.
That was the entire point of these discussions. As I said earlier, explaining things to you for a 4th time probably won't accomplish much. Just go back and reread things if you couldn't understand them on your first attempt.
If you believe that this is a discussion about object-oriented principles, then your knowledge is worse than I thought. This is simply a lot of discussion of how BYOND implements various things, which is related to OO design. It's obvious that it's not just that you don't understand, but you don't know that you don't understand, which is a lot worse.
There's a difference between 'thinking' you are right and being right.
You're right, but by making a post explaining why you shouldn't use parent_type is not 100% beneficial to BYOND design, or DM, rather. That's like saying a class is 100% nonsensical in an object-oriented approach.
http://www.byond.com/forum/?post=302547
I'm not gonna read it. You wasted your time and others' time by even making a post about it.
I should have probably mentioned how judgmental you are, too. On a side-note, I have been around long enough to know who the jester of this community is, which of course is you.