Sign in to follow this  
Followers 0
KittyPlaysViolin

"Must-Learn" Languages

32 posts in this topic

If you're learning Java then learn Clojure. You should always learn a imperative and a functional language. It's late and honestly, I'm too tired to go into detail. But I certainly will tomorrow.
0

Share this post


Link to post
Share on other sites
I deal almost exlusively with C/C++ code, and I have done Java. I will say that learning C or C++ will expose you to core programming fundamentals (such as memory management, allocations on stack vs heap, object-oriented design, etc). I love Java for what it is, but I think if you are really looking to learning programming techniques which extend over all platforms, C or C++ would be a good choice for your projects. EVERYONE needs to know about pointers, and IMHO everyone needs to know about dynamic memory allocation and stack vs heap allocation. With C and C++, it is impossible to do any amount of coding for too long without running into memory leaks, stack/buffer overflows, segfaults, etc. These bugs are the bain of programming existance because they are [b]very difficult [/b]to debug. Sometimes days can be wasted before tracking down a hard-to-find memory leak. That being said, the experience of having and fixing these bugs is something you will need if you want to be a serious programmer.

Learning at least one scripting language is good as well. Scripting languages are built to make programmers' and users' lives MUCH easier by allowing you to write scripts to perform menial tasks, or tasks in which programming Java or C++ would be overkill. Tasks that rely on using native system commands are good candidates. I would recommend Perl or Python since these two are highly documented. highly used languages. Also, knowing a scripting language is good if your looking for jobs in industry, or if your looking to make your life easier. From a learning perspective, these will show you how easy high-level interpreted languages can make your life. Learning C/C++ will make you [i]appreciate[/i] these languages even more.
1

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1344572071' post='4967975']
Instead of 7 specific languages, I'd give you 7 categories:
[rollup='Language categories']A systems language, like C, C++.
A managed language, like Java, C#.
A weakly typed language, like Python, Lua.
A web-server centric language, like PHP, Ruby.
An automation language, like Bash, Batch.
A functional language, like Erlang, Haskell.
A domain-specific language, like SQL, Mathematica.[/rollup]
[/quote]
I was going to make a recommendation very similar to this one, so rather than repeating it I'll just quote for emphasis. You're spot-on with the idea that other than possibly being directly applicable there can be value in learning new languages in order to expose you to different ways of thinking about how to solve any given problem; you'll get the most bang-for-your-buck in this area by learning different [i]types[/i] of languages rather than necessarily any specific languages. From there it's a relatively trivial exercise to learn the syntax and familiarise yourself with the standard library and idioms of any language you plan to actually use for production.

I would add that it is also a very valuable learning experience to implement an interpreter or compiler. Bonus points if you at some point design your own language -- even if it's just a "toy" language -- rather than simply implementing an existing one.
0

Share this post


Link to post
Share on other sites
Regarding your question
[quote name='SharkBaitHooHaHa' timestamp='1344571089' post='4967972']
*What are the insights that those languages offer?*
[/quote]

Applying this to Hodgman's list, here is my opinions about the key insights and as well as some parings which languages go closely together, because you will only get some insights when you see how it is done differently in another language

[b]A systems language, like C, C++ : [/b]How your code behaves on a low level and stuff like memory-management
[i]as opposed to [/i]
[b]A managed language, like Java, C#: [/b]which will let you concentrate on object oriented programming, using frameworks and applying patterns without needing to worry about all those C/C++ pitfalls

[b]A weakly typed language, like Python, Lua:[/b] seeing how to bring Ideas quickly into code, how to create "quick'n'dirty" but still maintainable code.
[i]in conjunction with:[/i]
[b]An automation language, like Bash, Batch[/b]. to easily automate tasks (and recognizing which task are easily automated) without needing to use a full-blown language


[b]A web-server centric language, like PHP, Ruby:[/b] The peculiarities of web-development, thinking in multi-tier.software-architecture and asynchronous user-interaction
[i]together with SQL to get a feel of [/i]
[b]A domain-specific language, like SQL, Mathematica[/b]: The insights will be very domain-specific rather than general, so I would pick a language that is in a domain that interests you. Knowing stuff like that never hurts.

[i]And last but not least[/i]
[b]A functional language, like Erlang, Haskell: [/b]to see how to code "the other way", meaning non OOP
3

Share this post


Link to post
Share on other sites
I'm aiming for a pretty hardcore career (game development SpecOps [img]http://public.gamedev.net//public/style_emoticons/default/cool.png[/img]), but here's nonetheless my own learning plan over a 10-year-period:


[b]Assembly etc:[/b]
- Binary and assembly (Win & Mac) basics.
- Researching C-- and similar.

[b]High-end programming:[/b]
- HTML/XML, CSS, PHP & MySQL stuff. (For my website which will hold all my projects.)
- Javascript OR Actionscript basics
- Java
- C, C++ and C#
(Plus whatever other languages that may pop up as relevant.)

[b]Design:[/b]
- Paintshop Pro (images; for both game and photography stuff)
- CuBase (sound)
- 3DMax (modeling)
- LATEX (writing)


Just the hard core of development tools, really. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Edited by DrMadolite
0

Share this post


Link to post
Share on other sites
[quote name='doeme' timestamp='1344587554' post='4968010']
[i]And last but not least[/i]
[b]A functional language, like Erlang, Haskell: [/b]to see how to code "the other way", meaning non OOP
[/quote]

Functional programming isn't just non OOP, the big difference is that Functional programming is declarative rather than imperative. (There are plenty of non OO imperative languages, C, Pascal and BASIC for example (and they are fairly similar to their OO relatives (C#, Delphi, VB, etc).
3

Share this post


Link to post
Share on other sites
[quote name='jbadams' timestamp='1344574483' post='4967981']
I would add that it is also a very valuable learning experience to implement an interpreter or compiler. Bonus points if you at some point design your own language -- even if it's just a "toy" language -- rather than simply implementing an existing one.
[/quote]
Is it considered cheating if you use a Lisp-like language to do so? :D
0

Share this post


Link to post
Share on other sites
From what I remember, Python isn't weakly typed at all - it will scream to the heavens if you mix types without explicitly converting (exceptions shall rule them all). Actually dying early and loudly is part of the Python motto :) Perhaps you guys meant dynamic? Javascript is weakly typed, but also insanely powerful for scripting. The original Basic is also weakly typed, which made it so great for COM/OLE. IIRC, JavaScript in IE is still implemented via OLE scripting - that is why you used to initialize Ajax requests that way. I think newer versions of IE support the standard XMLHttpRequest.

Like kuramayoko10 said, Prolog is the most different language. Functional programming isn't that different to imperative programming for me (you still think the same way, just use functions for everything), but Prolog almost made me cry until I got it. The total lack of imperative programming concepts such as "if" and "for" is going to teach you a lot about recursion. Some things in Prolog are so much simpler and logical that they would be in an imperative language, that you'd wonder why there isn't a hype over it - like around Haskell, for example.

For DSL-s, I'd recommend to try and learn some build-automation tool, like (n)Ant and MS-Build - it will help you immensely. And since so few people know these tools well, you will stand out at your job :) Also, knowing how to work with documentation is helpful (Javadoc/Qt/doxygen-style commenting + the associated tools vs .net style commenting + MAML) - again, you might be the only one in your team that knows how to build professional documentation in an automated way. Kind of cool :)
1

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1344572071' post='4967975']
Instead of 7 specific languages, I'd give you 7 categories:

A systems language, like C, C++.
A managed language, like Java, C#.
A weakly typed language, like Python, Lua.
A web-server centric language, like PHP, Ruby.
An automation language, like Bash, Batch.
A functional language, like Erlang, Haskell.
A domain-specific language, like SQL, Mathematica.
[/quote]

There is a book called "Seven Languages in Seven Weeks" ...
0

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1344572071' post='4967975']
Instead of 7 specific languages, I'd give you 7 categories:

A systems language, like C, C++.
A managed language, like Java, C#.
A weakly typed language, like Python, Lua.
A web-server centric language, like PHP, Ruby.
An automation language, like Bash, Batch.
A functional language, like Erlang, Haskell.
A domain-specific language, like SQL, Mathematica.
[/quote]

On my opinion add an Assembler Language to the great list from Hodgman... And the list is complete and perfect :)
3

Share this post


Link to post
Share on other sites
[quote name='dilyan_rusev' timestamp='1344614592' post='4968115']
Like kuramayoko10 said, Prolog is the most different language. Functional programming isn't that different to imperative programming for me (you still think the same way, just use functions for everything), but Prolog almost made me cry until I got it. The total lack of imperative programming concepts such as "if" and "for" is going to teach you a lot about recursion. Some things in Prolog are so much simpler and logical that they would be in an imperative language, that you'd wonder why there isn't a hype over it - like around Haskell, for example.
[/quote]

If you use functional programming like you do imperative programming then you are doing it wrong ™, in functional programming you don't have loops (for/while), nor do you have state (Something that throws most imperative programmers for a loop), proper functional programming is extremely similar to logic programming (both are declarative) Edited by SimonForsman
1

Share this post


Link to post
Share on other sites
That was a long time ago - I was learning some dialect of Lisp, and it didn't seem something terribly different. It is also true I didn't try anything difficult, but the mere presence of functions made it a lot easier. They have nothing to do with predicates in Prolog. Arithmetic expressions worked almost as in imperative, you just had to write them in something like reverse Polish notation, with functions all the way. In Prolog, you don't even have that, you have some weird expressions that you use only for predicates, meaning recursion.

It might be different with Haskell, but Lisp was just stateless, nothing that extraordinary. I do remember there were some form of branching (meaning calling one function or the other), while in Prolog you do it with predicates & recursion. And functional is logical, cause stuff happens in the way you tell it to (meaning execution order), while in Prolog you will go crazy with all that backtracking and cuts; you are forced to think on a much higher level. I never had a "wow" moment with Lisp, and with Prolog I was really forced to change the way I think. Which was quite rewarding once I got it.
0

Share this post


Link to post
Share on other sites
Wow! So many answers, I will definitely check these languages out, I think I'm probably going to go ahead and start Python after I finish a bit of C++ :)
I have some other questions though:


Is a weakly typed language a "scripting language"? And if not, what is a "scripting language" compared to a weakly typed language?

Is there something wrong with Lisp? How does it compare to Haskell? I own a Lisp a book but I haven't had a chance to give it a good read.

I've been hearing lambda calculus a lot when reading about functional programming. What exactly is it?

Lastly, is functional programming really applicable to games? From what I understand functional programming languages have an inherent lack of state.


So far the responses have been great, thanks to everyone for their feedback! As a side note @dragongame is that book any good? I don't tend to put much faith in the "Do X in Y amount of TIME" books.
0

Share this post


Link to post
Share on other sites
Just for this part:
[quote name='SharkBaitHooHaHa' timestamp='1344645420' post='4968266']
I've been hearing lambda calculus a lot when reading about functional programming. What exactly is it?
Lastly, is functional programming really applicable to games? From what I understand functional programming languages have an inherent lack of state.
[/quote]

Here's John Carmack on the matter: [url="http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/"]Functional Programming in C++[/url] // a good read not just for C++ programmers Edited by Matt-D
2

Share this post


Link to post
Share on other sites
[quote name='SharkBaitHooHaHa' timestamp='1344645420' post='4968266']
Lastly, is functional programming really applicable to games? From what I understand functional programming languages have an inherent lack of state.
[/quote]

Functional programming can be applied to games and a function can return state and take state as input, it just can't modify or store state, you will need a small imperative portion (the game loop really) but for everything else you can use functional programming.

Functional programming has alot of advantages, one of the major ones for games being that since pure functions always lack side effects (no state) it is relativly easy to write parallel code when you use a functional approach . I don't think functional languages really have a place in games but functional programming does and it is far easier to learn how to do functional programming if you use a language that slaps in you the face when you try to write imperative code. (There are disadvantages aswell ofcourse). Edited by SimonForsman
0

Share this post


Link to post
Share on other sites
[quote name='SharkBaitHooHaHa' timestamp='1344645420' post='4968266']
Is a weakly typed language a "scripting language"? And if not, what is a "scripting language" compared to a weakly typed language?
[/quote]"Scripting language" has different definitions depending on who you ask. Most of what you'd call "scripting languages" are weakly typed, but not all. e.g. I'd consider UnrealScript a scripting language, and it's quite similar to Java.
I'd prefer to call them "[url="http://en.wikipedia.org/wiki/Scripting_language#Extension.2Fembeddable_languages"]extension languages[/url]" -- e.g. many games embed a Lua VM into them, for "scripting" the gameplay. Unreal games have UnrealScript embedded into them. WebBrowsers have JavaScript. Blender/Maya have Python, etc... These languages are embedded into an application, for the purposes of extending the behaviour of that application with modifiable "scripts" (another word for "code").[quote name='SharkBaitHooHaHa' timestamp='1344645420' post='4968266']Lastly, is functional programming really applicable to games? From what I understand functional programming languages have an inherent lack of state.[/quote]It's challenging if you've spent most of your time writing in non-functional styles, but the lack of state is a huge advantage when it comes to parallelism -- it means that a good compiler can automatically make your code run on many threads (in theory, anyway). Also, despite the 'no state' thing, there's still ways to interact with a stateful environment (such as stdin/stdout), or even "hello world" wouldn't be possible to write!
In the future, these languages may start becoming more popular with games programmers.[quote name='SharkBaitHooHaHa' timestamp='1344645420' post='4968266']I've been hearing lambda calculus a lot when reading about functional programming. What exactly is it?
[/quote]It's a branch of mathematics, which lets you perform formal reasoning about computations (and functional style code).
[url="http://en.wikipedia.org/wiki/Lambda_calculus"]http://en.wikipedia....Lambda_calculus[/url]
0

Share this post


Link to post
Share on other sites
Ultimately it's a waste of time to spend so much time on different languages. If I had to retake my path I would have jumped into C++ and never looked back. In reality only the specialist really shine in what they do. There's no reason to try and be good at everything. My teacher once told me; sometimes you need to learn to love what you hate and embrace it.

That's what defines if you truly are willing to walk down the path you really set out for you. Don't plan things years ahead, I know plenty of things I wanted to get taken care of that never happened because my priorities changed. Just get started. Edited by DZee
-3

Share this post


Link to post
Share on other sites
@Matt-D Thanks for the link, I'll be sure to check it out! I'm interested to hear what Carmack has to say about functional programming :) I read one of his articles on ray tracing and it was superb

@SimonForsman Have you seen/read the book "The Land of Lisp"? That's the book I currently own about Lisp but as I said I haven't been able to read it and right now I don't have access to it (this Saturday I fly back home to my collection of programming books <3 ). I mention this book because it teaches Lisp through game examples and I found it really interesting in that aspect. I think you might be interested in this one :)

@Hodgman Oh okay, so scripting languages are kind of the quick and dirty languages? That makes sense haha :) I'm guessing then for the functional programming
languages I just gotta jump in and see how I do it then. Thanks!

@Dynamo_Maestro I'll read about F# but I probably won't go too deep in it since I'm not that big of a fan of .NET :P but thanks nonetheless!

And thanks to everyone else that answered!
0

Share this post


Link to post
Share on other sites
@DZee I see your point there but I like to think of it as my Dad puts it,

"You can have large sea of knowledge, but have it only be puddle deep. Likewise you can have a puddle that is miles deep. But in the end, the most interesting sea is the one that is expansive and populated with shallows and deep ends."

I realize that I shouldn't try and be good at everything but I feel there is always something to gain from learning something new. Sometimes even just that joy of learning something new is enough to keep you going when you feel tired. I will probably specialize in a very limited field as you say, but I doubt I can keep my thirst for knowledge quenched. I wouldn't be surprised if at the end of my life I'm sitting in bed reading on the newest quantum computer or virtual reality gaming consoles(hopefully they get there by then!) :D

@ApochiPQ I agree completely with you on that, that's why I made this post :)
3

Share this post


Link to post
Share on other sites
SharkBaitHooHaHa,

My philosophy for learning languages being the new learner in them which I am, is this:

Learning Languages
1) Need in the short term is survival.
2) Want is close behind because desire and keeping interest both drive you forward and inspire creativity.
3) Preparation for future demands keeps you ready for new challenges.

With these in mind I will be ordering my language learning priorities. I hope this helps.


Questions for the programmers: Would imperative programming add a strong tendancy for spontaneity in a game for the player just by nature?

1) What are the two most imperative languages?
2) What are the two most declarative languages?
3) Is functional programming independent of the previous two characterstics or not necessarily? To me this seems to depend on the language, is this not correct?

In the mid 1980s I studied Basic and COBOL, loving the imperative because I could either make something happen the same way every time or add randomness in the "Then" of the statement. This is why I believe a heavily imperative language is good for spontaneity of the player in the game while keeping order, too.

Recursion seems to be the ideal approach in many situations for complex circumstances, but would it not hurt game performance if used very much, risking FPS drop instances due to "perfect storms" of too much processing at certain moments?

It seems to me that imperative would be the best in general for game performance. Which of these mentioned (imperative, declarative, or functional) [i]is[/i] the best for performance? ( All other things being equal.)


3Ddreamer
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0