davidv1992 wrote:A few languages aside, in most objects don't contain code, their descriptor (the class) contains code that specifies how certain interactions modify the object, but in my opinion that is not part of the object. In that perspective a lot of our programs aren't objects in that sense, because they take some input and produce some desired effect (output). In that sense your view is incomplete. I might overestimate this a bit because of the fact that my background is mostly in competition programming, but I've always thought of the objects/classes abstraction as usefull, but having limitations.
Working from such a low level i think has made you mix the two alittle. Objects are made up of data and methods. When they hit the lower level they may indeed only be functions that modify data, but the two levels are very separate.
davidv1992 wrote:You state also that the design should not contain optimizations. I couldn't disagree more with you. If there is any place where there should be carefull consideration of performance it would be in the design, because a better optimized design (ie using different algorithms/datastructures) doesn't make it that much harder to maintain, whilst having the potential of giving massive speedups, whilst code optimization usualy isn't as effective, and usually does mean that maintainance is a lot harder.
I don't believe a different algorithm (or basically a different design) is an optimisation. But yes, I guess what i call optimisations you call code optimisations.. An example;
I used to code some bits for the GP32 handheld. I had read and was told that if my loops counted downward i would save x% for each iteration.. So i spend several hours writing all my algorithms to work with counting backwards.
In the end it seemed that this "optimisation" was written in the 80's, manufacturing of the chips had made the ALU so fast that other parts where slower than what I was improving. I was left with hard to read and maintain code and for next to no gain.
I can see XOR reg, reg instead of reg = 0 heading a similar way.
davidv1992 wrote:Especially in the design of parallel processing programs, you really should think about how work is distributed, because a wrong choice there could seriously hamper your programs ability to really use all of the available processing power.
From your last post I also get the impression that you think of code and design as being one and the same. Although for simple programs this can be a reasonable way to think about it, for larger programs I would suggest making the design seperate from the code, documenting it seperately and so on. This makes thinking about it a lot easier, and seperates the high-level overview of how things interact from the actual details of how each piece does it's job.
Ive been active in the forum about languages etc for a while, i believe current code does not equal design... But that poses the question, what exactly is code for?
I hope you can also see this question also arises with having separate code and separate design.
Theres been some great work in trying to make code = design. After all thats the whole point of object orientated languages. I support Data-Context-Interaction, but its implementation is currently on-top of language ideas. (C++ uses templates).
For me, ASM(/FORTH) should be code, and the next language should be design.
davidv1992 wrote:The awful reality is that parallel programming is hard, and it is our job to make it perform well. Sure, certain modifications to compilers and languages certainly could make some of the work a little bit easier, but the really hard part, the deciding of who does what, will always be the domain of the programmer. A compiler simply will never have the information to properly decide on those issues.
"Who does what" is thinking in objects. Id love to give a parallel program example a try, can you think of a simple example to implement?