• Forum
  • Lounge
  • What if I told you I can't write a C++ t

 
What if I told you I can't write a C++ template, but can program games using a Sharp chip, and Gameboy mobo?

Pages: 12
Yes, I can develop games using the Sharp 8-bit chip, and with the Gameboy board, I can develop SNES games using Ricoh 5A22, I can develop Sega Genesis games, such as a small Sonic clone I made directly for Sega (it was a nightmare working with Motorola 68K and memory-mapped-I/O), and I even made a bootloader-like system software program for my PS2's "Emotion Engine".

Despite all of that, C++ templates still confuse me.

Weird?
No. Templates are very abstract. Some people excel at grasping abstract concepts while others excel at more practical things.
Think of templates like a form you would have to fill the blanks. the form does not know your gender or your age, so it is generic to fit anyone. Templates are the same way, they are a generic form to fit whatever they may need.
Templates are very abstract.


Disagree. Templates are not abstract at all, the reason they are difficult is they have somewhat shitty syntax and are very very quirky. For example a complete template specialization must be in a cpp file; a template partial specialization must be in a .h file, unless it is in a cpp file and is only used only by that cpp file; a general template implementation must be in a .h file, unless it is in a cpp file and is only used by that cpp file. That is because the order of template implementations in your files must be the same as the order in which they appear when the compiler processes your files. This is clearly bad design; the compiler can do the sorting for you and figure out cyclic dependencies - you shouldn't have to babysit it.

The above buggy issues make templates very difficult to work with. Let me note that, although I am so critical to c++ templates design (but no more critical to them than I am to my own code), I have not seen a better implementation of templates than in c++, except possibly in D (I don't know that language well enough to judge; I have heard however that recent C++ template design is partially inspired by D).

The good news is that all issues I have with C++ templates are fixable - none of them are deeply rooted - I am looking forward to future versions of C++ for fixes.
Last edited on
tition wrote:
Templates are not abstract at all

How are they not abstract?
An abstract object is an object which does not exist at any particular time or place, but rather exists as a type of thing, i.e. an idea, or abstraction.

They fit the definition of "abstract" perfectly.
@tition:
chrisname is right, templates and generics are abstract.
Yes, I believe you. I've been programming in C++ for like 10 months or so, and I made a few games. (Asteriods, Pong, A prototype RPG engine, and A prototype RTS engine, etc) Matter of fact, I'm working on an RTS engine & RPG engine currently, if you haven't seen my pleads for help on the forums already.

I don't think I will ever understand templates. I haven't even taken the time out of my day to strengthen my grasps on vectors, which I will do during study hall at my school (its boooorrrrinnggg)
Last edited on
I was using incorrectly the word ``abstract'' synonymously to ``difficult to grasp/understand'', and not in the sense you are giving.

The word ``object'' is itself an abstraction. What is a non-abstract ``object''? Chairs, pens, balls, books - those are ``non-abstract''. Everything remotely connected to computers is extremely abstract.

On another remotely related note: I often hear people say ``abstract algebra''. As a mathematician, I protest because there is no such discipline. And, as an English language user, I disagree even more: ``abstract algebra'' as opposed to... ``concrete algebra''?
Last edited on
Why are people still responding to these same old troll threads?

This is the same guy talking about boot loaders and writing OSes and all that other garbage.
That is my bad ... I don't come to forum as often nowadays... but we hijacked the thread properly so it's fine :)
what langs you use. i can find it ok to not understadn teplates for non oop programmers. but generics are becoming popular in oop langs
chrisname wrote:
Some people excel at grasping abstract concepts while others excel at more practical things.
Templates are practical, I think the word you meant was "concrete".
What assembler does Gameboy use?
Nintendo generally assembles the games.
Hahaha, I see what you did there. But seriously, what type of Assembly does it use?
Depends which one. The GBA had an ARM7 processor, so the assembly language would be ARMv3. I believe older GameBoys used the Z80, which was based on the 8080, so its instruction set would be somewhat similar to x86 assembly, but 8-bit. The GBA had a Z80 coprocessor for GameBoy emulation, so it actually used both.
What version of Assembly would you first recommend learning?
C
LB I'm being serious. I already know C.
Sorry, I wasn't being serious.

How about *nix x64?
Pages: 12