500 reputation
412
bio website handcraftedgames.com
location United Kingdom
age
visits member for 3 years, 7 months
seen Dec 13 at 16:01

Arcane Ingenuity. On Twitter.

Disjunction - a realtime MVC framework for C & JS.

For now, arcaneingenuity at gmail.

  • App architecture
  • Algorithm design
  • Procedural world generation
  • Dynamic narrative
  • Rendering & Computational geometry
  • Tech: OpenGL, WebGL, C, JS, HTML5, Unity, C#, C++, Java, Flash, Box2D, PhysX, sockets, node.js.

Aug
7
revised Why do interfaces require methods over members?
edited body
Aug
6
comment Why do interfaces require methods over members?
This is a good answer, in particular I found the information about function lookup informative. Thanks.
Aug
6
comment Why do interfaces require methods over members?
Thanks for this info about Objective-C!
Aug
6
comment Why do interfaces require methods over members?
Thank you, you've understood the thrust of my question and gotten into the gritty details of WHY. I had a hunch that speed would be one of the reasons -- as it always does when you head down the road of "more dynamic". As we are seeing now with languages like JS and Python, flexibility often trumps speed, so the "inertia" you mention towards certain language design trends based on (what was once necessary) optimisation slowly dissolves.
Aug
6
awarded  Scholar
Aug
6
accepted Why do interfaces require methods over members?
Aug
6
comment Why do interfaces require methods over members?
I must say, thinking about this further, I don't really agree about multiple inheritance. Because what I'm really asking about is whether a representation of data members in interfaces is possible, not whether you can use data members to construct interfaces (which is essentially a C++ abstract class). There is a key difference there.
Aug
6
comment Why do interfaces require methods over members?
Re C++, touché. However, actually there are interfaces in dynamic languages, JS and Python being two that immediately spring to mind. Whether a proponent of statically-typed languages would call these "interfaces", is a whole other discussion that I see no point in getting into. Personally I show little preference for either side of that fence, using as I do a broad range of languages to different purposes.
Aug
6
comment Why do interfaces require methods over members?
Members was meant to refer to "member fields" as opposed to "member functions" which I refer to simply as methods. I'm not sure from which language (if any) I picked up this convention. So given what I'd written, I see your answer, but I guess a comment under my question to clarify would have been more constructive.
Aug
6
revised Why do interfaces require methods over members?
added 6 characters in body
Aug
6
revised Why do interfaces require methods over members?
added 14 characters in body
Aug
6
comment Why do interfaces require methods over members?
OK to use the proper Java terminology, yes, "member fields". Thanks for pointing that out.
Aug
6
comment Why do interfaces require methods over members?
What does that prove? Does that one example prove you will never need simple/direct access to members? No. The point is, it is silly to have wrap members in getters / setters as part of the interface, if the language itself could deal with that automatically.
Aug
6
revised Why do interfaces require methods over members?
deleted 309 characters in body
Aug
6
revised Why do interfaces require methods over members?
Large expansion of the question to clarify that I mean "in a theoretical language"
Aug
6
comment Why do interfaces require methods over members?
OK -- wait a minute. After further thought, please see my edit to the question.
Aug
6
revised Why do interfaces require methods over members?
Large expansion of the question to clarify that I mean "in a theoretical language"
Aug
6
comment Why do interfaces require methods over members?
"Code to an interface, not an implementation"... Right. Sometimes we know these things latently but it takes someone to reason them out as you have done, to really solidify the concepts once again.
Aug
6
comment Why do interfaces require methods over members?
Good answer. I tend to favour composition almost entirely in the sort of tasks I undertake these days. I personally don't believe in the separate treatment of abstract classes and interfaces in certain languages, as others on this board have stated, although there are reasons for this, generally these reasons are due to fundamental language limitations (such as mentioned in my comment on ratchet freak's answer).
Aug
6
awarded  Commentator