![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
More languages?
Currently, I'm only learning C++ (after having a brief look on C), and a lot of people say that knowing several languages as well as one "main" language helps in understanding programming more and generally becoming a better programmer. While I can see that this makes sense and is useful, won't it be terribly confusing? I know several regular languages (English, Norwegian/Swedish/Danish, Russian and I'm learning German and Arabic), and I find that a bit confusing, so I wonder if the same happens with programming as well?
And if it really is beneficial, which other languages would you guys recommend? Not Assembly though, I'm not that crazy! ![]() |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,198
Rep Power: 5
![]() |
Yes, knowing multiple languages can result in situations where you confuse between them, or blur the edges between them (eg using techniques suitable for one language when programming in another -- sort of similar to people speaking with accents). The approaches to addressing those issues are the same as for spoken languages: slow down, take more time, think more about how you wish to express something in the language you're using, etc etc.
As to what other languages you might wish to learn: what do you wish to achieve? For example, what types of applications do you wish to develop? And people who learn assembly may be a little twisted, but that doesn't make them crazy ![]() |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
I see!
I'll probably end up doing graphics and game physics and similar. As for Assembly, it looks pretty crazy to me! :p |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
I am not experienced but i think C++ OpenGL API is good.
__________________
From the bottom of the stone steps... ...i'm calling still. |
|
|
|
|
|
#5 | |
|
Newbie
Join Date: Nov 2005
Posts: 9
Rep Power: 0
![]() |
Quote:
. |
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Learning programming languages is slightly different from natural languages. Compared to programming languages, natural languages have a hugely complex syntax, and a gigantic dictionary of semantics. In addition, there is much more overlap between programming languages than there is between computer languages.
For instance: if x == 1:
print "X is 1"
------------------------------------
if (x == 1) {
System.out.println("X is 1");
}
------------------------------------
if (x == 1) {
printf("X is 1");
}
------------------------------------
if (x == 1) {
cout << "X is 1";
}
------------------------------------
if x == 1
print "X is 1"
end
------------------------------------
print "X is 1" if x == 1;
------------------------------------
IF x = 1 THEN
PRINT "X is 1"
ENDIF
------------------------------------
(when (= x 1) "X is 1")
------------------------------------
if [ x = 1 ]
then
echo "X is 1"
fiThere is, however, an awfully large difference between the performance of different computer languages in different situations. A book written in English will not be significantly shorter or longer than the same book written in German. A program written in C will be significantly faster than a program written in, say, Ruby - and likewise, a program written in C will probably take a lot longer to write than one in Ruby! Some programming languages, such as Perl, appeal to quick scripts and fast results. Others have libraries that make them especially good for certain tasks. Python's Twisted networking library, for instance, makes it an ideal candidate for creating custom network clients and servers in. |
|
|
|
|
|
#7 | ||
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,198
Rep Power: 5
![]() |
Quote:
And try giving an example, even for your simple case, in assembler! If you are doing more advanced things than your example, the visual differences between languages become more obvious as well. Quote:
|
||
|
|
|
|
|
#8 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Quote:
Likewise, the syntax of a computer language is consistant and often consists of a relatively few rules. Compare this to the shifting inconsistancies of English! Further, the similarities between languages run deep. Once you know that an if statement executes a block of code on a condition, you need only learn the way this differs between languages. In Java, blocks are delimited by {}, conditions are surrounded by (), commands are delimited by ;. In Python, blocks are delimited by whitespace, control statments end in :, and commands are delimited by newlines. In just two sentences, a significant proportion of the differences between the languages are revealed. You make a good point that programs are rarely this simple, but programs are often made up of simple parts. The syntax of computer languages tends to be rather concise and to the point; the complexity comes generally from libraries, and even the most experienced of programmers only bother learning the very most common libraries by heart. |
|
|
|
|
|
|
#9 | |||
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,198
Rep Power: 5
![]() |
Quote:
Programming languages are different, in that the basic syntax is often quite simple, but the grammar (what can go with what) and semantics (meanings of different combinations of constructs) are more complex, particularly with modern programming languages. Quote:
Again, the issue is that you are focusing on syntax and ignoring fundamentals such as semantics (i.e. meaning of code constructs). I would agree it is quite easy to learn the basic syntax of languages like C++. A lot of the problems that novices (and even some experts) have with C++ (eg in forums like this one) are unrelated to the syntax. The bulk of problems come about because people attach meaning to some code constructs that is invalid. Quote:
|
|||
|
|
|
|
|
#10 |
|
Expert Programmer
|
Some people go so far as to say it is impossible to learn more than one language when you are starting out. I suggest you get a good understanding of at least one language before moving on and learning others.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|