The First Program Language Conundrum

Posted 14 April 2012 - 01:27 PM

POPULAR

This is and isn't your typical what language should I learn first question. I have searched the forum and internet and even embarked upon some 'research' by downloading compilers and trying a couple. I suspect others have similar questions to the ones I have here so I am going to put them out in the hopes of getting some ideas.

First, I don't know what I want to do. My goal isn't to make a game or create web apps or desktop apps. My goal is to achieve a level of skill in multiple languages so as to be able to do all of these thing. I intend to devote time to refining my knowledge of programming to beyond super-guru-ninja-yoda like status. I recognize it may take years but having rediscovered the enjoyment I get from code I am willing to commit. First some background.

I haven't coded anything in years. When I did, I really didn't. I knew a smattering of basic and taught myself html when it was still required to make webpages. I once took a grade 10 or 11 class in Pascal. I am not brilliant. I did wake up at 4am today and say 'oh', felt happy and went back to bed - after playing over the Fibonacci code sample from Java I saw a couple of days ago, it finally clicked and I kind of understood what recursion is and why it is pretty damn cool.

So now for the questions:

1)Object Oriented programming is cool but: I understand what it is. What are the alternative styles of programming? In 1 or 2 lines can they be defined? When and what sort of applications would these alternate forms be better for. Strengths, limitations etc.?

2)Desktop vs web apps: I have read a lot of information that says C++ for desktop development and Java for web apps. However when I check sources and dates this seems to no longer apply. Java with its applet capability is being used to deploy simple applications on programs more and more often and as we are becoming ever more integrated the definition of what is and isn't a web vs desktop app seems to be getting blurry. Can someone possibly help me define these terms? Also it seems that while Java is evolving C++ is stagnating. Speed is no longer an issue with Java so which would be preferable?

I have played with both for about a day and the learning curve while daunting on both is not something I thing I think will make a huge difference. What I am unable to ascertain is if I study really hard and become 'fluent' in 3 or 6 months what will be the pros and cons of one vs. the other?

3)Java vs RubyI like ruby - the 'culture' around it seems kind of cool. Also it seems to be a platform where with a little learning I can contribute back sooner. What I don't quite grasp is the difference between a scripting language like ruby and high level language like Java. If ruby is a web scripting language and Java isn't doesn't that suggest Java is suitable for standalone applications?

The bottom line is I have researched and understood the history of how these languages have formed. I've written hello world's in all. In ruby and Java I've set up simple programs to compare variables, roll dice etc. I still don't understand what one does vs another. I don't understand why one was created to do things vs the others and I can't find a resource that says for type of project X, language Y is good for these reasons and bad for these. I do want to learn assembly but I need some more solid and positive feedback before that and don't plan on attempting it for at least a year or two. I would like to achieve fluency in at least 2, may be 3 languages first. By fluency I mean if I outline a relatively simple program I can sit down and code it in a few days not an in depth understanding of all the underlying concepts -- that I realize takes more time and experience.

4)Those cool graphic gamesThis is more out of curiosity but I was looking at league of legends and some MMPORGS a little while ago and I was curious as to what language they are programmed in. One of the biggest problems I am having is trying to figure out what something alook like. I read about using swing in Java so have a very basic understanding of how a front end interacts but as far as C++ and ruby go all of the outputs in the first few weeks of study are basically to a command line.

So to sum up, I am trying lots, learning little, adding questions but I still can't figure out where to start or what any language does vs others.

Responses are solicited and welcomed. Lists encouraged. A comprehensive table will make you famous on the internet -- believe me it isn't there!

Thanks in advance!

Also sorry to post in the Java forum. I looked around and couldn't find a forum for Clueless Newbies and finally decided this seemed like a good place. Sorry for any trouble.

Replies To: The First Program Language Conundrum

Re: The First Program Language Conundrum

Posted 14 April 2012 - 02:00 PM

Two Additional Thoughts:

WTF is Perl and do I want to look at it? and

Has anyone considered a book, course system to teach different languages as one in paralell so people can grasp what tools to use rather than just go to their most in depth languages? Kind of a different way to address the when all you have is a hammer everything is a nail syndrome?

Re: The First Program Language Conundrum

Posted 14 April 2012 - 02:56 PM

POPULAR

Quote

1)Object Oriented programming is cool but: I understand what it is. What are the alternative styles of programming? In 1 or 2 lines can they be defined? When and what sort of applications would these alternate forms be better for. Strengths, limitations etc.?

Programming languages can be put into two broad groups (with multiple sub-groups on each side). The first group is Object Oriented, and the other is Functional. Object oriented programming allows you to create objects which have variables and functions associated with them and also offers you a way to protect data (normally) so you can restrict what people can get direct access to. This is awesome as you don't have to rely on people using your code in the exact way you intended it to be used, but can instead provide functions which they have access to and somehow modifies the data behind the scenes; this is typically known as encapsulation. There are other types of OO programming languages known as prototyping languages, such as Javascript (not associated with Java in anything other than name), it allows you to create objects, add variables/ functions to certain instances of an object of to all objects on the fly as it is running (thanks to it being a scripting language you can accomplish this). Then there are functional programming languages, which don't really offer you any way of using objects, but instead do things more linearly offering functions and things of that sort. I am not too knowledgable of functional languages, so I won't worry about trying to go into depth on them.

In general any type of languages (functional or OO) can be used for anything, the major restriction factor is what the language runs on (such as Javascript runs in a browser, Actionscript runs in a flash/ air application, etc.). Limitations are basically all dependent on where a language runs. Java, and Actionscript run in virtual machines which theoretically make them more secure, however every once and a while people come up with ways to break out of the sandbox (vm) and get access to something they shouldn't be able to.

Quote

2)Desktop vs web apps: I have read a lot of information that says C++ for desktop development and Java for web apps. However when I check sources and dates this seems to no longer apply. Java with its applet capability is being used to deploy simple applications on programs more and more often and as we are becoming ever more integrated the definition of what is and isn't a web vs desktop app seems to be getting blurry. Can someone possibly help me define these terms? Also it seems that while Java is evolving C++ is stagnating. Speed is no longer an issue with Java so which would be preferable?

This is a difficult one, depending on what you read you may find a ton of different answers. There was a time where anything interactive on the web had to be done with Java (applets), then flash came alone and killed the need for applets by giving a better suited (or at least easier to use) development environment which non-programmers could pick up quicker. Now people claim Javascript will kill flash. The point here is that things change, a lot.

There are a ton of different languages you can use for web-based development, but you will have to use HTML, CSS and Javascript for client-side things regardless of what back-end technology you choose to use. I personally use PHP for the back-end as I find it very C-like and much easier to develope with than Java. I haven't used .net, Python, or Ruby for back-end web development, so I can't give any input here. When it comes to desktop development, there are again a number of languages you could use, all of which are nicely suited to at least part of what you would want to do. Python and Java seem to be common at the moment as you can theoretically develop your application once and run it on any OS, however if you use proper frameworks and libraries you can use C/C++ as well and just need to re-compile the program for a given OS.

As for defining a web application and a desktop application, I just go with a simple rule: If it runs in a web browser it is a web application. If it runs in its own window on the desktop (not in a web browser), it is a desktop application. Sure, the lines can be blurred at times, but I like my general rule overall.

Now, I disagree that C++ is stagnating, they just came out with a new specification for it in 2011 (C++0x11, or C++2011 depending on what you read). Java and C++ are both moving forward, just in different directions. I also disagree that speed is no longer an issue. It all comes down to what you are working on. If you are doing mass storage devices (such as backup devices or something) speed is very important, and in that case you will be working in C/C++ and Assembly. Assembly is still the best bet for programming when speed is the most important thing.

Quote

I have played with both for about a day and the learning curve while daunting on both is not something I thing I think will make a huge difference. What I am unable to ascertain is if I study really hard and become 'fluent' in 3 or 6 months what will be the pros and cons of one vs. the other?

Here it basically comes down to preference, but in general Java will likely be quicker to develop an application from start to something on the screen. C++ on the other hand will be generally faster (though this isn't a terribly large concern unless you need the application to be fast -- such as a game).

Quote

3)Java vs Ruby I like ruby - the 'culture' around it seems kind of cool. Also it seems to be a platform where with a little learning I can contribute back sooner. What I don't quite grasp is the difference between a scripting language like ruby and high level language like Java. If ruby is a web scripting language and Java isn't doesn't that suggest Java is suitable for standalone applications?

I don't know ruby so I will leave this for someone who does.

Quote

4)Those cool graphic games This is more out of curiosity but I was looking at league of legends and some MMPORGS a little while ago and I was curious as to what language they are programmed in. One of the biggest problems I am having is trying to figure out what something alook like. I read about using swing in Java so have a very basic understanding of how a front end interacts but as far as C++ and ruby go all of the outputs in the first few weeks of study are basically to a command line.

Some games these days are written in Java (such as minecraft), however they are compiled to executable (assembly), so it really isn't running on the java virtual machine in the end. In general, all serious games are written in a C-style language (be that objective C, C/C++, or Visual C++), so if you are looking into creating games I would suggest starting with C/C++.

Additional thoughts:

Quote

1.WTF is Perl and do I want to look at it? and

Perl is a programming language which was originally developed for quick text-file modification and things of that nature. I haven't used it that much but have to say it is really nice when dealing with files from what I have done with it. I also love their regular expressions (PHP has a perl-regex engine which I use quite often).

Quote

2.Has anyone considered a book, course system to teach different languages as one in paralell so people can grasp what tools to use rather than just go to their most in depth languages? Kind of a different way to address the when all you have is a hammer everything is a nail syndrome?

I don't know if people have tried this, but I would think it would add complexity to an already daunting task of learning a programming language. There are a lot of languages which do things slightly differently and if you mix them it may add to confusion. I have never had any problem learning 1 language at a time. In fact, learning a single language well makes it extremely easy to pick up another language down the road in a short amount of time.

Re: The First Program Language Conundrum

Posted 14 April 2012 - 04:23 PM

Thank you for the very comprehensive and well thought out reply!

I think it may make sense for me to work backwards down the hierarchy. So Java, them C++ and then assembly. Once I have a basic grasp on those I may come back and ask for some more help / guidance, I am guessing it may be some years?!

One last quick question - If java can be compiled to executable / assembly then doesn't that mean a Java program should be able to run at the same speed as a C++ program?

Thanks again for the awesome answer!

This post has been edited by macosxnerd101: 14 April 2012 - 04:35 PM
Reason for edit:: Removed quote

Re: The First Program Language Conundrum

And one should never split an infinitive yet we still seek to boldly go where no man has gone before.

I however have a more modest ambition for the near future -- to go boldly where many have split their infinitives before and develop a solid foundation in programming.

I wish to do this for intellectual challenge and stimulation. It would be nice if it created a skill set that I could choose in the future use to earn an income. It would be convenient if I could make a few little programs to show off to friends and release into the community. Freeware helped me a lot when I needed it and if I could learn to give back a little that would be incredible. So, what language should I learn?

pbl, on 14 April 2012 - 02:56 PM, said:

Your question does not make sense, or at least is ambiguous:

Which Language Should I First Focus on Becoming Proficient in?

And as Winston Churchill (Litterature Nobel Prize) said:

A preposition is a little word you should never finish a sentence with

Re: The First Program Language Conundrum

Make a difference between development technology and language technology.

OOP is not about language, but the way you "visualize" the program.
object oriented programming language is a language that tries to support that kind of program structure.

In OOP there are objects that do things to themselves and ask other objects to do things to themselves.

Older paradigm was "structured development" where data was considered to be signals flowing through the system made of connected "transformationa" that manipulate the signals.

The "structured" was borrowed from general systems theory, and the idea was that transformators shoul only be connected in series, parallel and as feedback.

Also the famous DFD was borrowed from the general systems theory. It was called "generalized cirquit".

As you can observe, most popular programming languages are structured. Sequential clauses = series, ifs and cases = parallel, loop = feedback, so programming language technology and software development technology are different things.

About the languages:
C++ web-programming is not supported too well. There are not many good libraries. In java, there is quite a lot of stuff.
The same goes with smart phones.

If you want to get well employed, the languages C++ and java are the most widely used in your list. C++ is well supported in desktop programming.

Re: The First Program Language Conundrum

Posted 15 April 2012 - 04:15 AM

Magooguli, on 14 April 2012 - 01:27 PM, said:

1)Object Oriented programming is cool but: I understand what it is. What are the alternative styles of programming? In 1 or 2 lines can they be defined? When and what sort of applications would these alternate forms be better for. Strengths, limitations etc.?

There are many different paradigms of programming, some programming languages are biased into a particular paradigm.

In terms of strengths and weakness, I suggest you learn at least the major types and find out for yourself!

These are tools, and they can be used in an infinite combination to solve problems.

Magooguli, on 14 April 2012 - 01:27 PM, said:

2)Desktop vs web apps: I have read a lot of information that says C++ for desktop development and Java for web apps. However when I check sources and dates this seems to no longer apply. Java with its applet capability is being used to deploy simple applications on programs more and more often and as we are becoming ever more integrated the definition of what is and isn't a web vs desktop app seems to be getting blurry. Can someone possibly help me define these terms? Also it seems that while Java is evolving C++ is stagnating. Speed is no longer an issue with Java so which would be preferable?

I have played with both for about a day and the learning curve while daunting on both is not something I thing I think will make a huge difference. What I am unable to ascertain is if I study really hard and become 'fluent' in 3 or 6 months what will be the pros and cons of one vs. the other?

The boundary between Desktop vs Web is slowly eroding. Classically Web applications are "Sever Client" model. Desktop applications use to be "Self contained". Web applications are sand boxed inside a browser with no access to the host file system. However even this is changing.

Modern applications can be through of as "Fat client (aka desktop application)" and "Thin Client (aka web application)"

In terms of technologies, stop worrying. You can program in just about any language, BUT what you need to be aware of is

"Server Side Language" and "Client Side Language".

In terms of becoming "fluent" in f months, forget it, try 10 years. Sure you can be competent possibly in 6 months, but you certainly can not master it in "6 months"

Magooguli, on 14 April 2012 - 01:27 PM, said:

3)Java vs RubyI like ruby - the 'culture' around it seems kind of cool. Also it seems to be a platform where with a little learning I can contribute back sooner. What I don't quite grasp is the difference between a scripting language like ruby and high level language like Java. If ruby is a web scripting language and Java isn't doesn't that suggest Java is suitable for standalone applications?

The bottom line is I have researched and understood the history of how these languages have formed. I've written hello world's in all. In ruby and Java I've set up simple programs to compare variables, roll dice etc. I still don't understand what one does vs another. I don't understand why one was created to do things vs the others and I can't find a resource that says for type of project X, language Y is good for these reasons and bad for these. I do want to learn assembly but I need some more solid and positive feedback before that and don't plan on attempting it for at least a year or two. I would like to achieve fluency in at least 2, may be 3 languages first. By fluency I mean if I outline a relatively simple program I can sit down and code it in a few days not an in depth understanding of all the underlying concepts -- that I realize takes more time and experience.

Again, you can use almost any language for either server side OR client side. Stop thinking in a "X vs Y" mentality.

Its NOT about the language (its about the framework).

You say you want to learn a few languages and I will come back to this point.

Magooguli, on 14 April 2012 - 01:27 PM, said:

4)Those cool graphic gamesThis is more out of curiosity but I was looking at league of legends and some MMPORGS a little while ago and I was curious as to what language they are programmed in. One of the biggest problems I am having is trying to figure out what something alook like. I read about using swing in Java so have a very basic understanding of how a front end interacts but as far as C++ and ruby go all of the outputs in the first few weeks of study are basically to a command line.

Graphics programming, is another level, it really depends on platform specifics. There are many ways to do it example:

Re: The First Program Language Conundrum

Then there are functional programming languages, which don't really offer you any way of using objects, but instead do things more linearly offering functions and things of that sort.

Not exactly. Procedural languages, I think is the term for what you're thinking of. C, Pascal, Basic, and so forth, are languages which define a program as a set of steps. You go through the steps one by one until you reach the end, and you report an exit status, and you're done.

There might be "functions" in these languages, but they could be better named as "subroutines", since they're really sort of detours in the program flow.

Now consider a language like Lisp (the granddaddy of functional languages) in which a program is composed of a set of functions, period. Rather than an expression b+c; you'd have a function (+ b c). The order of the pieces doesn't matter, but what's important is what each of these is. The algol-style syntax indicates a series of instructions which more or less translate directly to the machine level: load value from each of two places in memory, evaluate their sum, and return the result. The lisp-style syntax is a little different. It indicates "evaluate this '+' function, taking these two expressions as the arguments to it". It doesn't know what those expressions are, and crucially it doesn't know whether a and b are values or functions - in a lisp, there's no difference.

I think that's the crucial thing about a functional language: functions and data are not separated in the language. This is a hard one to get the mind around, but once you get there, it offers a lot of advantages.

Rather than distinguishing between them and insisting on one correct label for each language, I think it's important to look at paradigm cases and understand what make a language procedural, or functional, or object-oriented, and apply each term as appropriate.

For procedural languages, the paradigm would be classic BASIC: a numbered list of instructions, to be executed in sequence. For functional languages, lisp: a program is basically function composed of functions. You evaluate the function, and there you are. For object-oriented, there's a lot of argument, but Java is pretty close to a paradigm case (an object-oriented language with a procedural definition language baked in, if you like). Smalltalk is apparently the better case, but it's not an example most people are familiar with.

Re: The First Program Language Conundrum

Posted 15 April 2012 - 08:51 AM

On perl: perl is a glorious mess. It was originally an amalgamation of features from the various unix shells, plus awk and sed, plus whatever else Larry Wall had in his head. It's an absolutely brilliant language for text and file manipulation, which is probably why it was adopted as the first real CGI power language. All of the web 1.1 e-commerce stuff was perl-powered, and a lot of it probably still is, underneath. As betawar says, it's the source of all the modern regex, and regex is probably a pretty good standin for the language as a whole: incredibly powerful, incredbly compact, technically superb, brutally flexible, and almost perfectly unreadable.

The last, of course, is why it's never used in large-scale development, but the rest of that list is why most serious programmers of a certain generation always reach for perl first for system tasks.

It's the duct tape of the internet, the Swiss Army chainsaw.

For a great example of most of the features of perl - flexibility, power, unreadability, look up "JAPH" on wikipedia. Just have someone around when you to it, to reboot your brain in case you try to read some of the code.

Re: The First Program Language Conundrum

Posted 15 April 2012 - 08:54 AM

Quote

I think it may make sense for me to work backwards down the hierarchy. So Java, them C++ and then assembly.

I will have to say start with Assembly first, you will write better code in the HLLs when you learn them. You will have a deeper understanding of what goes on "behind the scenes" How and why your code gets compiled a certain way for a CPU. You will have a deeper understanding of memory/arrays/loops/everything in general. There is a great pleasure of being able to write low level code and "talk" with the CPU.

Re: The First Program Language Conundrum

Posted 18 April 2012 - 12:36 PM

While language choice is important, I feel it's much more important to learn how to abstract ideas and principles separate from languages. Then when you have a problem, you can pick out which would be the most useful language to use.

Now for your questions. OOP is most useful for things that lend naturally to object abstraction such as games, graphical interfaces, and the like. Don's let OOP partisans convince you it's the One True Paradigm. Most of the time it'll only make things harder or more bug prone, especially if you try to apply the obhect metaphor to every little thing.

Next, avoid Java as your first language. It teaches to approach things with a "plumber in a hardware store" mentality. A side effect of being OO in my opinion, but that's just my own conjecture. It isn't too bad for fast production once you're knowledgable, but I avoid it. Also note that Java will never be as fast as C++ owing to being interpreted/JITed at best.

I can't comment on Ruby much but I'd say regardless that either Perl or Python would be better.

I'd recommend either Python or C/C++ as a good entry point. C/C++ is sufficiently low enough to teach you many useful things; C is the mother tongue of UNIX and is indispensible if you ever try system programming. Python is easy and powerful, and is the top dog of scripting.

As for other languages, Perl has its uses especially for small scripts, and a suitable stand-in for awk and sed. I also recommend Common LISP, the mother tongue of AI. Often what you do in other languages, CL can do it better and more elegantly; it's also great for learning and is powerful in many regards no other language can match.

Now as for the question regarding how fast you'll grow, read Norvig's essay "Teach Yourself Programming in 10 Years". Look into Eric S. Raymond's "The Art of Unix Programming" for some good points. And some good books are K&R or K&R2 and ANSI Common Lisp.