Teen Programmers Unite  
 

 

Return to forum top

Whats after C++

Posted by MrSmiley [send private reply] at May 04, 2003, 01:04:56 AM

Ok ive been working with C/C++ for a while, i know im turely not ready to go onto the next step but i wanted to know just in case. (if javas next then post the step after java).

Posted by CodeRed [send private reply] at May 04, 2003, 04:12:57 AM

Ummm... C++ and java are the two major ones. What you need to learn are the advanced concepts of programming. For example: Recursion, inheritance and polymorphism, linked lists, all the different types of trees and every way to implement/use them, pointers, stacks, queues, and all those fun data structures. Also, learning a few API's will come in handy. Learn to write win32 apps, OGL, D3D, and anything else you are interested in.

Posted by Psion [send private reply] at May 04, 2003, 12:39:29 PM

There is no natual order of programming language learning. Many people, myself included, think no one should bother to learn C++, since it's such a low quality language. I would recommend learning any functional language if you feel the urge to move to something else.

Posted by diegoeskryptic [send private reply] at May 04, 2003, 12:45:20 PM

@posion how is it low quality?

Posted by ItinitI [send private reply] at May 04, 2003, 02:31:24 PM

One could argue that English is low quality yet it's what is used.

Posted by Mike_L [send private reply] at May 04, 2003, 04:02:01 PM

MrSmiley, I recommend that you try Scheme. There's an excellent book available online that comes with software: http://www.htpd.org/

Posted by ArcticWind [send private reply] at May 05, 2003, 08:09:53 AM

I dont think theres anything wrong with C++, I prefer it over Java

Posted by regretfuldaydreamer [send private reply] at May 05, 2003, 09:24:07 AM

Java is nicer synataxically, but C++ is faster and can be easier to do certain things. C++ isn't bad, but of course there is a possibility better languages exist.

Posted by Psion [send private reply] at May 05, 2003, 03:42:19 PM

You people make me trot out the same URL over and over.

http://www.schizomaniac.net/ml.html

C++ is bad precisely because languages like ML are so much better that you waste your time significantly by using it.

Posted by diegoeskryptic [send private reply] at May 05, 2003, 06:44:54 PM

It seems like some people are biased against C++. If i were you I would just try Java.

Posted by ItinitI [send private reply] at May 05, 2003, 11:28:46 PM

Well, I can somewhat see Psion's point about SML, it very well may/is be superior language to C++. It just doesnt to seem to have hit main stream use as of yet like C++ is in use.

Posted by ArcticWind [send private reply] at May 06, 2003, 05:17:15 AM

Some ML examples I've seen remind me of forth, anyway somethings in ML can be done with templates in C++

Posted by CodeRed [send private reply] at May 06, 2003, 05:31:13 AM

Try getting a good job without knowing C++....

Posted by Psion [send private reply] at May 06, 2003, 08:53:13 AM

I already have one, and it also has a requirement of general mathematical ability, which leaves out most C++ programers.

Posted by ItinitI [send private reply] at May 06, 2003, 09:24:08 AM

LOL.
So, what exactly do you do in your job?

Posted by Psion [send private reply] at May 06, 2003, 05:42:00 PM

Create research software in ML....

Posted by ItinitI [send private reply] at May 06, 2003, 06:09:00 PM

Oh, okee...for what type of research??

Posted by Psion [send private reply] at May 06, 2003, 09:30:00 PM

Ask my home page

Posted by VV [send private reply] at May 08, 2003, 02:04:36 PM

I`m no expert, but I have heard that Java creates a slow code. It doesn`t use as mutch operating system posebilities as C/C++. As mutch as my friends have told me you sholdn't use Java if you are writing a code for specific operating system. Java is ment for platform idependenc.(sorry about the English and sorry if i'm wrong)
PS. they pobably got it from some book, but I'm not sure.

Posted by Psion [send private reply] at May 08, 2003, 03:04:06 PM

Java annihilates C++ in most every area application programmers should care about. Java is typesafe, which means programs that compile can't do funny things with memory leading to bizarre, impossible to find errors, and they can't crash as long as you have enough memory left. I don't know why you'd choose C++ over that.

Posted by CodeRed [send private reply] at May 08, 2003, 03:08:13 PM

Because it is faster, even compiled java is nowhere near as fast as C++ executables, and that is what customers really care about, for the microsoft apps that they buy to run fast on their "brand new" 450mhz PII machine... LOL

Posted by Neumann [send private reply] at May 08, 2003, 03:30:17 PM

Currently, C++ shouldn't be used for anything else but games. Microsoft is slowly integrating DirectX into .NET and in few years, C++ and C will be looked at like Assembler is looked at today: languages you shouldn't use except in very specific areas.

Of course I'm only talking about Windows. Other platforms will eventually follow that trend I suppose.

As for Java speed, all Java apps (except 1) I've ever used were running at tolerable speed on my O So Wonderful PIII 450mhz.

Posted by gbyte222 [send private reply] at May 08, 2003, 03:58:57 PM

Psion, if you are a good programmer you do not get "impossible to find" errors.

Posted by Mike_L [send private reply] at May 08, 2003, 04:28:51 PM

gbyte said:
> Psion, if you are a good programmer you
> do not get "impossible to find" errors.

I disagree. Even the best programmer produces code with errors. When you begin to write truly enormous programs then you will begin to understand how C++ has many problems. Once you find the courage to try other programming languages (like scheme or ML) then you will will understand the reasons behind Psion's statement.

VV said:
> I`m no expert, but I have heard that
> Java creates a slow code.

A lot of Java code is slow, but it doesn't have to be. It is possible to write many kinds of programs in Java that run just as fast as similar programs written in C. This requires a JIT Java implementation and programmer who understands the language and how the JIT works. Most Java programs are slow because they are written by unskilled programmers and run on poor Java implementations.

Posted by ArcticWind [send private reply] at May 09, 2003, 01:19:27 AM

I'd choose C++ over Java, programmers are meant to know what they're doing if Java is to keep you "safe" then you better stick with Visual Basic or something.

Posted by ArcticWind [send private reply] at May 09, 2003, 01:36:46 AM

Why can't I edit my post?? anyway this is what I was going to say:

I'd choose C++ over Java, programmers are meant to know what they're doing if you use Java to keep you "safe" then you better stick with Visual Basic or something else.

Java lacks:
* Templates
* Operator Overloading
* Inlining functions
* Preprocesser (yes sometimes this is a good thing)
* Manually allocating/deallocating memory (sometimes a good thing too)

And in Java everything needs to be in a class, C++ doesn't force you to do OOP when you don't want to.

Posted by VV [send private reply] at May 09, 2003, 02:07:58 AM

Again, I'm no expert, but prsonaly I respect Assembler programmers, because Assembler doesn't shield you from anything that your programm is going to do, whitch means that programmer must be certain on what is (s)he doing.
And a nother thing I didn't notice before:

Psion sad: "... it also has a requirement of general mathematical ability, which leaves out most C++ programers."

I don't get it. Is it even posible to make a good solution for a dificult problem without using mathematics? Of course I'm just learning, but as mutch as I have tried to solve any I've always tried to use mathematics to find an other way around and solve the situation faster. Correct me if I'm wrong, but thats the way I see it.

P.S. I'm also learning C/C++. Sorry if I misunderstud you Psion. I'm not trieing to argue (I don't have enough smarts and corige to do that). And, again, sorry about the English.

Posted by gian [send private reply] at May 09, 2003, 03:42:45 AM

A knowledge of Assembly might be useful if you're into compiler writing and such, but these days so much research into compiler theory has been done that you are unlikely to be able to write better asm code than a decent compiler for a high level language can generate.

Posted by Neumann [send private reply] at May 09, 2003, 08:17:20 AM

Of course. I might dislike C++, but that doesn't mean one shouldn't learn it. It's not all that hard and widely used in the industry. It's important to try different languages because C++ will not always rule the market.

"I'd choose C++ over Java, programmers are meant to know what they're doing [...]"

That's own most of the security flaws in program happens. Programmers think that they know what they are doing and that they have full control of the flow of their programs. That's not true in C++ or in any other languages.

* Operator Overloading

That is syntaxic sugar. I don't think that write A + B is in any way more powerful or efficient than A.add(B). It also allows the programmer to confuse the hell out of anybody by defining + to be a substraction and - to be an addition (and that's just an example).

* Templates

I don't have a opinion on this topic because I don't have much informations on this. I believe Psion and Gian could give us a reason why C++ templates are not all that great.

* Inlining functions

A smart Java compiler could inline functions for you I suppose.

* Preprocesser (yes sometimes this is a good thing)

C# has a integrated pre-processor. There is numerous third-party pre-processor for Java available too.

* Manually allocating/deallocating memory (sometimes a good thing too)

Sometimes? yeah. In memory constrainet embedded devices, it might be a good thing. But on PC with large memory capacity, I can't figure out why I would need to manually manage memory allocation.

"And in Java everything needs to be in a class, C++ doesn't force you to do OOP when you don't want to. "

If you don't want to do OOP, why do you use C++?

Posted by ArcticWind [send private reply] at May 09, 2003, 11:37:57 AM

"* Operator Overloading

That is syntaxic sugar. I don't think that write A + B is in any way more powerful or efficient than A.add(B). It also allows the programmer to confuse the hell out of anybody by defining + to be a substraction and - to be an addition (and that's just an example). "

Confusing? how is A + B * C + D more confusing than A.add(D.add(B.mul(C))) ?

If you had a Number class wouldn't you want to treat them like numbers?

"* Templates

I don't have a opinion on this topic because I don't have much informations on this. I believe Psion and Gian could give us a reason why C++ templates are not all that great. "

It lets you write generic functions, even for types that aren't objects

"* Preprocesser (yes sometimes this is a good thing)

C# has a integrated pre-processor. There is numerous third-party pre-processor for Java available too."

Has java got a built-in one?

"If you don't want to do OOP, why do you use C++?"

You may wish to use some OOP without having to stick every function in a class.

Posted by Psion [send private reply] at May 09, 2003, 11:45:15 AM

Operator Overloading: It's confusing because you can't tell which function is actually being called just by looking at the operator being used. Function overloading has the same problem. Thus, many languages, like ML, don't support any overloading, besides (sometimes) some built-in overloading of arithmetic operators.

C++ templates are not all that great because they use simple text substitutions. You need the source to a template to use it, and you don't know if it will work without trying it with all possible substitutions. ML polymorphic functions and functors (which are sort of uber-templates) allow you to verify type correctness without ever using them.

Preprocessor: These are really of very limited use with modern compilers. If you're going to go this route, you'd might as well have something cool like Template Haskell that actually adds new capabilities.

Posted by CViper [send private reply] at May 09, 2003, 02:30:48 PM

"[...] It also allows the programmer to confuse the hell out of anybody by defining + to be a substraction and - to be an addition (and that's just an example)."

Well, nothing keeps you from defining the Add() function to actually do a subtraction, except that it is a stupid thing to do (and the same goes for overloaded operators).

On preprocessor: A lot of people use the preprocessor to define constants and macros which are used as "inline functions" - which is not very smart.
But you can do some pretty nifty stuff with the preprocessor, which otherwise would result in a lot of messy code.

But I agree on C++ templates; they are rather messy and a bit limited.

(now I broke my vow to not post in this thread. damn)

Posted by Neumann [send private reply] at May 09, 2003, 02:36:34 PM

"Well, nothing keeps you from defining the Add() function to actually do a subtraction, except that it is a stupid thing to do (and the same goes for overloaded operators)."

Ah! Good point ;)

Thus I go along with what Psion said.

Posted by taubz [send private reply] at May 09, 2003, 03:33:23 PM

"Well, nothing keeps you from defining the Add() function to actually do a subtraction, except that it is a stupid thing to do"

C# operator overloading of == gets quite annoying. For objects, == is reference equality. a==b iff a and b point to the same object. For strings, it's "content" equality. a==b if a and b are both strings with the same content. If I'm working with strings but want to test reference equality, I need to do ((object)a)==((object)b). Ugly.

Not that I go along with what Psion said. :)

- taubz

Posted by CViper [send private reply] at May 09, 2003, 04:36:00 PM

Now that's one problem you don't have in C++ (unless you've implemented it yourself, that is).

Did you know that you can overload the comma "," operator in C++? That's the definite way to create a big mess.

Posted by ArcticWind [send private reply] at May 10, 2003, 09:30:39 AM

Does Java have an alternative to templates? If not whats the point in saying you should use Java instead? If you need the stuff C++ has or you just like it you should be able to use it without people condeming you for it.

Posted by Neumann [send private reply] at May 10, 2003, 09:48:44 AM

taubz: I didn't use C# enough yet but if what you say is true, i must admit that its annoying.

ArticWind: You can do everything you do with C++ templates with Java. It requires a bit more code and it won't work with primitive types,

I won't condemn anyone for using C++ if they want to use it. I just think it's a painful languages and many people use it because they think it's the only one they should use...

Posted by ArcticWind [send private reply] at May 10, 2003, 11:08:04 AM

If it doesn't work with primitive types then Java can't do everything C++ temeplates can do

Posted by Neumann [send private reply] at May 10, 2003, 12:09:06 PM

Yes it can. You can use the Integer class instead of int :P

Posted by unknown_lamer [send private reply] at May 10, 2003, 02:19:34 PM

Java has generics now anyway.

Posted by gbyte222 [send private reply] at May 10, 2003, 04:30:06 PM

Mike_L, you said, "Once you find the courage to try other programming languages (like scheme or ML) then you will will understand the reasons behind Psion's statement." I have tried java, and I did not like it.

Posted by Neumann [send private reply] at May 10, 2003, 06:09:34 PM

Java has generics? since when? I think generics are scheduled for Java 1.5. There is a preview of the technology on Sun site. Of course, with generics introduced, templates will no longer be an 'advantage' of C++.

Oops! Forgot to add that C# will have generics with .NET Framework v2. Probably at the same time that Java will.

gbyte222: Mike_L and Psion suggested to try other languages like Scheme, SML or Haskell (there some others). Java is too much like C++ to give you a real feedback about what Psion is trying to explain.

Posted by Psion [send private reply] at May 10, 2003, 07:59:04 PM

gbyte, "not liking it" is completely meaningless if you don't provide reasons. (Not to mention that I don't like Java either, and the very message that you quoted recommends trying languages very different from both C++ and Java....)

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.