Defense Attorney #2 (Yiting Nan) direct Defendant (Avneesh Saxena)
1. (Show Court's Exhibit 2) This is an exhibit of showing C++ poor language definition, do you have something to say about it?
(Browse the Court's Exhibit 2) Well, First thing I would like to clarify is C++ is not a superset of C, they are not comparable sometimes. Second, everyone here can see that this is a piece of poor programmed code. I mean
we are not encouraged to write codes like "int x = 4 //**/2", the programmer deserved the odd result with poor programming.
2. Someone claimed that C++ created an ambiguous language definition that led to gross differences in language implementations in various compilers, as well as gross differences in the behavior of its program code?
Definitely not. These examples are deposition for language implementation. And the reason is lack of standard, for example, "//" and '/* */" for comment, which was solved now - C++ has a standard now and various compiler implementations should be converge to the standard soon. It is not an inherit flaw of language design. Different compiler from different vendor might make the same program show different behavior happens to all languages.
3. Can you give me an example of different compiler lead different behavior for same program?
Sure. On most Fortran77 compilers, when you have a statement " write(7, *) 'Just a test' " without opening a file using unit 7. The text will be written into default file called 'fort.7'. But Microsoft Fortran will prompt you for a file name on screen. Once I port a program from UNIX to PC, submitted job and leave it run, return hours later to see
the result, the popup box still waiting me to input the filename!
One more point I have to added is: even from same vendor, such thing still can happen, Visual Basic is the prime example of this.
4. C++ has been accused by providing unchecked flexibility which insidiously promoted poor programming style.
This is like saying that hammers are bad because they can be used to break things. "Any" language can be used to write code in poor programming style. No programming language can prohibit that. One of most advantages that C++ have is promoting good programming style. It can help you think, organize, reason in a clearly and efficient way.
Inflexibility often keeps one from doing one's work. The programmer who denied this should be given the task of writing a web browser using COBOL.