View unanswered posts | View active topics It is currently Thu Apr 25, 2024 6:49 am



Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
 Learning to Program and so forth 
Author Message
Rank 10
Rank 10

Joined: Fri Jun 14, 2013 4:48 pm
Posts: 60
TheMohawkNinja wrote:
friendly wrote:
C++, C# and Java are dying languages. Really, all the imperative languages are on the way out. You can learn them ... but if you're after quick wins and a long career path, javascript and Haskell are the royal road imho.


You mind backing up this claim?

Android is Java-based, the new consoles are C# to the best of my knowledge, and as I said, XSP is programmed with (not it's scripting language, but the actual code the game runs on) C++. Considering the OP wants to learn how to program video games, and I have yet to know of a single game that uses Haskell outside of random little basically unknown projects that programmers use from time to time, why should he specifically learn Haskell, and if it is because all the other big languages are dying, how are the dying?


Agreed :
http://www.tiobe.com/index.php/content/ ... index.html

Your "dying" languages are far more used than the ones you quote, so before JS and Haskell get the C or java share, you won't lost time learning them. Btw, in some case, like embedded material in aviation, you can only write your program in C / C++.

If you talk to language such as pascal or cobolt, they both are "hard to kill" because of their use in special case/condition. Some french banking program that wer devellop in cobolt are still in use and maintain (why redevellop them ? they work fine, so until there is no need, don't touch/modify/rewrite it).

From my point of view, start learning C or script language (bash, batch python) to understand how write algorithm, then move to something more high-level/complex, like java or C# to understand the Object Oriented Programming (without some technicality difficulties you can find on C++ - ie malloc and free methods).
But keep in mind that typed variable give a better structure: you know what the variable means and what it holds this is very convenient when other people must use your (uncommented in too many case) code..


Thu Sep 18, 2014 5:06 pm
Profile
Rank 11
Rank 11

Joined: Mon Sep 30, 2013 11:46 am
Posts: 69
Thanks everyone for the replies!

I've seen many generations of the language wars in the lsst 30 years. It always seems preposterous that the dominant language of the day will ever be thought of as dead ... right up until it dies. Fortran, COBOL, Pascal, non-Objective C, VB, Perl 5, LISP, TCL and pre-STL C++ for example are all languages that were once considered mainstream. There are still people that write in them. But the mindshare is gone and no one would seriously recommend a newbie learn them.

Now I've called C++, Java and C# dying languages because I see the same thing happening to them. This is, on the face of it, a preposterous claim. Java in particular is the most popular language in the world, with Android being a big part of that.

But lots of languages run on a jvm now. Ruby, Python, Scala, Clojure, Groovy ... each of them nibbling away at the java mindshare because each of them is higher level and more productive to work in than java. It will take perhaps another ten years before java winds up in the same camp as C++ now - but it's on the way, with Google webtrends showing its community is merely stable now having suffered a great decline as the scripting languages came up. C# works at about the same leel as Java and I think these observations apply on the MRI as well as the jvm.

But the OP asked about gaming. Right now, no question, C#, C++ and Java are the dominant languages there. I've pointed to a few ways that javascript and haskell are going there, but these things are academic if you want a job in an industry where most gaming houses are using C#, C++ and Java.

Nevertheless, I'll stick by my claims. If you learn Javascript that makes you literate in a way that will compliment any other language you learn. And if you learn Haskell you'll make a good programmer in any other language you learn. Starting in the imperative languages won't do those things.

But still I've claimed the other languages are dying. Why? It comes down to expressiveness. 5 lines of Haskell is more powerful than 50 lines of Ruby is more powerful than 500 lines of Java is more powerful than 5000 lines of COBOL. The rest is evolution in action.

@XPAdmin I'm going to try putting it on my CV and see what happens!


Sat Sep 20, 2014 12:44 pm
Profile
Rank 7
Rank 7

Joined: Sat Sep 06, 2014 2:23 pm
Posts: 28
C and C++ are still pretty big languages and will ot go anywhere in quite some time, seems like your a bit stuck in thinking thar programming is only about doing computer/web applications.


Sat Sep 20, 2014 3:28 pm
Profile
Rank 11
Rank 11

Joined: Mon Sep 30, 2013 11:46 am
Posts: 69
@virror,

I wrote "But the OP asked about gaming. Right now, no question, C#, C++ and Java are the dominant languages there."

I know - TL;DR :-)


Sun Sep 21, 2014 12:31 pm
Profile
Rank 15
Rank 15

Joined: Wed Apr 10, 2013 5:49 pm
Posts: 230
I now have a pretty good idea on where to go. Thanks again everyone. I would've replied sooner, but I've been pretty out of it with a terrible cold. I've found some good youtube tutorials and I'm looking forward to really getting into it as soon as my head finishes clearing up.


Sat Sep 27, 2014 7:23 am
Profile
Rank 12
Rank 12

Joined: Sun Oct 05, 2014 11:34 am
Posts: 82
@Malachai,
The first programming language you learn is not as important as learning the concepts of what is being accomplished. If you learn the conceptual basis then any language you pick up will be easier. It is not uncommon for a programming professional to learn a new language in a couple of days and be proficient in a couple weeks. So keep in mind what you learn at the beginning is going to set the ground work for learning new languages (possibly ones that don't even exist).

Check out Kahn Academy. You can learn all sorts of computer science and mathematics there.

@friendly,
A language may be expressive, but Haskell cannot flip a bit on a microcontroller without the libraries written in C or assembler. Every language generally has a niche. C being the hardware language. C++ being a formalization of OOP principles built into the language. My current preference is Python. Very expressive and saves a lot of my development time.

I would be more inclined to learn Haskell, but I do not see it being used anywhere I could get paid to use it. That is generally the driver behind all the languages I have learned to date. You may be right and Haskell may be all that, but like most developers you pick up a book, learn the concepts of the new language, and continue on. I know my Python experience has made me a better programmer. It causes you to think differently about the data and program flow. You cannot program Python like a C/C++ program. It is closer to thinking in terms of sets like in discrete mathematics.

I just don't see the language itself as being that important. It is the concepts of what is actually happening to your data that matters. People have to be able to manage the data flow from point A to B. From there you just look for the most appropriate structure or functions to pull it off in the language you are using. I know programming in OpenCL is massively different than C++ in that the data flow is parallel. Thus I cannot use results from one calc for another calc so easily. Where C++ is much simpler since it is sequential.

Anyway, I suspect the gravity of many of the current languages to stall any massive abandonment of them. The installed base of devices running C for instance is massive. Until those devices all but disappear then it is not going away. The production of these systems and devices has been pretty exponential as well. So comparing Cobol to C++ is simply not in the same ballpark in magnitude.


Fri Oct 10, 2014 7:39 am
Profile
Rank 11
Rank 11

Joined: Mon Sep 30, 2013 11:46 am
Posts: 69
Actually there's a long history of hardware synthesis DSLs in Haskell compiling to Xilinx, Verilog, VHDL and, if you're feeling perverse, C of course. See http://www.haskell.org/haskellwiki/Appl ... rification or more recently http://www.cs.ru.nl/P.Achten/IFL2013/sy ... sion_7.pdf

As for Python, sure, it's a popular scripting language with functional affectations, greatly popularized by its use at Google. Works in nicely with C++ using the AlternateHardAndSoftLayers pattern. But compare it with the expressiveness and productivity of Haskell and, sorry Bubba, you're SOL.

See, unlike scripting languages like Python, Haskell has strong static typing. Which means that, generally, if it compiles, it's correct, and it can compile to amazingly efficient stuff.. The recent MIO module, for example, enables web servers written in it to run rings around ones written in imperative languages - performance scales linearly per CPU core up to 40 cores, benching service of 20 million new http requests per second out of a single machine.

And yet it is easily as expressive and flexible as a scripting language because, unlike imperative statically typed languages, it has totally kick-ass type inference. To get a feeling for why it is indeed "all that" - and why it can filll such an extraordinarily broad range of niches, all the way from hardware synthesis through gaming (FRP started in Haskell) to web apps and scripting, try http://yannesposito.com/Scratch/en/blog ... -Hard-Way/ .

As for OpenGL, of course you can program to it in a great variety of languages including C++. More interesting, however, is the move to embed OpenGL in web browsers via WebGL and asm.js. Since Haskell can do asm.js via, for instance, GHC LLVM to Enscriptem, or via HASTE, ghcjs, or (slightly cut down) Elm, and since asm.js is a bastard to program in directly, this is actually a very nice niche for Haskell to grow into.

As for discrete mathematics, or any mathematics, that's pretty much where FP in general and Haskell in particular started. Functions in functional programming act like real live math functions, not the bastardized CS equivalents. Haskell functions have referential integrity and the ecosystem enjoys perhaps the most complete set of supporting math libraries outside of Mathematica or R. Plus low-level bit twiddling that stomps all over those things.

As for "devices running C", er ... nope, there aren't any. C isn't a virtual machine like the JVM or MRI. It's a compiled language - the devices you refer to are running machine code generated by compiling from C. Or from C++. Or from Haskell. From the device's point of view it makes no difference. What's more Haskell has a very mature FFI that can link just fine to C/C++ code, and the GHC can be tricked out to emit same, etc.

As for the installed base and mindshare and so on ... your remarks might be relevant if the exponential growth of the installed base had plateaued. But it has not. Therefore we can expect that shifts in installed technology bases and mindshare will continue as they have for the many preceding generations of language pissing matches. My point isn't that Haskell is the last language ever. It's simply that it's a great first language, a great general purpose language, and a language that has more expressivity, more power, better concurrency and parallelism mechanisms, and a bigger future than anything else the OP could learn at this point.

Now let's get back to pissing on virtual girls, rather than each other, shall we? :-)


Fri Oct 10, 2014 12:21 pm
Profile
Rank 12
Rank 12

Joined: Sun Oct 05, 2014 11:34 am
Posts: 82
Minor clarifications:
- I said OpenCL not OpenGL.
- The reason I mentioned microcontrollers specifically is that you will not find a whole lot of Haskell code targetting those platforms. Those are mainly C, C++, and assembler. Yes I am sure you can find some kind of translation, but depending upon your requirements the language is a small piece of the design decisions. (BTW, why would you think any programmer would think that a micro runs anything but machine code unless it specifically has a VM installed?)
- I agreed that Haskell may be the future, but it does not help with a job now necessarily. By all means study it, become a better programmer, but don't expect to find a job doing it right away. Get a few languages under your belt.
- I mentioned Python because it has been proven to reduce programmer time versus languages such as C++. This is similar to what you are proposing as a benefit of Haskell, but I can get paid to program Python right now. I did not think Python was popularized by Google. It has been slowly gaining usage and mindshare since the late 80s. I must have missed the memo on that one because I never associated Google with Python at all.
- I am not doubting the kick assness of Haskell. The main question I would have about Haskell is how much math is required to understand how to do a "hello world" program? Does it require any kind of proficiency in the theory to be useful? I am asking because I dont know.
- Exactly when did you think this was a pissing match? Or is your opinion of good starting languages the only valid opinion?

To help you understand my opinion, it comes from a what skills can I employ now to meet a demand for which I can get paid. I write code for control systems, embedded robotics (petroleum industry), website code (mainly backend processing of realtime data), interface programs to control robotics (desktop in Python), and a bunch of other various things. Any given day I might be programming in as many as 4 different platforms (sometimes more). As an owner of a company I would not be interested in how expressive the language is, but how well the programmer can produce solid code from the languages I have chosen. The choice is generally based upon hardware, libraries, and developer capabilities. In writing code for customers I do NOT get to choose the language often. Even when I do get to choose I am limited to languages the customer is comfortable with. So my views of what is best to learn from are colored by utility. If I have to hire someone to program I am not going to be looking for a Haskell programmer any time soon. I will mainly be looking for a good overall programmer that can pick up a new language quickly and can produce good code fast. Because of the focus on embedded work I will most likely look for an electrical engineer that can program.

Here is the view of other people on this subject:
http://www.forbes.com/sites/quora/2014/07/14/what-is-the-most-valuable-programming-language-to-know-for-the-future-and-why/ (This surprised me a little bit, but does not completely seem implausible. I have used V8 in conjunction with Python and was very impressed by being able to define contexts especially for user side scripting. And it has the potential to be faster than pre-compiled code due to "most used path" realtime optimizations. It actually will continue to optimize the code used the most. A compiled language cannot possibly know this ahead of time. Maybe when we get quantum computers that can nearly instantly analyze and set of data in parallel. Google is working on it. <wink>)


Sun Oct 12, 2014 7:36 am
Profile
Rank 11
Rank 11

Joined: Mon Sep 30, 2013 11:46 am
Posts: 69
Apologies about misreading you on OpenCL. Very interesting stuff, GPGPU programming. There is some Haskell stuff there too (http://www.arcadianvisions.com/blog/?p=346) but it looks pretty experimental. Mind you most OpenCL stuff looks a bit that way ...

My point on microcontrollers is merely that there's no shortage of Haskell stuff there. Certainly agree with you on mindshare that there's precious little current commercial work for functional programmers here in general and Haskellers in particular. We're just at the start of the wave.

Python has indeed been gaining steam for a long time, but it was the Google adoption that kept it afloat when Ruby gained currency. See http://stackoverflow.com/questions/2560 ... -at-google for some history. Python and ruby are both much more approachable than Haskell at this point in time but that's changing with the advent of decent online beginners material like "Learn You A Haskell" and the School Of Haskell at FP-Complete. Comparing Haskell now with Python in the 90s is quite apt.

As for hello world in Haskell ... well, here's 3 one-liners to give a smattering:

main = putStrLn "Hello, World!"

Simple fibonacci sequence in Haskell:

fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

Note that recursion in functional languages is extremely efficient, so most programs use it. Also this yields an infinite list, which is also okay because Haskell has lazy evaluation of same.

All combinations of a couple of lists:

(++) <$> ["ha","heh","hmm"] <*> ["?","!","."]

(yields ["ha?","ha!","ha.","heh?","heh!","heh.","hmm?","hmm!","hmm."] )

In other words Haskell looks a lot like a scripting language and you don't need a bunch of math to use it. The trouble is you have to change mindset to get used to it if you're trained as an imperative programmer. Where your natural instinct is to whip out a bunch of OO patterns, in Haskell you're plugging together functions, monads, applicatives and lenses - which all take some getting used to.

As for pissing matches, that's probably a bit too strong a term for it. I like python, have worked professoinally in it, and don't really have a problem with anyone else doing so. When I turn up saying, "oh, but it's not as good as blub language" I feel I'm being contentious. When you say, ah, but blub language has [...] I think we're engaged in a pissing match by definition. No offence intended.

Likewise I generally agree with your further points and note above I suggested both haskell and javascript to begin with. After those I'd certainly suggest java, C#, C++, ruby and python, not necessarily in that order. As for VB ... well, like you say, sometimes you don't get to choose.


Sun Oct 12, 2014 12:55 pm
Profile
Rank 12
Rank 12

Joined: Sun Oct 05, 2014 11:34 am
Posts: 82
Quote:
As for VB

Please, please, please! Don't ever say VB again! ;)

I was reading up on functional programming and found I have already started using some of the principles in Python. I also have found I don't like pure OO approaches. Those get messy really quick. It is interesting that as you program you pick up on methods you see, but don't necessarily equate them to any kind of theory. It is just "programming stuff". Then someone comes along and gives it a name (or they did 50 years ago in some paper). You see it and say "WTH is that?"

I have to say the whole "state" as a side effect idea has got me thinking. I am not sure what it has me thinking, but I think the concept is interesting.


Sun Oct 12, 2014 1:22 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group.
Designed by X-Moon Productions.