stl for C ?

Started by
15 comments, last by Evil Steve 13 years ago
Here's a previous post about "templates" in old-school C. I dropped some code that implements a template styled vector data structure at the bottom.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Advertisement
Quote:Original post by Instruo
Quote:
At the risk of sounding a C++ zealot...


what's wrong with being a C++ zealot? OOP, once understood, makes life so clean and simple ;)


At the risk of sounding like a Java (or Smalltalk, or any of a gazillion other languages for that matter) zealot: How is that an argument for C++? [smile]
I actually prefer C#, personally, I was just joking around. I do think that OOP is generally the better way to go, and I think that C is somewhat outdated and is just making things harder than they need to be for... what? Some principle or something that I don't see, I suppose. (And don't tell me 'performance', because most applications don't begin to scratch the surface of what modern hardware can do). Anyway, enough of that rant ;)
"Game Programming" in an of itself does not exist. We learn to program and then use that knowledge to make games.
Quote:Original post by Instruo
I actually prefer C#, personally, I was just joking around. I do think that OOP is generally the better way to go, and I think that C is somewhat outdated and is just making things harder than they need to be for... what? Some principle or something that I don't see, I suppose. (And don't tell me 'performance', because most applications don't begin to scratch the surface of what modern hardware can do). Anyway, enough of that rant ;)


C is still the most portable and interoperable language. Nearly every language has C bindings; rarely do you find bindings to other languages. C has sweet simplicity on its side for those who prefer the OOP of CLOS or Smalltalk (dare I even venture to realms outside OOP? Functional programming? Haskell? Scheme? OCaml!?! Heresy!) but have some need to drop to a lower level (speed, foreign libraries, etc.).

Note I'm saying C is better than anything else, just that it has its place. It's quick and dirty for when you need to deal with the nitty gritty under higher level languages.

As for the original question, there aren't many libraries of that sort for C. As mentioned, glib is a good place to look. But why wouldn't C programmers have such a library? Two reasons:

1) They do, it's just a home brew. Back in the day, there was less focus on libraries and so people had to cook up their own. These are perfectly suited to the needs they had, so why would they use some third party library? (If it ain't broke...)

2) As I said, C is an "under the hood" sort of language. (C++ is more like a car without a hood! [lol] Ha! haha... you know I'm funny! err... now you know why I'm anonymous [cool]) General purpose libraries aren't fine tuned for specific purposes. But if you're using C, it's usually because you need something fine tuned for specific purposes.
I like using C sometimes because of the power I feel.

You know, like when you are a sniper, and wear all this gear, and just sit and watch all day. Than you come home, and battle with samuarai swords. You can literally feel the torque of the handle as you swing it. You can count the cycles like you can your heartbeat.
</end wierd metaphor>
Here is the one I have started, Yet to finish , but you can take a look .
http://code.google.com/p/cstl/
Really? You bumped a 6 year old thread for that?

This topic is closed to new replies.

Advertisement