for instance. Be sure to note that there are two files for every match - one from each person's point of view. Getting the file from the winner is more fun! Then, all you have to do is unzip the dm_66 file, and then double-click the dm_66 file in order to view it.
Note that these instructions worked for me, and are not necessarily going to work for you! All of this of course on a Win box.
I installed osp-quake3-0.99v3.zip already, and I appear to be running that mod okay, but I can't figure out what the heck I have to do with the dm_66 file in order to view it!
You might consider getting some help for that persecution complex.
If this is a back-handed apology, I accept. If it's merely another insult, you might want to consider taking some agression management classes. I think it's somewhat childish of you to move an argument of fact into a namecalling bout, suggesting that I don't live in the real world, don't know how to use the English language, and now that I need therapy, and have a "widdle head."
Semantic debates are sometimes enthralling, because you can twist words to make facts lie - but they don't really further understanding. Your definitions of "program" and "call" are well stated, and I believe I understand them, but I don't believe that they reall help you.
Word can call Excel to do spreadsheets, but that doesn't make it a spreadsheet program. PRman can call BMRT to do raytracing, but that doesn't make it a raytracing program. Eudora can call PGP to do encryption, but that doesn't make it an encryption program. The JVM can call methods in a class file to give you the long-distance phone calling capabilities in DialPad, but that doesn't make the JVM a long-distance phone calling program. Quake III : Team Arena can call jpeg library functions to load jpeg images, but that doesn't make it a jpeg image loading program. Internet Explorer can call Hotmail to send email, but that doesn't make Internet Explorer an email program. PRMan can call the shader language to do shading, but that doesn't make it a shading program.
Utility is an interesting thing. I can use a butter knife to turn screws, and I will agree with you that my ability to use a butter knife in that manner doesn't somehow turn it into a "screwdriver," in the traditional sense. But, if your definition of a screwdriver is merely that it is an implement with which one may turn a screw, it becomes a pretty hazy line. If you ask me for a screwdriver, and I hand you a butter knife, I'll laugh at myself, right along with you. It's silly, it's not what you asked for, but it'll do the job. You have to agree that if a demolitions expert is trying to defuse a nuclear bomb without his tools, the clock says 26 seconds, and he asks me for a screwdriver, if I hand him a butter knife - I've saved the day!
Most effects houses have a hard time staying in the black, and most use PRMan. If an effects house is down to the wire, and their client demands that a certain effect needs to look more real, and the only way to pull it off is by having PRMan call BMRT to do raytracing, they'd rather use my definitions of "program" and "call" than yours.
I love your last paragraph - I think you should use it, then next time you're on Jerry Springer.
Well, I guess I live in the real world where people make their arguments using English language sentances, not echo and sed.
After executing your commands, I am left with the following statement from you:
prman can't do radiosity via an SL trace without BMRT.
Now, I will apply the English language suggestion for good writing, "Don't never use double negatives," after which, your statement becomes:
prman can do radiosity via an SL trace with BMRT.
This is shockingly like my original statment:
PRMAN CAN RAYTRACE USING BMRT AS A TRACER.
And I guess I agree with myself. So, then I can only laugh, when I read your insulting statement:
If you still think that's prman doing raytracing then I suggest you take a remedial english class.
Because I just proved that you "think that's prman doing raytracing"! So, why exactly did you need to insult me twice in your post, in order to agree with me?
If I'm in Word, and I add an Excel spreadsheet to it - and then I print it - is that Word printing a spreadsheet? By my definition, yes - by your definition, no.
By my definition, Word can use Excel as a spreadsheet renderer. By your definition, apparently, just because Excel is not built in to Word, it means that Word is incapable of printing spreadsheets.
They're telling me, "There's no way for Word to print a spreadsheet," and I'm saying they're wrong. You're also saying I'm wrong. But I'm not, I'm right - and the page I pointed to shows how it can be done. It's not easy, and there are problems, but it can be done. The actual facts are on my side.
Your definition might be more technically correct (since "we don't say that program 1 is performing the specific task"), but mine is certainly more useful. Since my point was that program 1 is able to perform a specific task, by commincating with another program. Many programs are incapable of communicating with other programs in such a manner, and that makes PRMan pretty cool, in my book.
You can hook up PRMan and BMRT together, using BMRT to do the trace() calls. This is in fact a semi-supported function that Pixar gives to people. When you get PRMan, they'll happily give you BMRT, as well. Many things Pixar does use BMRT. BMRT is good. Don't diss BMRT. When people use PRMan, BMRT is a natural thing to include in many cases!
If you look at the inset you'll see that it says that it can do 60,000 pixels per second. That's not good.
At 30 frames per second, that's roughly 44x44 pixels.
At 10 frames per second, that's roughly 77x77 pixels.
At 1 frame per second, that's still only 244x244 pixels.
Keep in mind that all pixels are transparent or red only.
You won't be playing Quake on this thing, any time soon.
Why do you have to pass variables at all? I can't believe I'm reading this. You think that all inter-class members should communicate all of their data through member variables? Java crowd : pay attention! This is the exact kind of programming style that you should fear.
Yes, several methods in the same class should pass variables, and they should often be allowed to return more than one value. That way you can write atomic code that is easily used for multiple purposes. You encapsulate the functionality into building blocks that can be used, in many different circumstances. This is a fundamental concept of structured programming.
Using member variables to do all of the communication within a class is akin to using nothing but global variables in a normal program. You can't write re-entrant code, recursive code, or methods that call methods that call methods... You end up with a morass of code that's impossible to maintain. At least, when you're coding a class with any significant size.
C recognizes that often, it's convenient to have one function return more than one value. This is accomplished through explicitly passing by reference - allowing the called method to change the value pointed to, so that the caller can then access that data. In Java, the only way to do that is to use a class - like Vector, or a special-purpose class.
That slows down coding, and doesn't in any way lead to better code, or better OO design. It's merely a hoop that you as the programmer have to jump through.
Back to the whole point of this discussion : most programmers will have to use C and C++ in their professional lives. Java lacks functionality that C and C++ have. Teach beginning Computer Science students in C and C++.
Well, Fortran was invented circa 1957, so I agree that Fortran was the language that Computer Scientists would most likely be using to learn Computer Science, for a long time. At least until Modula, and Lisp came along. Universities were pretty well split between them, I think. I seriously doubt that any University tried to teach Computer Science using COBOL - which was invented circa 1960. Right around 1971, when Pascal and C were invented, I think they became very popular for teaching Computer Science. There have been strong-holds for Fortran and Lisp, but I think C has done pretty well for itself. I agree with your argument that languages change. But I think you're nuts, if you honestly think that C++ will go away, and Java is going to live on.
By your extended argument, BASIC sounds ideal as an introductory language. After all, things getting more complex and difficult is how courses are supposed to go right? The point can be carried out, ad absurdum. But, going in the opposite direction, C++ can do just about anything, whereas Java can't. And also, C++ is far my widely used, and excepted. If you're going to pick one over the other for teaching beginning Computer Science students, pick C++.
As a student in High School, I learned about binary trees. They were on the AP CS exam, when I took it. I presume they will still be on the AP CS exam, but now in Java? That's nuts. My point is that, if you're going to pick ONE LANGUAGE to teach beginning Computer Scientists, it should be C/C++, not Java.
Huffman and ZIP are different. I did code a Huffman compressor in my Computer Science courses, and we did it in C. Doing the same thing in Java would be nightmarish. Unless you cheated, and used the Java class libraries to take care of the hard stuff! That's my point - they should be able to do it from scratch. Otherwise, why make them do it at all?
So, all of the things you're proposing to teach them, I can teach them in C++. Easily. But you can't easily teach them memory management, pointers, many data structures, operating systems, and a lot of fundamental Networking. And I can even teach them to code a real Operating System, a real Database, a real First-Person Shooter video game, and device drivers. These are valuable things to be able to teach!
Java is great. But C++ is better, if you're only going to choose ONE language to teach beginning Computer Scientists.
I appreciate your responses, you make an honest attempt to address the question at hand : teaching beginning Computer Scientists.
or more accurately whether it's a good language to teach them
You are incorrect. If the AP Computer Science exam is going to be given in Java, then Java is the only language that will be taught, in most High Schools' Computer Science courses. Java is a good language to teach them, but it most definately shouldn't be the only language. If you're going to pick one, and only one language to teach someone Computer Science, that language should be C++.
I stand corrected : there is a way to make global variables in Java. (Except they're still defined INSIDE of a class, which was my point, in the first place. If you never make an instance of the class Globals, then those variables are not accessable.)
One of those recurring features you see in bad C++ code where people are trying to write Java in C++ is a new, but no delete. Which is the more grave mistake?
To step back a little bit from your argument, it's easier to learn to code in BASIC than it is to code in Java or C++. But that's not a good argument for using BASIC over Java or C++ in my book : BASIC is lacking fundamental constructs necessary for a serious Computer Science education. And so is Java.
When people propose that Java should be the one and only language taught to Computer Scientists, I wonder if they remember the courses that they took:
DATA STRUCTURES : Linked lists. Binary trees. Hash tables. Red-black trees. All of these are far easier to code in C and C++ than they are to code in Java. Because C and C++ have pointers, that you as the programmer can control. Java provides a lot of this in convenient API form, but the back-end in Java, is C and C++ code. So, Java is FINE as a programming language, but it fails as a teaching language.
OPERATING SYSTEMS - You might be able to put together a tinkertoy OS in Java, but that's about it. Every real OS in the world was written in C and C++, or assembley, or flat-out machine code. I'd argue that it would be nice to be able to actually code portions of a real OS in your OS class - C / C++ is the clear answer. Java fails miserably.
NETWORKING - You're not going to code a TCP/IP stack in Java. Java certainly doesn't - they expose a Java API to C code. Not that I'm necessarily arguing that you need to code a TCP/IP stack in a college Networking course. But when I was in college, we studied packet spoofing, building connection-based protocols on top of UDP, error detection and correction codes. All of that is easy in C/C++, and you can understand why it might need to be done. It's completely fake in Java - it's like trying to write a hard-drive controller in Microsoft Excell's Visual Basic for Applications. You PROBABLY could, but it really doesn't make any sense to.
DATABASES - in any good database class, you're going to talk about how a database actually works, not just how to use one. No real database system would ever be coded in Java. You'd ACCESS one from Java, sure - but why port MySQL to Java?
Java has a subset of the programming constructs that C++ has. There are portions of C++ that are important to learn for Computer Scientists, that are outside of the abilities of Java. Therefore, teach C++ to beginning Computer Scientists.
more time can be dedicated to learning what you can actually do with it. Which is presumably what people are there to learn anyway.
Java is more limited in what you can actually do with it than C/C++. Therefore, if you're going to pick one and only one language to Computer Science students, it should be C++, and not Java.
Again, again, again, let me restate that Java is fine, as a programming language. It has cool features that are more difficult to code in any widely available C++ platform. But, as a language for teaching beginning Computer Scientists, C++ is far better than Java.
You make excellent points, but you are sadly misinformed. If you replace every occurance of "Java" in your post with "C++", you are absolutely correct. 100%!
To quickly put the analogy in math terms : You are stating that all of mathematics should be taught in polar coordinates. They are far more useful than cartesian coordinates, because there are several circumstances where polar coordinates are vital!
If C++ had been taught in your program, from the very beginning then students could easily focus on learning the material that was taught, and explore the concepts, as opposed to fiddling with trendy single-task (ie INTERNET) languages. It would allow the students to develop, and the teachers to test on whatever system they are most comfortable with, because C/C++ is the most platform independent language in the world. You can run C++ on a Lego. You can run C++ on your car's Fuel Injection system. Java Applets crash in some browsers when you ask what version they are. Java servlets are far better behaved, granted. And the latest and greatest JVM is probably pretty darned good. But when people say "Java," I have to remind them that not all Java's are created equal. Granted, neither are all C++'s, but you don't get to use the argument that Java is MORE platform independent than C++. That's my point.
While some programs have different views, the one I attended, and my personal opinion as well, dictate that the objective of a Computer Science education is to teach you the theory behind the construction of a program to solve problems efficiently, as well as expose you to prior work by individuals in these areas.
You are absolutely correct. Some of those theories relate to data structures and algorithms that are impossible to implement in Java, but are easily done in C++. Take special note of the fact that William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling have not yet written a book entitled "Numerical Recipes In Java : The Art of Scientific Computing." (That book exists for C, Fortran, and Pascal - all traditional Computer Science programming languages.)
C++ has a larger available API than Java. By far. Java allows for rapid development of many programs in the eCommerce problem space. However, for coding 90% of your applications, C++ is just as good, or better, or far, far better than Java.
All that said, let me reiterate that JAVA IS FINE. It is awesome at some things that C++ sucks at. I use it daily, in my job. I seriously wish that Java Applets were more stable, so that more people could easily develop for them. Yay Java! But not for TEACHING BEGINNING PROGRAMMERS.
My code snippets show that I started in BASIC? How lovely. Obviously your remark was not intended to be inflamatory and was meant to "calm down" the conversation.
You sound like the type of person who would code a Penny object for a financial database. By providing a simple example of Java's inability to return multiple values in a method, I was making the point that it's harder to write certain methods within a class. (Quickly, any way! I remember when RAPID Application Development was desirable!) I agree with you that exposing functions like mine in the public area of your class is a bad idea. But there's NO GOOD REASON why I shouldn't be able to declare functions like that in the private area of my class. Encapsulation refers to the API - the interface to your class which is exposed to the outside world, the user, the coder. FORCING someone to encapsulate their data, within the methods of one class, is madness. If my file contains NAME and AGE, there's no good reason that I shouldn't be able to fetch that data, as a private method of my class. None. Forgive my silly example, pretend instead that I had listed the function as follows:
void MySQLFetchUserNameAndAge(unsigned int id, char **Name, unsigned int *Age);
And imagine that my database is designed to keep track of who can legally buy cigarettes or alcohol in a store on campus. Imagine that every student has a student id which is a non-negative number, which is magnetically stored on their student ID. The store wants to allow people to quickly scan their student ID to verify that their Driver's License is valid. Also, they'll get a student discount. Imagine that all of the data is stored in a central MySQL database. Now, I'm writing this function to encapsulate my call to the MySQL server, because the university is thinking of switching to Microsoft Access, despite my best warnings. Now, imagine I have two hours to write the whole thing. I would argue that it's better to encapsulate a private call which might have to be changed in the future, so that it's exposing as simple of an interface as possible to the rest of my class. Imagine that this is a method in the private area of my class, which will only be called by other methods in my class - which expose a brilliantly designed API to the rest of the universe. Now does my example demonstrate poor cohesion? You're telling me that it makes sense that Java says that I should have to use a Person object with accessor and mutator methods for all of its class-level variables? In the middle of my class? In an API that I'm not exposing to the outside world? The internal functioning of methods in my class shouldn't require encapsulation. And by the way, your way takes far, far longer to code. Again, this reminds me of the Penny object, in a financial application. It might be brilliant code, but making something an object doesn't magically grant it cohesion.
Universities teach Computer Science. They also teach Art History. It's pretty hard to get a job, as an Art History major. Heck, it's hard to get a job as an English major who graduated at the top of your class. A useful function of the Computer Science education is gaining experience in computer programming. As I mentioned, there are a handful of people in the world who do Computer Science for a living, without ever doing computer programming. I think it's essential that someone who is preparing to enter the work force have useful and marketable skills. Therefore, I think that chosing the language to teach Computer Science with, is an important decision. Specifically since almost everyone with a Computer Science degree ends up programming for a living. I think it is possible to teach Computer Science by teaching computer programming, and showing what it means. Computer programming is essentially the language of Computer Science. Computer programming would be the syntax and Computer Science would be the semantics, in my argument. I would agree that learning good programming practices, and what it all means - the Computer Science of it - is the most important part. But the language plays an important part in that! It would be like trying to teach English Literature to students who are forced to read and discuss it using only Spanish. I'm stretching my example, sure. I'm just trying to illustrate that the syntax plays a role, in learning the semantics.
You have at no time in your arguments demonstrated that Java is a better language to teach OO in a University than C++. You have merely asserted it, several times. This does not form an argument. An argument uses logic and examples to illustrate and defend someone's reasoned opinion.
If you have to fight memory management and pointers, then you don't have a good teacher. Memory management and pointers are easy concepts to grasp, if you discuss it in the right language (read : one that HAS memory management and pointers available for coding - i.e. NOT JAVA), and if you have a good Computer Science background, framework, teacher... You can't debate this point with me. Address and defeat this one single point of mine and I will be persuaded.
Beginning students, as you rightly call them, should be granted the opportunity to use the same tools as advanced students. You never make the case that BASIC should be the language of choice. Why not? It's BEGINNER's All-purpose Symbolic Instructional Code! The answer is obvious - it lacks constructs that are essential in any serious later programming. Java lacks constructs that are essential for C++ coding. List for me constructs that C++ lacks that are essential for Java coding.
Hey, thanks for pointing out the whole 1.2 to 1.1 thing! That helps! I hadn't had the time to research what had happened to me.
Again : you can win this debate if you can list constructs that C++ lacks that are essential for Java coding. Oh, I suppose for extra credit, you should have to assert and defend the position that people are more likely to end up having to write Java than C++. (They're not.) And it would be nice if you demonstrated that the first thing that beginning Computer Scientists should learn about is OO. (It isn't.) And you would crush me completely if you could demonstrate that pointers aren't necessary to learn about for a Computer Scientist. (They are.)
So, in order to have a method change a value that you pass to it, you have to encapsulate it in a class.
Oh, well, yeah. That's what true OO is all about.
This has been a recurring theme in people's responses to me, so I want to adress it. NO, IT'S NOT. Object Oriented encapsulation is about encapsulating the data in once class, so that ANOTHER class will not access that data! When I'm writing several methods in the SAME CLASS, there's no reason that the language should prevent me from changing a value in a method! That's certainly not what Object-Oriented programming is all about, "true OO" or not!
Java crashes more often than C++, with provably correct code. The Java environment is inherently more unstable, and prone to crashes. Assuming of course that you're talking about Applets.
You're telling me that, having done Java programming for the last five years along with C and C++, you can honestly say that Java APPLETS crash less often than C++? Have you EVER programmed a Java Applet? Oh, wait - and then tried to VIEW it using the browsers that people are using? Like, IE 5.5 on an IMac? Netscape 4.0 on a Win box? You obviously have no idea of what I'm talking about. The VM is unstable, since every crappy version that people are still using has bugs. The latest and greatest JVM for servlets is fine - I never said it wasn't. I was talking about Applets. And I was talking about Applets because people always say that Java is portable, and then they're arguing that Java should be taught as a first language for beginning computer programmers. A beginning computer programmer is likely to be shown Applets, as a matter of course - and that will be a disappointing experience. Applets are VERY hard to get to work correctly on all platforms. There are versions of the JVM in browsers that will CRASH if you ask them what version they are!
In truth, Java is one of the most stable platforms your can find today for development. You're quite obviously not talking about Applets, which was what I was mentioning, when you misquoted me.
Passing variables by reference. What I'm talking about is the fact that Java allows you to return either no values, or one value, from a function. There's no way to return multiple values from a function, unless you use a class. Repeat after me : Java lacks the ability for the coder to use pointers. I can't write this in Java :
void ModifyA(int *a) { *a = 1; }
And there's no good reason I shouldn't be able to. Specifically, for you to write this:
In Java, you would have to use either a Vector or a special-purpose class. That's insane. Keep in mind, I'm talking about TEACHING BEGINNING PROGRAMMERS, here. I could care less about it lacking that functionality, in my professional life. It has about zero impact on anything - and it's trivially easy to work around, in most cases. But you show that C++ code to a Java programmer, and they are LOST. Therefore, teach them C++, in the first place, NOT JAVA.
I can hardly believe your last two paragraphs were written by the same person! I agree with them, whole-heartedly. It sounds like you're saying that the way to teach beginning computer programmers is by showing them C, and then C++! That's my point!
Java is fine, and I happen to use it on a daily basis. But I recognize that it's not the best language to teach beginning computer programmers! The best language, in my opinion, for teaching beginning programmers, is C and then C++. You seem to finally agree with me, after misquoting me, and insulting me. Granted, I insulted you right back. But, remember the children!:)
Oh, Java APPLETS crash all of the time. And any college that'll try to teach computer programming is going to try to do it with applets, at least partially. And my point is that the JVM on any random browser is horrible. Very likely to crash.
The claim here, AFAICT, is that Java is a cleaner, better designed OO language than C++.
The claim here is that Java is a better language to teach beginning computer programmers. That claim is incorrect.
It's frequently possible to tell that people were C++ coders before becoming Java coders from the quality and style of their code.
It's frequently possible to tell that people were Java coders before becomming C++ coders from the memory leaks and from their inability to dynamically allocate objects correctly.
I don't know what you would point out as being particularly "C++" about someone's Java code. I honestly don't. I'd love to see some examples of the wrong (read C++) way to code something in Java, and then the right way. It's an entertaining notion to me, but I have as yet never seen an example.
If that's what people are being taught, then it's the quality of the teaching that is to blame, not the quality of the language. I agree. Most people argue to me that the Java language enforces good coding practices, and that's why it should be used to teach people. Laughable. You can write bad code in ANY language. I was trying to illustrate that one of the pitfalls of trying to code in C++ like one would code in Java is that there's code that's OUTSIDE of a class, and that's a weird concept to grasp.
By the way, you CAN'T write global variables in Java - everything is inside of a class! No wonder you'll never see a Java coder do it! Oh, unless they then try to write C++. What's an example of something that I, as a seasoned C++ coder, am likely to incorrectly do in Java?
The whole point of my argument is that Java is not a good language to teach beginning programmers. Every argument that I have heard about Java in favor of C++ as a TEACHING language, is illogical, incorrect, or just language-centric posturing. Java is a fine language for use in many situations. I use it myself, and it's not too bad. But I think that C and then C++ are the languages that should be used to teach beginning computer programmers. Specifically since MOST people will have to code in C or C++ at some point in their jobs, and it's (in my opinion) FAR easier to code Java, from an understanding of C++, than it is to code C++ from an initial understanding of Java.
Obviously you don't understand the language, because your "pass variables by reference" comment is completely inaccurate Haha. Very funny. Tell me how to write this in Java:
void ChangesA(int *a) { *a = 1; }
You can't. You have to pass an Integer, instead - or use a Class, such as Vector. That's what I mean by being able to "pass variables by reference," it means that I want the procedure to have the ability to change the data that you send it. Oh, and by the way, my definition of "pass variables by reference" works in almost any language, C, C++, and Pascal included. Your definition is a technicallity, based on the difference between dynamic classes and static classes. The fact that static classes are passed in Java by reference hardly makes it easier for me to change the value of an integer passed to a method.
Secondly, this is exactly the point of high(er) level languages. You're funny. It reminds me of the HIGHEST level language : TA. It's simple to use : as a professor, you enter your program source code into the computer via answering machine, shoddy sketches, a few simple words in the hallway, or by sending an email. The result : a few days later, a Teaching Assistant (sometimes the Research Assistant) has produced the desired output!
But seriously, Java does cool stuff. Unfortunately, most people won't end up using Java in their professional programming lives. Also, learning Java first has drawbacks : namely, it makes it harder to learn programming concepts that will be needed, when using other programming languages - like C and C++. Coincidentally, the language they are most likely to end up using IS C or C++. Therefore, in my opinion, teach them using C and C++, in the first place! Especially since it's then easy for them to switch to Java! I'm amused to see that Java advocates have a hard time admitting to its weaknesses, and contemplating the proposition that Java might not be perfect for every task - like, teaching someone how to program in C and C++!
Automatic Garbage Collection is a concept that can be applied to many differing programming languages and it is a detriment in none of them. When you have Garbage Collection - it's useful. I agree. But, if you've NEVER, EVER had to program memory management yourself, it will be VERY, VERY hard for you to learn how to. Since MOST people WILL have to code in C and C++, and WILL have to program memory management for themselves - I would argue that it's BETTER to show them how to do it right, in the first place. Especially since it's not that hard! It's a good programming practice that they should learn! It's just as easy to NEW and DELETE as it is to NEW!
Maybe you should study the term encapsulation. Wow - that's mature. I've been programming for 20 years, and I've been using standardized Object Oriented programming since before it even existed as a standard in C++. I also recognize that it's possible to write encapsulated code without the help of a compiler! When CLASSES communicate, it's valuable to encapsulate the data - in fact, it's about the most important programming practice to learn, in my opinion. But, when I want to write a function that will return TWO values instead of ONE value, I think it's nice that the C and C++ compiler knows how to support that. Whereas the Java compiler DOESN'T know how to do that. FOR NO GOOD REASON. You're telling me that a procedure with multiple return values is somehow NOT good Object Oriented practice? Are you insane? Somehow ZERO or ONE are the only crumulent possibilities? (To steal the word crumulent from The Simpsons.) TWO or MORE are evil?! What world do you live on?
people learn the wrong way to write OO code I don't think Freshmen in college, or worse, High School Students, should have to write OO code in their first computer programming class. I think that data structures and procedural programming should be taught first. Then you show them how useful objects are. Otherwise, you end up with people who start writing Financial software by writing
public class Penny
Object Oriented Programming is a TOOL, it's not a way of life. It should be used when appropriate! I happen to think it's not appropriate for integer and double, Java seems to think I'm wrong.
Java allows you to solve problems, C++ allows you to solve details. Allow me to respond with another generality : All generalities are incorrect.
You can write clean, beautiful code in almost any language. (I happen to think it's impossible in COBOL, but I never really tried.) I could write the same code in Pascal, Object Oriented Pascal, C, C++, or Java - I'm competent in all of them. It happens to be easier to solve some problems in some environments. I'm arguing that Java isn't good for teaching beginning computer programmers and Computer Scientists. SPECIFICALLY, because they're likely to have to use C and C++ at some point in their professional lives. I think we should TEACH them to be good programmers in C and C++. Then, they'll be good programmers in any environment, Java included! But if we have them use Java instead, my argument is that they'll miss out on such things as memory management, pointers, passing values by reference... And at the end of the day, they're likely to have to go and learn C and C++ and how to do all of that stuff, ANYWAY! Why not show them how to do it RIGHT in C++!? It's easier to learn it right the first time!
By the way, I learned in BASIC and Pascal - and I happen to think Object Oriented Pascal (read : Delphi) is the best language, ever. But I understand that SINCE people WILL have to use C and C++ and there's nothing WRONG with C and C++, we should use it to teach them! You CAN CODE WELL in C and C++, and it's NOT HARD! TEACH people how to do that, and they'll be able to tackle ANY problem in ANY language! But, if you never let them do memory management, or use pointers, you're massively crippling them!
Java allows you to solve problems, C++ allows you to solve details. As an employer, I know which one I'd want you to deal with. As an employee, I would think that you would want me to write good code, no matter what the programming environment. I would think that which programming environment I used would be important to you, only in the context of being able to maintain, support, and reuse the code that I write. Most employeers see C and C++ as the only way to go. I'd rather prepare most beginning programmers to be able to work most places!
You're absolutely right that applets and client-side Java in general have failed, but it's very heavily used in enterprise and back-end products that you don't see on the shelves at CompUSA.
In the domain of enterprise and back-end products, I agree that Java is very heavily used. I will argue that enterprise and back-end product development is done by a very small portion of the professional programmers in the world. Most people who program will not be doing that, therefore it is illogical to assert that Java is a better programming language to use to TEACH BEGINNING COMPUTER PROGRAMMERS, on the grounds that it's dominant in that market. Lisp is dominant in the AI field, but that doesn't mean you should use it to teach people how to be professional programmers.
Why are you passing values by reference?
void GetNameAndAge(char **Name, int *Age);
When I call it, I say:
GetNameAndAge(&Name, &Age);
The ampersands help me remember that the procedure will change the values. I'm passing a pointer (passing by reference) to the values that I want the function to find, and return.
I personally have the same complaint that you do, which is why I'm opposed to people passing by reference, by using the & in the declaration - leave that to the caller!
an introductory class would be much better served by discussing loops, methods, and basic algorithms I agree. You can do all of that in C just as easily as you can in Java. In my opinion, it's actually easier in C. And then, when you want to teach OOP, malloc/free/new/delete, you show them C++. And in the process, you're preparing them to be professional programmers, because they're learning the programming environment they're likely to end up using in their professional lives.
[I] have found Java to almost always be a better choice. Most computer programming is done in C and C++. It doesn't matter if you like the language better, I feel that it's more appropriate to teach someone to use the real tools they're likely to use in their professional lives. I personally like Object Oriented Pascal more than any other language. But I'm more realistic than you, apparently. Even though OOPascal is vastly superior to all other languages (tongue placed firmly in cheek), I recognize that C and C++ are by far the most widely used languages, and are far more appropriate to use, when teaching people how to be professional programmers.
Again, that's client side. When people talk about how cross-platform Java is, they're going to bring up Applets. My argument is that Applets don't work. Well, actually, they do - but it's enormously painful to get them to work right. The consumer loves it, but for the developer, it's a nightmare. You seem to agree with me on this point.
I actually had to change some of my code, when switching Java Servlets from platform to platform - Vector.add doesn't work in Tomcat, apparently... It's Vector.addElement.
And back to my point, even though writing servlets cross-platform is great fun, most people will not do that for a living! So, give them the tools that are appropriate for their upcoming jobs! C and C++! PS, if they learn C and C++, it's easy for them to learn Java! But, if they learn Java (and only Java), then by your argument that "C++ is much more complex and difficult" it will be NIGHTMARISH for them to switch to C++! How can you not agree with me on this point?!
Java is nowhere near as bad as you think it is. I use it professionally, it has many uses, and it's not a bad language. But it's not so much better than C++ that we should start using Java to teach Computer Science and computer programming! That's my only point!
[Java] is a real language capable of doing real work, in many cases much more quickly and reliably than would be possible in C++. I must have been horribly unclear in my post... I AGREE WITH YOU that Java is useful. BUT IT SHOULDN'T BE USED TO TEACH BEGINNING PROGRAMMERS! Use C and C++ to teach, and then, hey - give them a class on Java, if they're curious! Don't administer the Advanced Placement test in Java! That's INSANE! Don't teach Freshmen how to make applets! Or SERVLETS!? Are you nuts! Teach them C and C++, and then it's easy for them to learn that other stuff, later!
There was no car bomb explosion outside the State Department - that is being denied.
I'm pretty sure he meant, "a MiniDisc and completely ignore the compression artifacts."
http://www.techfak.uni-kiel.de/matwis/amat/def_en/ articles/key_role_impurities/the_key_role_in_damas cus_steel_blades.html
http://www.orangesmoothie.org/downloads/beta/osp-q uake3-0.99v3.zip
by unzipping it in your Q3 directory, with file paths preserved. Then, install
ftp://ftp.idsoftware.com/idstuff/quake3/win32/q3po intrelease_129h_beta.exe
by running the executable and telling it where your Q3 directory is. Then, if you want to view the demos really easily, install
http://www.geekboys.org/geekplay-29/index.pl?downl oad=http://www.geekboys.org/geekplay-29/download/g eekplay-29-1.0b1.zip
by running the installer from any directory and telling it where your Q3 directory is.
Then, all you have to do is download the "demo" files from
http://stats1.zone.com/tournaments/QuakeCon-2001/s coreboard_0_0.html
By clicking on the "stats:1" link, and then scroll down, and download one of the demo files, like the file
http://stats1.zone.com/tournaments/QuakeCon-2001/d emos/fatal1ty-vs-ZeRo4-pro-q3tourney4-(ZeRo4)-g1v2 _1.dm_66.zip
for instance. Be sure to note that there are two files for every match - one from each person's point of view. Getting the file from the winner is more fun! Then, all you have to do is unzip the dm_66 file, and then double-click the dm_66 file in order to view it.
Note that these instructions worked for me, and are not necessarily going to work for you! All of this of course on a Win box.
Thanks! That worked great - after I installed the latest point release...
fatal1ty-vs-ZeRo4-pro-q3tourney4-(fatal1ty)-g1v2_1 .dm_66.zip
I installed osp-quake3-0.99v3.zip already, and I appear to be running that mod okay, but I can't figure out what the heck I have to do with the dm_66 file in order to view it!
Brian Griffin : Peter, those are Cheerios.
Thanks - having the last word is kind of fun.
You might consider getting some help for that persecution complex.
If this is a back-handed apology, I accept. If it's merely another insult, you might want to consider taking some agression management classes. I think it's somewhat childish of you to move an argument of fact into a namecalling bout, suggesting that I don't live in the real world, don't know how to use the English language, and now that I need therapy, and have a "widdle head."
Semantic debates are sometimes enthralling, because you can twist words to make facts lie - but they don't really further understanding. Your definitions of "program" and "call" are well stated, and I believe I understand them, but I don't believe that they reall help you.
Word can call Excel to do spreadsheets, but that doesn't make it a spreadsheet program. PRman can call BMRT to do raytracing, but that doesn't make it a raytracing program. Eudora can call PGP to do encryption, but that doesn't make it an encryption program. The JVM can call methods in a class file to give you the long-distance phone calling capabilities in DialPad, but that doesn't make the JVM a long-distance phone calling program. Quake III : Team Arena can call jpeg library functions to load jpeg images, but that doesn't make it a jpeg image loading program. Internet Explorer can call Hotmail to send email, but that doesn't make Internet Explorer an email program. PRMan can call the shader language to do shading, but that doesn't make it a shading program.
Utility is an interesting thing. I can use a butter knife to turn screws, and I will agree with you that my ability to use a butter knife in that manner doesn't somehow turn it into a "screwdriver," in the traditional sense. But, if your definition of a screwdriver is merely that it is an implement with which one may turn a screw, it becomes a pretty hazy line. If you ask me for a screwdriver, and I hand you a butter knife, I'll laugh at myself, right along with you. It's silly, it's not what you asked for, but it'll do the job. You have to agree that if a demolitions expert is trying to defuse a nuclear bomb without his tools, the clock says 26 seconds, and he asks me for a screwdriver, if I hand him a butter knife - I've saved the day!
Most effects houses have a hard time staying in the black, and most use PRMan. If an effects house is down to the wire, and their client demands that a certain effect needs to look more real, and the only way to pull it off is by having PRMan call BMRT to do raytracing, they'd rather use my definitions of "program" and "call" than yours.
I love your last paragraph - I think you should use it, then next time you're on Jerry Springer.
After executing your commands, I am left with the following statement from you :
prman can't do radiosity via an SL trace without BMRT.
Now, I will apply the English language suggestion for good writing, "Don't never use double negatives," after which, your statement becomes :
prman can do radiosity via an SL trace with BMRT.
This is shockingly like my original statment :
PRMAN CAN RAYTRACE USING BMRT AS A TRACER.
And I guess I agree with myself. So, then I can only laugh, when I read your insulting statement :
If you still think that's prman doing raytracing then I suggest you take a remedial english class.
Because I just proved that you "think that's prman doing raytracing"! So, why exactly did you need to insult me twice in your post, in order to agree with me?
If I'm in Word, and I add an Excel spreadsheet to it - and then I print it - is that Word printing a spreadsheet? By my definition, yes - by your definition, no.
By my definition, Word can use Excel as a spreadsheet renderer. By your definition, apparently, just because Excel is not built in to Word, it means that Word is incapable of printing spreadsheets.
They're telling me, "There's no way for Word to print a spreadsheet," and I'm saying they're wrong. You're also saying I'm wrong. But I'm not, I'm right - and the page I pointed to shows how it can be done. It's not easy, and there are problems, but it can be done. The actual facts are on my side.
Your definition might be more technically correct (since "we don't say that program 1 is performing the specific task"), but mine is certainly more useful. Since my point was that program 1 is able to perform a specific task, by commincating with another program. Many programs are incapable of communicating with other programs in such a manner, and that makes PRMan pretty cool, in my book.
By the way, it's "English," not "english."
BMRT Raytracing Howto
You can hook up PRMan and BMRT together, using BMRT to do the trace() calls. This is in fact a semi-supported function that Pixar gives to people. When you get PRMan, they'll happily give you BMRT, as well. Many things Pixar does use BMRT. BMRT is good. Don't diss BMRT. When people use PRMan, BMRT is a natural thing to include in many cases!
BMRT Raytracing Howto
You people are amazing. You don't even bother to look at my link, and you tell me I'm wrong.
What's so frightening about terminating a program?
You are wrong. The shader language can raytrace.
Using BMRT together with PRMan, it can ray trace, and many people use it. Like in Hollow Man, for instance.
Here is a gallery, which includes Hollow Man. The call looks like this :
color trace (point from, vector dir)
Traces a ray from position from in the direction of vector dir. The return value is the incoming light from that direction.
Source
At 30 frames per second, that's roughly 44x44 pixels.
At 10 frames per second, that's roughly 77x77 pixels.
At 1 frame per second, that's still only 244x244 pixels.
Keep in mind that all pixels are transparent or red only.
You won't be playing Quake on this thing, any time soon.
Yes, several methods in the same class should pass variables, and they should often be allowed to return more than one value. That way you can write atomic code that is easily used for multiple purposes. You encapsulate the functionality into building blocks that can be used, in many different circumstances. This is a fundamental concept of structured programming.
Using member variables to do all of the communication within a class is akin to using nothing but global variables in a normal program. You can't write re-entrant code, recursive code, or methods that call methods that call methods... You end up with a morass of code that's impossible to maintain. At least, when you're coding a class with any significant size.
C recognizes that often, it's convenient to have one function return more than one value. This is accomplished through explicitly passing by reference - allowing the called method to change the value pointed to, so that the caller can then access that data. In Java, the only way to do that is to use a class - like Vector, or a special-purpose class.
That slows down coding, and doesn't in any way lead to better code, or better OO design. It's merely a hoop that you as the programmer have to jump through.
Back to the whole point of this discussion : most programmers will have to use C and C++ in their professional lives. Java lacks functionality that C and C++ have. Teach beginning Computer Science students in C and C++.
By your extended argument, BASIC sounds ideal as an introductory language. After all, things getting more complex and difficult is how courses are supposed to go right? The point can be carried out, ad absurdum. But, going in the opposite direction, C++ can do just about anything, whereas Java can't. And also, C++ is far my widely used, and excepted. If you're going to pick one over the other for teaching beginning Computer Science students, pick C++.
As a student in High School, I learned about binary trees. They were on the AP CS exam, when I took it. I presume they will still be on the AP CS exam, but now in Java? That's nuts. My point is that, if you're going to pick ONE LANGUAGE to teach beginning Computer Scientists, it should be C/C++, not Java.
Huffman and ZIP are different. I did code a Huffman compressor in my Computer Science courses, and we did it in C. Doing the same thing in Java would be nightmarish. Unless you cheated, and used the Java class libraries to take care of the hard stuff! That's my point - they should be able to do it from scratch. Otherwise, why make them do it at all?
So, all of the things you're proposing to teach them, I can teach them in C++. Easily. But you can't easily teach them memory management, pointers, many data structures, operating systems, and a lot of fundamental Networking. And I can even teach them to code a real Operating System, a real Database, a real First-Person Shooter video game, and device drivers. These are valuable things to be able to teach!
Java is great. But C++ is better, if you're only going to choose ONE language to teach beginning Computer Scientists.
or more accurately whether it's a good language to teach them
You are incorrect. If the AP Computer Science exam is going to be given in Java, then Java is the only language that will be taught, in most High Schools' Computer Science courses. Java is a good language to teach them, but it most definately shouldn't be the only language. If you're going to pick one, and only one language to teach someone Computer Science, that language should be C++.
I stand corrected : there is a way to make global variables in Java. (Except they're still defined INSIDE of a class, which was my point, in the first place. If you never make an instance of the class Globals, then those variables are not accessable.)
One of those recurring features you see in bad C++ code where people are trying to write Java in C++ is a new, but no delete. Which is the more grave mistake?
To step back a little bit from your argument, it's easier to learn to code in BASIC than it is to code in Java or C++. But that's not a good argument for using BASIC over Java or C++ in my book : BASIC is lacking fundamental constructs necessary for a serious Computer Science education. And so is Java.
When people propose that Java should be the one and only language taught to Computer Scientists, I wonder if they remember the courses that they took :
DATA STRUCTURES : Linked lists. Binary trees. Hash tables. Red-black trees. All of these are far easier to code in C and C++ than they are to code in Java. Because C and C++ have pointers, that you as the programmer can control. Java provides a lot of this in convenient API form, but the back-end in Java, is C and C++ code. So, Java is FINE as a programming language, but it fails as a teaching language.
OPERATING SYSTEMS - You might be able to put together a tinkertoy OS in Java, but that's about it. Every real OS in the world was written in C and C++, or assembley, or flat-out machine code. I'd argue that it would be nice to be able to actually code portions of a real OS in your OS class - C / C++ is the clear answer. Java fails miserably.
NETWORKING - You're not going to code a TCP/IP stack in Java. Java certainly doesn't - they expose a Java API to C code. Not that I'm necessarily arguing that you need to code a TCP/IP stack in a college Networking course. But when I was in college, we studied packet spoofing, building connection-based protocols on top of UDP, error detection and correction codes. All of that is easy in C/C++, and you can understand why it might need to be done. It's completely fake in Java - it's like trying to write a hard-drive controller in Microsoft Excell's Visual Basic for Applications. You PROBABLY could, but it really doesn't make any sense to.
DATABASES - in any good database class, you're going to talk about how a database actually works, not just how to use one. No real database system would ever be coded in Java. You'd ACCESS one from Java, sure - but why port MySQL to Java?
Java has a subset of the programming constructs that C++ has. There are portions of C++ that are important to learn for Computer Scientists, that are outside of the abilities of Java. Therefore, teach C++ to beginning Computer Scientists.
more time can be dedicated to learning what you can actually do with it. Which is presumably what people are there to learn anyway.
Java is more limited in what you can actually do with it than C/C++. Therefore, if you're going to pick one and only one language to Computer Science students, it should be C++, and not Java.
Again, again, again, let me restate that Java is fine, as a programming language. It has cool features that are more difficult to code in any widely available C++ platform. But, as a language for teaching beginning Computer Scientists, C++ is far better than Java.
To quickly put the analogy in math terms : You are stating that all of mathematics should be taught in polar coordinates. They are far more useful than cartesian coordinates, because there are several circumstances where polar coordinates are vital!
If C++ had been taught in your program, from the very beginning then students could easily focus on learning the material that was taught, and explore the concepts, as opposed to fiddling with trendy single-task (ie INTERNET) languages. It would allow the students to develop, and the teachers to test on whatever system they are most comfortable with, because C/C++ is the most platform independent language in the world. You can run C++ on a Lego. You can run C++ on your car's Fuel Injection system. Java Applets crash in some browsers when you ask what version they are. Java servlets are far better behaved, granted. And the latest and greatest JVM is probably pretty darned good. But when people say "Java," I have to remind them that not all Java's are created equal. Granted, neither are all C++'s, but you don't get to use the argument that Java is MORE platform independent than C++. That's my point.
While some programs have different views, the one I attended, and my personal opinion as well, dictate that the objective of a Computer Science education is to teach you the theory behind the construction of a program to solve problems efficiently, as well as expose you to prior work by individuals in these areas.
You are absolutely correct. Some of those theories relate to data structures and algorithms that are impossible to implement in Java, but are easily done in C++. Take special note of the fact that William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling have not yet written a book entitled "Numerical Recipes In Java : The Art of Scientific Computing." (That book exists for C, Fortran, and Pascal - all traditional Computer Science programming languages.)
C++ has a larger available API than Java. By far. Java allows for rapid development of many programs in the eCommerce problem space. However, for coding 90% of your applications, C++ is just as good, or better, or far, far better than Java.
All that said, let me reiterate that JAVA IS FINE. It is awesome at some things that C++ sucks at. I use it daily, in my job. I seriously wish that Java Applets were more stable, so that more people could easily develop for them. Yay Java! But not for TEACHING BEGINNING PROGRAMMERS.
You sound like the type of person who would code a Penny object for a financial database. By providing a simple example of Java's inability to return multiple values in a method, I was making the point that it's harder to write certain methods within a class. (Quickly, any way! I remember when RAPID Application Development was desirable!) I agree with you that exposing functions like mine in the public area of your class is a bad idea. But there's NO GOOD REASON why I shouldn't be able to declare functions like that in the private area of my class. Encapsulation refers to the API - the interface to your class which is exposed to the outside world, the user, the coder. FORCING someone to encapsulate their data, within the methods of one class, is madness. If my file contains NAME and AGE, there's no good reason that I shouldn't be able to fetch that data, as a private method of my class. None. Forgive my silly example, pretend instead that I had listed the function as follows :
void MySQLFetchUserNameAndAge(unsigned int id, char **Name, unsigned int *Age);
And imagine that my database is designed to keep track of who can legally buy cigarettes or alcohol in a store on campus. Imagine that every student has a student id which is a non-negative number, which is magnetically stored on their student ID. The store wants to allow people to quickly scan their student ID to verify that their Driver's License is valid. Also, they'll get a student discount. Imagine that all of the data is stored in a central MySQL database. Now, I'm writing this function to encapsulate my call to the MySQL server, because the university is thinking of switching to Microsoft Access, despite my best warnings. Now, imagine I have two hours to write the whole thing. I would argue that it's better to encapsulate a private call which might have to be changed in the future, so that it's exposing as simple of an interface as possible to the rest of my class. Imagine that this is a method in the private area of my class, which will only be called by other methods in my class - which expose a brilliantly designed API to the rest of the universe. Now does my example demonstrate poor cohesion? You're telling me that it makes sense that Java says that I should have to use a Person object with accessor and mutator methods for all of its class-level variables? In the middle of my class? In an API that I'm not exposing to the outside world? The internal functioning of methods in my class shouldn't require encapsulation. And by the way, your way takes far, far longer to code. Again, this reminds me of the Penny object, in a financial application. It might be brilliant code, but making something an object doesn't magically grant it cohesion.
Universities teach Computer Science. They also teach Art History. It's pretty hard to get a job, as an Art History major. Heck, it's hard to get a job as an English major who graduated at the top of your class. A useful function of the Computer Science education is gaining experience in computer programming. As I mentioned, there are a handful of people in the world who do Computer Science for a living, without ever doing computer programming. I think it's essential that someone who is preparing to enter the work force have useful and marketable skills. Therefore, I think that chosing the language to teach Computer Science with, is an important decision. Specifically since almost everyone with a Computer Science degree ends up programming for a living. I think it is possible to teach Computer Science by teaching computer programming, and showing what it means. Computer programming is essentially the language of Computer Science. Computer programming would be the syntax and Computer Science would be the semantics, in my argument. I would agree that learning good programming practices, and what it all means - the Computer Science of it - is the most important part. But the language plays an important part in that! It would be like trying to teach English Literature to students who are forced to read and discuss it using only Spanish. I'm stretching my example, sure. I'm just trying to illustrate that the syntax plays a role, in learning the semantics.
You have at no time in your arguments demonstrated that Java is a better language to teach OO in a University than C++. You have merely asserted it, several times. This does not form an argument. An argument uses logic and examples to illustrate and defend someone's reasoned opinion.
If you have to fight memory management and pointers, then you don't have a good teacher. Memory management and pointers are easy concepts to grasp, if you discuss it in the right language (read : one that HAS memory management and pointers available for coding - i.e. NOT JAVA), and if you have a good Computer Science background, framework, teacher... You can't debate this point with me. Address and defeat this one single point of mine and I will be persuaded.
Beginning students, as you rightly call them, should be granted the opportunity to use the same tools as advanced students. You never make the case that BASIC should be the language of choice. Why not? It's BEGINNER's All-purpose Symbolic Instructional Code! The answer is obvious - it lacks constructs that are essential in any serious later programming. Java lacks constructs that are essential for C++ coding. List for me constructs that C++ lacks that are essential for Java coding.
Hey, thanks for pointing out the whole 1.2 to 1.1 thing! That helps! I hadn't had the time to research what had happened to me.
Again : you can win this debate if you can list constructs that C++ lacks that are essential for Java coding. Oh, I suppose for extra credit, you should have to assert and defend the position that people are more likely to end up having to write Java than C++. (They're not.) And it would be nice if you demonstrated that the first thing that beginning Computer Scientists should learn about is OO. (It isn't.) And you would crush me completely if you could demonstrate that pointers aren't necessary to learn about for a Computer Scientist. (They are.)
And do it all while remaining calm.
Oh, well, yeah. That's what true OO is all about.
This has been a recurring theme in people's responses to me, so I want to adress it. NO, IT'S NOT. Object Oriented encapsulation is about encapsulating the data in once class, so that ANOTHER class will not access that data! When I'm writing several methods in the SAME CLASS, there's no reason that the language should prevent me from changing a value in a method! That's certainly not what Object-Oriented programming is all about, "true OO" or not!
You're telling me that, having done Java programming for the last five years along with C and C++, you can honestly say that Java APPLETS crash less often than C++? Have you EVER programmed a Java Applet? Oh, wait - and then tried to VIEW it using the browsers that people are using? Like, IE 5.5 on an IMac? Netscape 4.0 on a Win box? You obviously have no idea of what I'm talking about. The VM is unstable, since every crappy version that people are still using has bugs. The latest and greatest JVM for servlets is fine - I never said it wasn't. I was talking about Applets. And I was talking about Applets because people always say that Java is portable, and then they're arguing that Java should be taught as a first language for beginning computer programmers. A beginning computer programmer is likely to be shown Applets, as a matter of course - and that will be a disappointing experience. Applets are VERY hard to get to work correctly on all platforms. There are versions of the JVM in browsers that will CRASH if you ask them what version they are!
In truth, Java is one of the most stable platforms your can find today for development. You're quite obviously not talking about Applets, which was what I was mentioning, when you misquoted me.
Passing variables by reference. What I'm talking about is the fact that Java allows you to return either no values, or one value, from a function. There's no way to return multiple values from a function, unless you use a class. Repeat after me : Java lacks the ability for the coder to use pointers. I can't write this in Java :
void ModifyA(int *a) { *a = 1; }
And there's no good reason I shouldn't be able to. Specifically, for you to write this :
void ModifyAAndB(int *a, int *b) { *a = 1; *b = 2; }
In Java, you would have to use either a Vector or a special-purpose class. That's insane. Keep in mind, I'm talking about TEACHING BEGINNING PROGRAMMERS, here. I could care less about it lacking that functionality, in my professional life. It has about zero impact on anything - and it's trivially easy to work around, in most cases. But you show that C++ code to a Java programmer, and they are LOST. Therefore, teach them C++, in the first place, NOT JAVA.
I can hardly believe your last two paragraphs were written by the same person! I agree with them, whole-heartedly. It sounds like you're saying that the way to teach beginning computer programmers is by showing them C, and then C++! That's my point!
Java is fine, and I happen to use it on a daily basis. But I recognize that it's not the best language to teach beginning computer programmers! The best language, in my opinion, for teaching beginning programmers, is C and then C++. You seem to finally agree with me, after misquoting me, and insulting me. Granted, I insulted you right back. But, remember the children! :)
The claim here, AFAICT, is that Java is a cleaner, better designed OO language than C++.
The claim here is that Java is a better language to teach beginning computer programmers. That claim is incorrect.
It's frequently possible to tell that people were C++ coders before becoming Java coders from the quality and style of their code.
It's frequently possible to tell that people were Java coders before becomming C++ coders from the memory leaks and from their inability to dynamically allocate objects correctly.
I don't know what you would point out as being particularly "C++" about someone's Java code. I honestly don't. I'd love to see some examples of the wrong (read C++) way to code something in Java, and then the right way. It's an entertaining notion to me, but I have as yet never seen an example.
If that's what people are being taught, then it's the quality of the teaching that is to blame, not the quality of the language. I agree. Most people argue to me that the Java language enforces good coding practices, and that's why it should be used to teach people. Laughable. You can write bad code in ANY language. I was trying to illustrate that one of the pitfalls of trying to code in C++ like one would code in Java is that there's code that's OUTSIDE of a class, and that's a weird concept to grasp.
By the way, you CAN'T write global variables in Java - everything is inside of a class! No wonder you'll never see a Java coder do it! Oh, unless they then try to write C++. What's an example of something that I, as a seasoned C++ coder, am likely to incorrectly do in Java?
The whole point of my argument is that Java is not a good language to teach beginning programmers. Every argument that I have heard about Java in favor of C++ as a TEACHING language, is illogical, incorrect, or just language-centric posturing. Java is a fine language for use in many situations. I use it myself, and it's not too bad. But I think that C and then C++ are the languages that should be used to teach beginning computer programmers. Specifically since MOST people will have to code in C or C++ at some point in their jobs, and it's (in my opinion) FAR easier to code Java, from an understanding of C++, than it is to code C++ from an initial understanding of Java.
void ChangesA(int *a) { *a = 1; }
You can't. You have to pass an Integer, instead - or use a Class, such as Vector. That's what I mean by being able to "pass variables by reference," it means that I want the procedure to have the ability to change the data that you send it. Oh, and by the way, my definition of "pass variables by reference" works in almost any language, C, C++, and Pascal included. Your definition is a technicallity, based on the difference between dynamic classes and static classes. The fact that static classes are passed in Java by reference hardly makes it easier for me to change the value of an integer passed to a method.
Secondly, this is exactly the point of high(er) level languages. You're funny. It reminds me of the HIGHEST level language : TA. It's simple to use : as a professor, you enter your program source code into the computer via answering machine, shoddy sketches, a few simple words in the hallway, or by sending an email. The result : a few days later, a Teaching Assistant (sometimes the Research Assistant) has produced the desired output!
But seriously, Java does cool stuff. Unfortunately, most people won't end up using Java in their professional programming lives. Also, learning Java first has drawbacks : namely, it makes it harder to learn programming concepts that will be needed, when using other programming languages - like C and C++. Coincidentally, the language they are most likely to end up using IS C or C++. Therefore, in my opinion, teach them using C and C++, in the first place! Especially since it's then easy for them to switch to Java! I'm amused to see that Java advocates have a hard time admitting to its weaknesses, and contemplating the proposition that Java might not be perfect for every task - like, teaching someone how to program in C and C++!
Automatic Garbage Collection is a concept that can be applied to many differing programming languages and it is a detriment in none of them. When you have Garbage Collection - it's useful. I agree. But, if you've NEVER, EVER had to program memory management yourself, it will be VERY, VERY hard for you to learn how to. Since MOST people WILL have to code in C and C++, and WILL have to program memory management for themselves - I would argue that it's BETTER to show them how to do it right, in the first place. Especially since it's not that hard! It's a good programming practice that they should learn! It's just as easy to NEW and DELETE as it is to NEW!
Maybe you should study the term encapsulation. Wow - that's mature. I've been programming for 20 years, and I've been using standardized Object Oriented programming since before it even existed as a standard in C++. I also recognize that it's possible to write encapsulated code without the help of a compiler! When CLASSES communicate, it's valuable to encapsulate the data - in fact, it's about the most important programming practice to learn, in my opinion. But, when I want to write a function that will return TWO values instead of ONE value, I think it's nice that the C and C++ compiler knows how to support that. Whereas the Java compiler DOESN'T know how to do that. FOR NO GOOD REASON. You're telling me that a procedure with multiple return values is somehow NOT good Object Oriented practice? Are you insane? Somehow ZERO or ONE are the only crumulent possibilities? (To steal the word crumulent from The Simpsons.) TWO or MORE are evil?! What world do you live on?
people learn the wrong way to write OO code I don't think Freshmen in college, or worse, High School Students, should have to write OO code in their first computer programming class. I think that data structures and procedural programming should be taught first. Then you show them how useful objects are. Otherwise, you end up with people who start writing Financial software by writing
public class Penny
Object Oriented Programming is a TOOL, it's not a way of life. It should be used when appropriate! I happen to think it's not appropriate for integer and double, Java seems to think I'm wrong.
Java allows you to solve problems, C++ allows you to solve details. Allow me to respond with another generality : All generalities are incorrect.
You can write clean, beautiful code in almost any language. (I happen to think it's impossible in COBOL, but I never really tried.) I could write the same code in Pascal, Object Oriented Pascal, C, C++, or Java - I'm competent in all of them. It happens to be easier to solve some problems in some environments. I'm arguing that Java isn't good for teaching beginning computer programmers and Computer Scientists. SPECIFICALLY, because they're likely to have to use C and C++ at some point in their professional lives. I think we should TEACH them to be good programmers in C and C++. Then, they'll be good programmers in any environment, Java included! But if we have them use Java instead, my argument is that they'll miss out on such things as memory management, pointers, passing values by reference... And at the end of the day, they're likely to have to go and learn C and C++ and how to do all of that stuff, ANYWAY! Why not show them how to do it RIGHT in C++!? It's easier to learn it right the first time!
By the way, I learned in BASIC and Pascal - and I happen to think Object Oriented Pascal (read : Delphi) is the best language, ever. But I understand that SINCE people WILL have to use C and C++ and there's nothing WRONG with C and C++, we should use it to teach them! You CAN CODE WELL in C and C++, and it's NOT HARD! TEACH people how to do that, and they'll be able to tackle ANY problem in ANY language! But, if you never let them do memory management, or use pointers, you're massively crippling them!
Java allows you to solve problems, C++ allows you to solve details. As an employer, I know which one I'd want you to deal with. As an employee, I would think that you would want me to write good code, no matter what the programming environment. I would think that which programming environment I used would be important to you, only in the context of being able to maintain, support, and reuse the code that I write. Most employeers see C and C++ as the only way to go. I'd rather prepare most beginning programmers to be able to work most places!
In the domain of enterprise and back-end products, I agree that Java is very heavily used. I will argue that enterprise and back-end product development is done by a very small portion of the professional programmers in the world. Most people who program will not be doing that, therefore it is illogical to assert that Java is a better programming language to use to TEACH BEGINNING COMPUTER PROGRAMMERS, on the grounds that it's dominant in that market. Lisp is dominant in the AI field, but that doesn't mean you should use it to teach people how to be professional programmers.
Why are you passing values by reference?
void GetNameAndAge(char **Name, int *Age);
When I call it, I say :
GetNameAndAge(&Name, &Age);
The ampersands help me remember that the procedure will change the values. I'm passing a pointer (passing by reference) to the values that I want the function to find, and return.
I personally have the same complaint that you do, which is why I'm opposed to people passing by reference, by using the & in the declaration - leave that to the caller!
an introductory class would be much better served by discussing loops, methods, and basic algorithms I agree. You can do all of that in C just as easily as you can in Java. In my opinion, it's actually easier in C. And then, when you want to teach OOP, malloc/free/new/delete, you show them C++. And in the process, you're preparing them to be professional programmers, because they're learning the programming environment they're likely to end up using in their professional lives.
[I] have found Java to almost always be a better choice. Most computer programming is done in C and C++. It doesn't matter if you like the language better, I feel that it's more appropriate to teach someone to use the real tools they're likely to use in their professional lives. I personally like Object Oriented Pascal more than any other language. But I'm more realistic than you, apparently. Even though OOPascal is vastly superior to all other languages (tongue placed firmly in cheek), I recognize that C and C++ are by far the most widely used languages, and are far more appropriate to use, when teaching people how to be professional programmers.
Again, that's client side. When people talk about how cross-platform Java is, they're going to bring up Applets. My argument is that Applets don't work. Well, actually, they do - but it's enormously painful to get them to work right. The consumer loves it, but for the developer, it's a nightmare. You seem to agree with me on this point.
I actually had to change some of my code, when switching Java Servlets from platform to platform - Vector.add doesn't work in Tomcat, apparently... It's Vector.addElement.
And back to my point, even though writing servlets cross-platform is great fun, most people will not do that for a living! So, give them the tools that are appropriate for their upcoming jobs! C and C++! PS, if they learn C and C++, it's easy for them to learn Java! But, if they learn Java (and only Java), then by your argument that "C++ is much more complex and difficult" it will be NIGHTMARISH for them to switch to C++! How can you not agree with me on this point?!
Java is nowhere near as bad as you think it is. I use it professionally, it has many uses, and it's not a bad language. But it's not so much better than C++ that we should start using Java to teach Computer Science and computer programming! That's my only point!
[Java] is a real language capable of doing real work, in many cases much more quickly and reliably than would be possible in C++. I must have been horribly unclear in my post... I AGREE WITH YOU that Java is useful. BUT IT SHOULDN'T BE USED TO TEACH BEGINNING PROGRAMMERS! Use C and C++ to teach, and then, hey - give them a class on Java, if they're curious! Don't administer the Advanced Placement test in Java! That's INSANE! Don't teach Freshmen how to make applets! Or SERVLETS!? Are you nuts! Teach them C and C++, and then it's easy for them to learn that other stuff, later!