Page 1 of 2

Programming Philosophy

Posted: Sun May 29, 2011 7:12 pm
by THe Floating Brain

Re: Programming Philosophy

Posted: Sun May 29, 2011 8:17 pm
by short
waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay to quiet.

Re: Programming Philosophy

Posted: Sun May 29, 2011 8:53 pm
by THe Floating Brain
short wrote:waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay to quiet.
speakers @ max?

Re: Programming Philosophy

Posted: Sun May 29, 2011 10:20 pm
by THe Floating Brain
I added subtitles :-)

Re: Programming Philosophy

Posted: Mon May 30, 2011 12:45 am
by ismetteren
You are talking a lot about that it is important to write programs in the same way computers understand them (procedural). But isn't the whole point of a compiler to be able to write code on a higher abstraction layer? I can see the conceptual beauty in your approach (then again, LISP is also conceptually beautyfull), but is there really any good reason that the way you structure your programs should be similar to the way the computer reads them? "Programs must be written for people to read, and only incidentally for machines to execute." a guy (Hal Abelson, author of a book about programs and their structure EDIT: *Hey.... that is actually that guy from those MIT lectures! http://groups.csail.mit.edu/mac/classes ... -lectures/ *) once said.

EDIT2:
I figured that i probably should add my own "programming philosophy". It is pretty simple. I don't write my programs for school, neither for a job. I don't program to reach some specific result. I'm 17 years old, by many peoples standards I'm not even supposed to be able to program anything yet, which means that i have absolutely no standards or expectations to live up to[1]. Therefore i just do whatever i find interesting. Right now I'm learning Haskell. The 100% percent pure functional style might not be anything like how the computer actually work, and it might be limiting what i can do(at least how i can do it), but it is also very interesting and cool(It is a completely other way to think about programming, i recommend it :)), so thats what I'm doing.
This philosophy(I can't help thinking that that is not the correct term?... What do i know, i'm not a native English speaker..) of mine has meant that even though I have had this interest in programming for a couple of years by now, i don't really have any finished products to show for it except knowing a lot of stuff. I'm fine with that.

[1] My class mates found it über fantastic, that while doing a physics/math experiment where we threw a lot of dice(about 50), removing all the 6s and then repeated to simulate radioactive decay and then used regression to create a model, I could write a program that made the experiment with 100,000,000 dice in couple of minutes. You know, the law of large numbers and all that ;)

Re: Programming Philosophy

Posted: Mon May 30, 2011 3:54 am
by EccentricDuck
I want to build robust organic software that I can picture and structure in my head, explain to others, and modify later. I want the power to create a multitude of different structures - though I don't want infinite power at the cost of infinite complexity (I can't work with infinite complexity - I wouldn't know where to begin).

To me, programming is an art and a craft; languages and computers are my tools. They are useful mostly for what I can create with them - though I also have a strong appreciation for the experience of creating. That which hinders me needlessly, or doesn't teach me anything, is probably not the best tool to be using. My tools should be contributing to my growth, or the growth of my works.

Re: Programming Philosophy

Posted: Mon May 30, 2011 9:10 am
by THe Floating Brain
Yes the point of a compiler or IDE is to be able to write on a higher abstraction layer ( and not to have to write make files ). But if we write our programs in a such a way that the computer is not suppose to interpret them we will not be getting a good performance out of our programs, (and the procedural stage of the program will be hard to write) reason being; we are forcing the computer to do something it was originally not meant to. This means when the computer interprets your code and turns it into say Assembly it is not writing quality, well performing code or code that is suppose to be computed. It is sort of like having a tree with a strong foundation in its roots, but then the top of the tree starts growing off to one side and the tree starts falling over.
ismetteren wrote: You are talking a lot about that it is important to write programs in the same way computers understand them (procedural). But isn't the whole point of a compiler to be able to write code on a higher abstraction layer? I can see the conceptual beauty in your approach (then again, LISP is also conceptually beautyfull), but is there really any good reason that the way you structure your programs should be similar to the way the computer reads them? "Programs must be written for people to read, and only incidentally for machines to execute." a guy (Hal Abelson, author of a book about programs and their structure EDIT: *Hey.... that is actually that guy from those MIT lectures! http://groups.csail.mit.edu/mac/classes ... -lectures/ *) once said.
ismetteren wrote: EDIT2:
I figured that i probably should add my own "programming philosophy". It is pretty simple. I don't write my programs for school, neither for a job. I don't program to reach some specific result. I'm 17 years old, by many peoples standards I'm not even supposed to be able to program anything yet, which means that i have absolutely no standards or expectations to live up to[1]. Therefore i just do whatever i find interesting. Right now I'm learning Haskell. The 100% percent pure functional style might not be anything like how the computer actually work, and it might be limiting what i can do(at least how i can do it), but it is also very interesting and cool(It is a completely other way to think about programming, i recommend it :)), so thats what I'm doing.
This philosophy(I can't help thinking that that is not the correct term?... What do i know, i'm not a native English speaker..) of mine has meant that even though I have had this interest in programming for a couple of years by now, i don't really have any finished products to show for it except knowing a lot of stuff. I'm fine with that.

That's respectable :-)
ismetteren wrote: [1] My class mates found it über fantastic, that while doing a physics/math experiment where we threw a lot of dice(about 50), removing all the 6s and then repeated to simulate radioactive decay and then used regression to create a model, I could write a program that made the experiment with 100,000,000 dice in couple of minutes. You know, the law of large numbers and all that ;)
Damn I want to take a physics class :-)

Btw I will take a look at that link you sent me :-)

Re: Programming Philosophy

Posted: Mon May 30, 2011 9:14 am
by THe Floating Brain
EccentricDuck wrote:I want to build robust organic software that I can picture and structure in my head, explain to others, and modify later. I want the power to create a multitude of different structures - though I don't want infinite power at the cost of infinite complexity (I can't work with infinite complexity - I wouldn't know where to begin).

To me, programming is an art and a craft; languages and computers are my tools. They are useful mostly for what I can create with them - though I also have a strong appreciation for the experience of creating. That which hinders me needlessly, or doesn't teach me anything, is probably not the best tool to be using. My tools should be contributing to my growth, or the growth of my works.
Very well put, I find the first part of your philosophy especially interesting :-)
To me, programming is an art and a craft; languages and computers are my tools.
I feel the same way. To me programming is not only a art, a craft; but a form of expression the same way a musician may write a beautiful symphony or a artist may create a masterpiece.

Re: Programming Philosophy

Posted: Mon May 30, 2011 1:43 pm
by bnpph
I like to think of OO as just being a wrapper around procedural calls and data, which in reality it is. For modern video games, it is almost a necessity to use some sort of OO - whether it uses functionality built-into the language or not. In the video you were talking about using template functions instead of C++'s built in inheritance, but the fact is that you are still using object inheritance - the difference being templates are static while C++'s inheritance is dynamic.

Also, it is important to keep in mind that humans are computers too, and they happen to work much better with real-world objects than meaningless data. Because of this, humans can inherently write "real world" OO code much better than bit-pushing assembly, just as modern electronic computers can compile into assembly much better than they can write elegant C++ code.


Oh, and I believe you meant to say et cetera in the subtitles, not excreta - which is "Waste matter, such as sweat, urine, or feces, discharged from the body."

Re: Programming Philosophy

Posted: Tue May 31, 2011 6:01 pm
by THe Floating Brain
bnpph wrote:
I like to think of OO as just being a wrapper around procedural calls and data, which in reality it is. For modern video games, it is almost a necessity to use some sort of OO - whether it uses functionality built-into the language or not.
We think similarly.
bnpph wrote:In the video you were talking about using template functions instead of C++'s built in inheritance, but the fact is that you are still using object inheritance - the difference being templates are static while C++'s inheritance is dynamic.
Actually I was talking about how classes can be used as a interchangeable part. A function with a template argument served as the machine the part was going into. I was not trying to rule out inheritance.
Here is basically what I was trying to say (code wise).

Code: Select all

//This is a little pseudo.//
class Entity
{
public:
virtual void Attack();
};
class Player : public Entity
{
public:
void Attack();
};
void Player::Attack()
{
std::cout<<"Attack the goblin!"<<std::endl;
}
class Goblin : public Entity
{
public:
void Attack();
};
void Goblin::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
template<class What1, class What2>
void Battle( What1 Obj1, What2 Obj2 )
{
Obj1.Attack();
Obj2.Attack();
}
Player P;
Goblin G;
Battle( P, G );
Similarly we can do

Code: Select all

class Entity
{
public:
virtual void Attack();
};
class Player : public Entity
{
public:
void Attack();
};
void Player::Attack()
{
std::cout<<"Attack the goblin!"<<std::endl;
}
class Goblin : public Entity
{
public:
void Attack();
};
void Goblin::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
class Ogre : public Entity
{
public:
void Attack();
};
void Ogre::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
template<class What1, class What2>
void Battle( What1 Obj1, What2 Obj2 )
{
Obj1.Attack();
Obj2.Attack();
}
Player P;
Ogre O;
Battle( P , O );
bnpph wrote: Also, it is important to keep in mind that humans are computers too, and they happen to work much better with real-world objects than meaningless data. Because of this, humans can inherently write "real world" OO code much better than bit-pushing assembly,
Agreed.
bnpph wrote: just as modern electronic computers can compile into assembly much better than they can write elegant C++ code.
Exactly! Although im not sure if you agreeing or disagreeing with me?
bnpph wrote: Oh, and I believe you meant to say et cetera in the subtitles, not excreta - which is "Waste matter, such as sweat, urine, or feces, discharged from the body."
I thought that looked a little funny.

Re: Programming Philosophy

Posted: Thu Jun 02, 2011 1:37 pm
by bnpph
Here is basically what I was trying to say (code wise).

Code: Select all

//This is a little pseudo.//
class Entity
{
public:
virtual void Attack();
};
class Player : public Entity
{
public:
void Attack();
};
void Player::Attack()
{
std::cout<<"Attack the goblin!"<<std::endl;
}
class Goblin : public Entity
{
public:
void Attack();
};
void Goblin::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
template<class What1, class What2>
void Battle( What1 Obj1, What2 Obj2 )
{
Obj1.Attack();
Obj2.Attack();
}
Player P;
Goblin G;
Battle( P, G );
Similarly we can do

Code: Select all

class Entity
{
public:
virtual void Attack();
};
class Player : public Entity
{
public:
void Attack();
};
void Player::Attack()
{
std::cout<<"Attack the goblin!"<<std::endl;
}
class Goblin : public Entity
{
public:
void Attack();
};
void Goblin::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
class Ogre : public Entity
{
public:
void Attack();
};
void Ogre::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
template<class What1, class What2>
void Battle( What1 Obj1, What2 Obj2 )
{
Obj1.Attack();
Obj2.Attack();
}
Player P;
Ogre O;
Battle( P , O );
Those two code blocks are the same.
Although im not sure if you agreeing or disagreeing with me?
I forget now. I''ll have to rewatch the video.

Re: Programming Philosophy

Posted: Thu Jun 02, 2011 3:04 pm
by M_D_K
this is my philosophy (and my development methodology). An addendum is "get shit done... elegantly if possible". ;)

Re: Programming Philosophy

Posted: Thu Jun 02, 2011 4:00 pm
by MrDeathNote
M_D_K wrote:this is my philosophy (and my development methodology). An addendum is "get shit done... elegantly if possible". ;)
LOL fucking hilarious!

Re: Programming Philosophy

Posted: Thu Jun 02, 2011 9:11 pm
by THe Floating Brain
M_D_K wrote:this is my philosophy (and my development methodology). An addendum is "get shit done... elegantly if possible". ;)
:lol: :lol: :lol:
bnpph wrote:
Here is basically what I was trying to say (code wise).

Code: Select all

//This is a little pseudo.//
class Entity
{
public:
virtual void Attack();
};
class Player : public Entity
{
public:
void Attack();
};
void Player::Attack()
{
std::cout<<"Attack the goblin!"<<std::endl;
}
class Goblin : public Entity
{
public:
void Attack();
};
void Goblin::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
template<class What1, class What2>
void Battle( What1 Obj1, What2 Obj2 )
{
Obj1.Attack();
Obj2.Attack();
}
Player P;
Goblin G;
Battle( P, G );
Similarly we can do

Code: Select all

class Entity
{
public:
virtual void Attack();
};
class Player : public Entity
{
public:
void Attack();
};
void Player::Attack()
{
std::cout<<"Attack the goblin!"<<std::endl;
}
class Goblin : public Entity
{
public:
void Attack();
};
void Goblin::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
class Ogre : public Entity
{
public:
void Attack();
};
void Ogre::Attack()
{
std::cout<<"Attack the player!"<<std::endl;
}
template<class What1, class What2>
void Battle( What1 Obj1, What2 Obj2 )
{
Obj1.Attack();
Obj2.Attack();
}
Player P;
Ogre O;
Battle( P , O );
Those two code blocks are the same.
Second code block has a fourth class in it and is slightly different at the bottom.
bnpph wrote:
Although im not sure if you agreeing or disagreeing with me?
I forget now. I''ll have to rewatch the video.
*Joke* <reference> interpreting vague answer as yes </reference>.

Re: Programming Philosophy

Posted: Fri Jun 03, 2011 7:14 am
by ismetteren
I just stumbled upon this, and this thread came to mind: http://stackoverflow.com/questions/5764 ... f-pure-ood
It seems like a good example of this "trying too hard to model the real world in OOP" concept some of you are talking about.