Re: Any famous C++ project in open source Linux?



"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
.



Relevant Pages

  • Re: Basic inheritance question
    ... used 'this' in C++ and Java. ... but in Python it doesn't. ... you meant "in languages that has implicit instance reference available in methods"? ...
    (comp.lang.python)
  • Re: Basic inheritance question
    ... Old Java habits die slowly. ... No, seriously it isn't Java habits only, most other languages wouldn't ... That's not very far from what a Python method object does - ... reference to the current instance is to pass it as an argument to the ...
    (comp.lang.python)
  • Re: why is "self" used in OO-Python?
    ... When you define a method in Java there is an implicit 'this' passed to the ... Python cannot tell when you define a function whether the function ... Some languages don't allow you to encapsulate ...     def phone: ...
    (comp.lang.python)
  • Re: True inconsistency in Python
    ... >Explicit comparison with the true constant ... In most languages (including Python), ... Now of course any idiot C programmer knows that these two are ...
    (comp.lang.python)
  • Re: why is "self" used in OO-Python?
    ... When you define a method in Java there is an implicit 'this' passed to the ... Python cannot tell when you define a function whether the function ... Some languages don't allow you to encapsulate ... def phone ...
    (comp.lang.python)