Re: Any famous C++ project in open source Linux?
- From: LEE Sau Dan <danlee@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 01 Nov 2006 22:25:25 +0800
"Binary" == Binary <binary.chen@xxxxxxxxx> writes:
Binary> You mentioned Java and others mention Python, as a
Binary> programmer for commercial, I have no chance to choose
Binary> these two languages, only have the right to choose C++ and
Binary> C, the reason is these two languages can produce binary
Binary> code.
That's wrong.
Can you tell me what is inherent in Java that makes it impossible to
write a Java->{native binary} compiler?
Now, Google "gcj" and check if your answers to the above question are
valid.
Binary> Remember, I work for embedded company and I am doing low
Binary> level programming such as driver , kernel, and protocol
Binary> stack. Unimagable that use Python to develop this.
Given the nature of your task, even C++ may be considered
inappropriate. (Of course, your project manager has the final
decision.) This is because C++ has its own overheards in order to
support OO -- unless you're not using it's OO-specific features and
hence just using a C++ compiler as an improved C compiler.
e.g. In C, you can use a "union" to various types of values in the
same memory location, and use a shared "type" field to indicate its
type. You can then develop functions that would handle the different
types according to this "type" field. Can you do that in C++? Yes,
but you would use inheritance, right? OK. Suppose you no have some
"objects" that will start out as an object of type "A", and later
morph into type "B" or "C". Can you change the type of an object in
C++ dynamically? No. In C++ (and many other OO languages), the class
of an object is fixed when it is created. If you want to morph it
into another object, you have to create a new object of the new class
instead. But then, you'll have to change all pointers to this object
to the newly created object. In C, you can simply change the "type"
field and the contents of the object (as long as you've malloc'ed
enough memory space) and voila! No need to create a new object. No
need to change all pointers to the object.
Binary> In spare time, I have a glance at some other languages,
Binary> actually, at my college life, I use java to develop some
Binary> program for my university :). It is realy a good memory,
Binary> after that,
Better than C++?
Binary> I begin to implement list & queue time by time.
What's the point of not using java.util.List?
Do you also do that in C++, instead of using STL?
--
Lee Sau Dan 李守敦 ~{@nJX6X~}
E-mail: danlee@xxxxxxxxxxxxxxxxxxxxxxxxxx
Home page: http://www.informatik.uni-freiburg.de/~danlee
.
- Follow-Ups:
- Re: Any famous C++ project in open source Linux?
- From: Binary
- Re: Any famous C++ project in open source Linux?
- Prev by Date: Re: Any famous C++ project in open source Linux?
- Next by Date: Re: Automatically controlling the mouse and keyboard for GUI scripting?
- Previous by thread: Re: Any famous C++ project in open source Linux?
- Next by thread: Re: Any famous C++ project in open source Linux?
- Index(es):
Relevant Pages
|