Which language is better to learn? C++ or Java?

Moderator
Posts: 3,572
Joined: 2003.06
Post: #31
Ingemar Wrote:All three are badly designed languages, locked into design flaws (hacks) made by K&R in the early 70's.

Interesting argument! I can't say I disagree with the idea that they're all "locked" into the hacks by K&R (which of course they did a great job of at the time). What would you say is the language direction you would take today?

Personally, after having tried a whole bunch of them, including various scripting languages, and even creating my own, I still like C the best, although it is admittedly lacking other features I wish it had. Objective-C adds some stuff I would like but doesn't go all the way, and 2.0 was a step backward IMHO. C# is really nice but runs in VM. C++ goes way past where it should have been targeted. I just don't see anything that I can honestly think about as the future of computer languages yet.
Member
Posts: 260
Joined: 2005.05
Post: #32
For me, FPC is best. GNAT is my second choice. But for this voting, my answer is rather: Don't learn a programming language, learn to program! Learn at least half a dozen languages. And don't just learn a few dialects of the same thing. Learn both procedural, functional and object-oriented programming, and don't listen to all the people who say there's only one way.
Member
Posts: 260
Joined: 2005.05
Post: #33
AnotherJake Wrote:and even creating my own
Just of curiosity, what language was that?
Moderator
Posts: 3,572
Joined: 2003.06
Post: #34
Ingemar Wrote:Just of curiosity, what language was that?

It's a C-like scripting language. I learned how to make it from the book Game Scripting Mastery (no, it's not the same one as in the book). It worked, but it isn't very robust, and it isn't finished, and I haven't further developed it in years. I was going to add some object orientation to it, but I never got around to it. It was a fun exercise though, and I learned a lot. I'd highly recommend that book to anyone who's interested.
Member
Posts: 260
Joined: 2005.05
Post: #35
AnotherJake Wrote:It's a C-like scripting language. I learned how to make it from the book Game Scripting Mastery (no, it's not the same one as in the book). It worked, but it isn't very robust, and it isn't finished, and I haven't further developed it in years. I was going to add some object orientation to it, but I never got around to it. It was a fun exercise though, and I learned a lot. I'd highly recommend that book to anyone who's interested.
Yes, that definitely sounds like a good exercise.

I did something that might be similar once, an interpreter. It worked but never got really useful by its own, but then I took the central parts of the parser and reused it for an expression parser, a "smart calculator", and it is great, one of the most useful tools I ever made!
Member
Posts: 227
Joined: 2008.08
Post: #36
I like straight C, simply because it generally makes obvious the things that are hidden away in other languages. Almost everything that could possibly go wrong is pretty explicit. Like anything else, it could use a nice cleaning of syntax, because it can get very ugly at times.

I did an 8(intended, was really 6 because I didn't finish) opcode VM once, I was trying to see how many operations were needed to make a Java-strength language. It operated like a tagged-memory stack machine using all sorts of assumptions to make it fast.

I never wrote a compiler for any language I felt like making. I may try at it again soon.
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #37
Oddity007 Wrote:I like straight C, simply because it generally makes obvious the things that are hidden away in other languages. Almost everything that could possibly go wrong is pretty explicit.

No offense, but that is absolute bollocks. C, in and of itself, has absolutely no runtime safety mechanisms, but YOU have to be explicit about checking every potential source of error, and the compiler and type system aren't any help, either.

So yes, in a way you are right, everything that can go wrong, will go wrong in C, explicitly so. Pros and novices alike are liable to make a lot of mistakes, and clever programmers tend to make even more clever mistakes, which often end up hiding in plain sight.

C is bare to the metal, which is its strength and weakness alike.
Member
Posts: 749
Joined: 2003.01
Post: #38
You may like the languages or not, still C & C++ compilers make the fastest executables around, and by far.

The "speed doesn't matter nowadays" thing may be true for desktop apps, but for games you often have to push things to the edge to stand out from the crowd, and for embedded games you need all the speed you can get.

Sure python or java may be more elegant, but until they get comparable speeds they're not an option I will consider.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Moderator
Posts: 3,572
Joined: 2003.06
Post: #39
Najdorf Wrote:Sure python or java may be more elegant, but until they get comparable speeds they're not an option I will consider.

Throw C# in there too, for me -- although I *love* the language.

I definitely prefer the languages that ride on the bare-metal all the way, or as much as possible. The elegance of the language itself *does* count, but I'm with you on the instant access to raw performance thing.

Still, you'd think by now we'd have a better wide-spread option for a "bare-metal" language than C/C++. c'mon, where's the future?!

[edit] And another thing: Why TF are we still stuck in "text mode" programming? I mean, man, we've got all this massive programming power available to us where we can drag and drop and organize and stuff, and nobody has nailed a truly visual system of programming that takes advantage of other forms of human perception. Like for instance, one thing that really irritates me about C/C++/etc. is that it's sometimes a pain to read other people's code. It would be so nice if what I was looking at was standardized, and I mean that in a graphical sense, like how a spreadsheet is standardized. I don't know if that makes any sense.

And I don't mean no wannabe graphical programming language, as in drag and drop objects that relate to an existing "text"-based language, but a visual language at it's core that compiles directly to machine language and has no text intermediate.
Moderator
Posts: 1,560
Joined: 2003.10
Post: #40
AnotherJake Wrote:[edit] And another thing: Why TF are we still stuck in "text mode" programming? I mean, man, we've got all this massive programming power available to us where we can drag and drop and organize and stuff, and nobody has nailed a truly visual system of programming that takes advantage of other forms of human perception. Like for instance, one thing that really irritates me about C/C++/etc. is that it's sometimes a pain to read other people's code. It would be so nice if what I was looking at was standardized, and I mean that in a graphical sense, like how a spreadsheet is standardized. I don't know if that makes any sense.

And I don't mean no wannabe graphical programming language, as in drag and drop objects that relate to an existing "text"-based language, but a visual language at it's core that compiles directly to machine language and has no text intermediate.

There are some enormous benefits to keeping things like source code in text-only form, some of which are summarized here (see the rule of composition): http://www.faqs.org/docs/artu/ch01s06.html

The longer I use computers, the more I prefer working on the command line and with text-only formats. There are simply too many ways for a binary format to invisibly go wrong. With a textual format, you can see any mess you've accidentally made in the file and clean it up quite easily. Any time I'm using a graphical editor on a file that has no underlying textual representation (and even on some that do, if they're convoluted enough, like Xcode project files), I can't help but feel like there are things in the file that aren't directly exposed to me for editing. It's a big pressure on the developer of the graphical tool to properly expose each piece of their binary format to the user in an editable manner; with text, it's so easy to get right that you don't even need to worry about it.
Member
Posts: 749
Joined: 2003.01
Post: #41
Heh, yeah more "visual" programming is an idea. They're trying to go in that direction in the later years.

One day maybe we'll be programming like in the matrix movies, with green text falling on black screens and creating 3d objects and stuff Rasp

Personally I like text only (gives you more control on the changes you might make) but I agree a visual enviroment can help productivity if you know what you're doing (which I don't).

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Member
Posts: 67
Joined: 2006.07
Post: #42
AnotherJake Wrote:Like for instance, one thing that really irritates me about C/C++/etc. is that it's sometimes a pain to read other people's code. It would be so nice if what I was looking at was standardized, and I mean that in a graphical sense, like how a spreadsheet is standardized. I don't know if that makes any sense.

In my opinion, I think a code "visualizer" might be more appropriate. I know what you mean: coding style is so idiosyncratic that it sometimes make code look like a pile of gibberish (I definitely see a lot of C and C++ code like this). So if there was some kind of tool that could let you view and understand code on a higher, more abstract level, effectively normalizing code from whatever crazy style it was written in, I think that would achieve the same goal without abandoning the text format altogether.

(Of course, there's probably already some kind of tool just like that out there somewhere that I'm not aware of.)

Setting storage and reliability issues aside for a moment, I wouldn't necessarily be opposed to the idea of a completely visual programming environment, in theory. However, it would have to be very streamlined: I'd probably get frustrated using an entirely visual environment if it made development slower or more cumbersome than with text.

Since when was "Fred" a placeholder variable?
Member
Posts: 227
Joined: 2008.08
Post: #43
I wonder if there is a "code normalization" tool, I would definitely want to see that. May be it could help me understand the Sauerbraten source. *shivers*

Unreal does shaders in a visual environment and it actually is easier. You can see it visually occuring and see what does what, much easier.
Moderator
Posts: 1,560
Joined: 2003.10
Post: #44
Oddity007 Wrote:I wonder if there is a "code normalization" tool, I would definitely want to see that. May be it could help me understand the Sauerbraten source. *shivers*

This might help: http://en.wikipedia.org/wiki/Indent_(Unix)
Member
Posts: 312
Joined: 2006.10
Post: #45
AnotherJake Wrote:Throw C# in there too, for me -- although I *love* the language.

I definitely prefer the languages that ride on the bare-metal all the way, or as much as possible. The elegance of the language itself *does* count, but I'm with you on the instant access to raw performance thing.

Still, you'd think by now we'd have a better wide-spread option for a "bare-metal" language than C/C++. c'mon, where's the future?!

[edit] And another thing: Why TF are we still stuck in "text mode" programming? I mean, man, we've got all this massive programming power available to us where we can drag and drop and organize and stuff, and nobody has nailed a truly visual system of programming that takes advantage of other forms of human perception. Like for instance, one thing that really irritates me about C/C++/etc. is that it's sometimes a pain to read other people's code. It would be so nice if what I was looking at was standardized, and I mean that in a graphical sense, like how a spreadsheet is standardized. I don't know if that makes any sense.

And I don't mean no wannabe graphical programming language, as in drag and drop objects that relate to an existing "text"-based language, but a visual language at it's core that compiles directly to machine language and has no text intermediate.
There is D.
Thread Closed 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Learn java ? icross 6 5,980 Apr 22, 2009 11:11 PM
Last Post: AnotherJake
  What to learn next? stevejohnson 3 3,095 Nov 19, 2006 04:08 PM
Last Post: unknown