Author Topic: pedantic object oriented question  (Read 54542 times)

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: pedantic object oriented question
« Reply #15 on: March 31, 2013, 10:12:53 AM »
It's much more important that something is implemented and works than that it is implemented "perfectly" or "correctly".

People who say that don't get the idea. The principles of OOP were not invented because they are "correct". During the years I have learned to use some of the OOP techniques while I feel there is less need for some others. What I see frequently are programmers who use everything without any good reason. In C++ it's usually overusing templates and inheritance. It's important to really understand OOP and how you can use it in a practical way. I think the difficulty of OOP is one of the reasons why strict OOP languages are not that good in programming real programs and why C++ is so popular, because it's multi-paradigm and you can break strict rules which is sometimes better and faster solution.

The only problem with OOP is that you cannot necessarily predict the scope of your program and all of it's use-cases without some degree of software engineering. For games, that's not simple without a clear design goals and game rules, which is hard for even AAA firms. What you say about C++ is true when it comes to breaking OOP when you need to, but it's equally obtuse and obstructive when you start talking about its utterly retarded type system and all of the "features."

Lua embedded in C will do everything that C++ does without obstruction and without compromise to speed. Algorithms in C, Data management in Lua-- it's really beautiful.

This hilarious little tidbit from Linus Torvalds on C++ is a worthwhile read.
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: pedantic object oriented question
« Reply #16 on: March 31, 2013, 11:57:21 AM »
Lua embedded in C will do everything that C++ does without obstruction and without compromise to speed. Algorithms in C, Data management in Lua-- it's really beautiful.

Uh oh.. I don't like the way this is going. Like I said, you need to forget your prejudice about C++/OOP. Only then you can understand why it is better than C.

Quote
This hilarious little tidbit from Linus Torvalds on C++ is a worthwhile read.
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918

Linus is a wrong person to talk about programming. He is just a lucky guy who invented Linux, but didn't really do any of the hard work that made Linux what it is today. Now he is a lazy millionaire and speaking all sorts of rubbish about programming, Windows etc. I wouldn't listen to that guy.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: pedantic object oriented question
« Reply #17 on: March 31, 2013, 04:53:51 PM »
Lua embedded in C will do everything that C++ does without obstruction and without compromise to speed. Algorithms in C, Data management in Lua-- it's really beautiful.

Uh oh.. I don't like the way this is going. Like I said, you need to forget your prejudice about C++/OOP. Only then you can understand why it is better than C.

Quote
This hilarious little tidbit from Linus Torvalds on C++ is a worthwhile read.
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918

Linus is a wrong person to talk about programming. He is just a lucky guy who invented Linux, but didn't really do any of the hard work that made Linux what it is today. Now he is a lazy millionaire and speaking all sorts of rubbish about programming, Windows etc. I wouldn't listen to that guy.

It's more useful, but we can't qualitatively say better.

Linus is just funny ^_^.

AgingMinotaur

  • Rogueliker
  • ***
  • Posts: 805
  • Karma: +2/-0
  • Original Discriminating Buffalo Man
    • View Profile
    • Land of Strangers
Re: pedantic object oriented question
« Reply #18 on: April 01, 2013, 07:33:47 PM »
Re: Critters referencing which level/map they belong to: I ended up doing exactly this in Squirm, leading to really horrible memory leaks that I discovered years later, and which made me just give up on the game completely. Related, (maybe you already know this, but it can't be said enough, especially about languages with garbage collection, I think): Try not to directly reference instances like items, critters, level layouts, more than you have to. One way that's certainly better, is to keep eg. a dictionary for your critters, where every being can be looked up with a key. That way, if you remove a critter from that dictionary, you can be sure there remain no references to it hidden behind the rose-pot.

Re: Linus. I'm a crusty Linux fanatic myself, but have to agree with Krice on this one  ;). That guy just acts like an utter clown so often, even if I'm sure his accomplishments have demanded a lot of talent, ingenuity and hard work.

As always,
Minotauros
This matir, as laborintus, Dedalus hous, hath many halkes and hurnes ... wyndynges and wrynkelynges.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: pedantic object oriented question
« Reply #19 on: April 02, 2013, 09:43:01 AM »
It's more useful, but we can't qualitatively say better.

It is better:
http://www.stroustrup.com/bs_faq.html#difference

guest509

  • Guest
Re: pedantic object oriented question
« Reply #20 on: April 02, 2013, 10:17:49 AM »
Ha! Come on you guys. Which language is better? Which style? Object orientated or nay?

The discussion becomes too abstract and laughable.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: pedantic object oriented question
« Reply #21 on: April 02, 2013, 09:18:03 PM »
The discussion becomes too abstract and laughable.

What is laughable is the way a personal view is more important than logical and analytic approach to programming.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: pedantic object oriented question
« Reply #22 on: April 05, 2013, 07:22:50 PM »
The discussion becomes too abstract and laughable.

What is laughable is the way a personal view is more important than logical and analytic approach to programming.

Strousstrop arguing that the language he designed is better than the language it was designed with is an amusing way to suggest that it is objectively better.

You can achieve all the power with significantly more elegance with a combination of C and Lua- Lua being programmed in C is a subset of C so... it's really all just a varied expression of C. The fact that C++ attempts to be a super-set of C automatically works against the idea of compatibility, which results in new specifications to address every issue that results from this. If Strouss just created a new language altogether, without trying to build an object oriented paradigm on top of C, he would have something much more elegant and beautiful.

I've recently become incredibly interested in Language design and started a blog discussing a thing or two. http://requerent.blogspot.com/. Although I don't talk about the C vs C++ argument, I do cover some other general issues that we all experience with most programming languages today.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: pedantic object oriented question
« Reply #23 on: April 05, 2013, 08:15:42 PM »
You can achieve all the power with significantly more elegance with a combination of C and Lua

I think this discussion is over. Grow up and learn more about programming. That's all I can say.

joeclark77

  • Rogueliker
  • ***
  • Posts: 90
  • Karma: +0/-0
    • View Profile
Re: pedantic object oriented question
« Reply #24 on: April 05, 2013, 10:35:32 PM »
I appreciate all the feedback, guys!
I think the take-away here is that programming a roguelike is different than normal programming if, like me, you're trying to learn something while you do it.  This game I'm writing in Python.  The next one I might try doing in Java.  And I might try using different libraries to do the same things.  I know that striving for "perfect" OOP shouldn't be an obstacle to a working game, but I'm glad to have had the chance to think about it with you all anyway.  (Now I can put that on my resume...)


requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: pedantic object oriented question
« Reply #25 on: April 05, 2013, 11:23:11 PM »


You can achieve all the power with significantly more elegance with a combination of C and Lua

I think this discussion is over. Grow up and learn more about programming. That's all I can say.

Or I just won't reply with an ad hominem.

guest509

  • Guest
Re: pedantic object oriented question
« Reply #26 on: April 07, 2013, 12:23:30 AM »
I appreciate all the feedback, guys!
I think the take-away here is that programming a roguelike is different than normal programming if, like me, you're trying to learn something while you do it.  This game I'm writing in Python.  The next one I might try doing in Java.  And I might try using different libraries to do the same things.  I know that striving for "perfect" OOP shouldn't be an obstacle to a working game, but I'm glad to have had the chance to think about it with you all anyway.  (Now I can put that on my resume...)

If you want to build up a game making resume having your own FINISHED projects on it is great. I was reading an article the other day about it. It's hard to break into the game industry without a solid resume, and starting your own projects early and often is the key to building that resume. One of the keys, at least.

Here is that article, if you're interested:
http://codesuppository.blogspot.ca/2013/04/so-your-teenager-tells-you-they-want-to.html

ekolis

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 186
  • Karma: +0/-0
  • get ye dennis
    • View Profile
    • Ed's home page
    • Email
Re: pedantic object oriented question
« Reply #27 on: April 09, 2013, 05:58:44 PM »
You can achieve all the power with significantly more elegance with a combination of C and Lua- Lua being programmed in C is a subset of C so... it's really all just a varied expression of C.

By that logic, we should all be programming in assembly, because C is merely a subset of assembly... ::)
The Ed draws near! What dost thou deaux?

>EAT SANDVICH

AgingMinotaur

  • Rogueliker
  • ***
  • Posts: 805
  • Karma: +2/-0
  • Original Discriminating Buffalo Man
    • View Profile
    • Land of Strangers
Re: pedantic object oriented question
« Reply #28 on: April 09, 2013, 06:18:51 PM »
You can achieve all the power with significantly more elegance with a combination of C and Lua- Lua being programmed in C is a subset of C so... it's really all just a varied expression of C.

By that logic, we should all be programming in assembly, because C is merely a subset of assembly... ::)
Pathetic n00bs, all! Real programmers write the 0s and 1s directly.

As always,
Minotauros
This matir, as laborintus, Dedalus hous, hath many halkes and hurnes ... wyndynges and wrynkelynges.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: pedantic object oriented question
« Reply #29 on: April 10, 2013, 01:01:23 AM »
You can achieve all the power with significantly more elegance with a combination of C and Lua- Lua being programmed in C is a subset of C so... it's really all just a varied expression of C.

By that logic, we should all be programming in assembly, because C is merely a subset of assembly... ::)

By what logic? OR a lack of reading skills? I hope it's the latter, as inferences like that would make life very difficult.