C
Chris Thomasson
I am almost ready to post an initial prototype of my C++ memory allocator
library:
http://groups.google.com/group/comp.lang.c++/browse_frm/thread/beeee1f61fdbb52c
Anyway, I think my C programming skills are "forceing" there way into my
current design. Yes, it's low-level at its core, but I want to get some of
your thoughts on the issue of using only the "bare-bones" of the C++
language; think embedded, embedded, embedded! ;^)
Well, how would you feel about actually using a C++ library that contained
absolutely NO templates or exceptions?
Imaging the library in question provided a vary basic and "low-level"
interface. Something along the lines of pointer-FILLED stuff like the
following:
<very crude pseudo-code>
struct DoubleLink {
DoubleLink *m_Next;
DoubleLink *m_Prev;
};
class DoubleList {
DoubleLink *m_Front;
DoubleLink *m_Back;
public:
DoubleList() : m_Front(0), m_Back(0) {}
public:
void PushFront(DoubleLink *Link) {
//.
}
void PushBack(DoubleLink *Link) {
//.
}
DoubleLink* Pop(DoubleLink *Link) {
//.
return Link;
}
DoubleLink* PopFront() {
return Pop(m_Front);
}
DoubleLink* PopBack() {
return Pop(m_Back);
}
void MergeFront(DoubleList *Src) {
//..
}
void MergeBack(DoubleList *Src) {
//..
}
};
Would all of those pointers scare most C++ programmers away? I am NOT a
troll. I simply want to know how "useable and/or popular" a C++ library
geared towards the embedded environment is?
How many C++ programmers would say my library is fuc$king CRAP because it
uses no templates?
I am a C programmer at heart and I don't like my "hard-core" C++ skills that
much. Luckily for me! C++ can be a so-called perfect fit for me. I managed
to build 85% of my allocator in pure standard old-school C++, before
templates, and all that fancy stuff came into play.
I wanted to scrap the C++ project for C. But, I figured HEY! I don't HAVE to
misuse every feature of the modern C++ language. I am C; therefore I use C++
at bare bones level, suitable for embedded and operating system level work.
Can I actually get away with using, or misusing!, C++ this way?
Or, should I follow my initial urges to switch to C?
I am 100% comfortable with C++ at a nice low-level. I can use RAII without
templates. I can use encapsulation without any template fancy functor
classes.
ect.ect.
Any thoughts/suggestions/comments are encouraged and welcome!
P.S.
This is not a trolling attempt!!!
Please bear with be here. I would love to "master" C++ at a higher lever,
but, for the moment, I am right at home with old-school vanilla C++ style.
No templates, and TONS of pointers!
:^O
???
Thanks for all of your time in advance. Now try not to flame me too BAD!
:^)
library:
http://groups.google.com/group/comp.lang.c++/browse_frm/thread/beeee1f61fdbb52c
Anyway, I think my C programming skills are "forceing" there way into my
current design. Yes, it's low-level at its core, but I want to get some of
your thoughts on the issue of using only the "bare-bones" of the C++
language; think embedded, embedded, embedded! ;^)
Well, how would you feel about actually using a C++ library that contained
absolutely NO templates or exceptions?
Imaging the library in question provided a vary basic and "low-level"
interface. Something along the lines of pointer-FILLED stuff like the
following:
<very crude pseudo-code>
struct DoubleLink {
DoubleLink *m_Next;
DoubleLink *m_Prev;
};
class DoubleList {
DoubleLink *m_Front;
DoubleLink *m_Back;
public:
DoubleList() : m_Front(0), m_Back(0) {}
public:
void PushFront(DoubleLink *Link) {
//.
}
void PushBack(DoubleLink *Link) {
//.
}
DoubleLink* Pop(DoubleLink *Link) {
//.
return Link;
}
DoubleLink* PopFront() {
return Pop(m_Front);
}
DoubleLink* PopBack() {
return Pop(m_Back);
}
void MergeFront(DoubleList *Src) {
//..
}
void MergeBack(DoubleList *Src) {
//..
}
};
Would all of those pointers scare most C++ programmers away? I am NOT a
troll. I simply want to know how "useable and/or popular" a C++ library
geared towards the embedded environment is?
How many C++ programmers would say my library is fuc$king CRAP because it
uses no templates?
I am a C programmer at heart and I don't like my "hard-core" C++ skills that
much. Luckily for me! C++ can be a so-called perfect fit for me. I managed
to build 85% of my allocator in pure standard old-school C++, before
templates, and all that fancy stuff came into play.
I wanted to scrap the C++ project for C. But, I figured HEY! I don't HAVE to
misuse every feature of the modern C++ language. I am C; therefore I use C++
at bare bones level, suitable for embedded and operating system level work.
Can I actually get away with using, or misusing!, C++ this way?
Or, should I follow my initial urges to switch to C?
I am 100% comfortable with C++ at a nice low-level. I can use RAII without
templates. I can use encapsulation without any template fancy functor
classes.
ect.ect.
Any thoughts/suggestions/comments are encouraged and welcome!
P.S.
This is not a trolling attempt!!!
Please bear with be here. I would love to "master" C++ at a higher lever,
but, for the moment, I am right at home with old-school vanilla C++ style.
No templates, and TONS of pointers!
:^O
???
Thanks for all of your time in advance. Now try not to flame me too BAD!
:^)