Programming Philosophy

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Programming Philosophy

Post by THe Floating Brain »

"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
short
ES Beta Backer
ES Beta Backer
Posts: 548
Joined: Thu Apr 30, 2009 2:22 am
Current Project: c++, c
Favorite Gaming Platforms: SNES, PS2, SNES, SNES, PC NES
Programming Language of Choice: c, c++
Location: Oregon, US

Re: Programming Philosophy

Post by short »

waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay to quiet.
My github repository contains the project I am currently working on,
link: https://github.com/bjadamson
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Programming Philosophy

Post by THe Floating Brain »

short wrote:waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay to quiet.
speakers @ max?
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Programming Philosophy

Post by THe Floating Brain »

I added subtitles :-)
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
ismetteren
Chaos Rift Junior
Chaos Rift Junior
Posts: 276
Joined: Mon Jul 21, 2008 4:13 pm

Re: Programming Philosophy

Post 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 ;)
Last edited by ismetteren on Mon May 30, 2011 7:57 am, edited 2 times in total.
Image ImageImage Image
User avatar
EccentricDuck
Chaos Rift Junior
Chaos Rift Junior
Posts: 305
Joined: Sun Feb 21, 2010 11:18 pm
Current Project: Isometric "2.5D" Airship Game
Favorite Gaming Platforms: PS2, SNES, GBA, PC
Programming Language of Choice: C#, Python, JScript
Location: Edmonton, Alberta

Re: Programming Philosophy

Post 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.
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Programming Philosophy

Post 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 :-)
Last edited by THe Floating Brain on Thu Jun 02, 2011 9:17 pm, edited 1 time in total.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Programming Philosophy

Post 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.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
bnpph
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 75
Joined: Thu Mar 10, 2011 12:30 pm

Re: Programming Philosophy

Post 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."
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Programming Philosophy

Post 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.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
bnpph
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 75
Joined: Thu Mar 10, 2011 12:30 pm

Re: Programming Philosophy

Post 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.
User avatar
M_D_K
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1087
Joined: Tue Oct 28, 2008 10:33 am
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++
Location: UK

Re: Programming Philosophy

Post by M_D_K »

this is my philosophy (and my development methodology). An addendum is "get shit done... elegantly if possible". ;)
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Programming Philosophy

Post 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!
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Programming Philosophy

Post 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>.
Last edited by THe Floating Brain on Thu Jun 02, 2011 9:14 pm, edited 1 time in total.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
User avatar
ismetteren
Chaos Rift Junior
Chaos Rift Junior
Posts: 276
Joined: Mon Jul 21, 2008 4:13 pm

Re: Programming Philosophy

Post 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.
Image ImageImage Image
Post Reply