One Each - Best Programming and Scripting Language

Discussion in 'Programming' started by lxskllr, Dec 16, 2012.

  1. lxskllr

    lxskllr Lifer

    Joined:
    Nov 30, 2004
    Messages:
    44,383
    Likes Received:
    28
    Hi all, I've had it in my head to try some programming, but outside of programming calculators 20 years ago, I have no experience. What I'd like to do is learn one scripting language, and one that's more dedicated to programming. This is all for personal amusement, but I'd like it to be useful also. My preferences are noted thusly..

    Fairly easy for someone new to pick up.

    Wide applicability. I primarily use GNU/Linux, and that's where my interests lie, but I'd like to be able to use what I do as much as possible. Windows and Android would be nice to add also. I'm not interested in Apple at all.

    Able to use what I learn in a business environment. I'd like to get into IT in some capacity, and being able to use the skills I acquired would be a plus.

    It would be a bonus if what I learned could easily apply to other languages also.

    What I've come up with is Perl and Java, or maybe Python? Do any of you have ideas?
     
  2. douglasb

    douglasb Diamond Member

    Joined:
    Apr 11, 2005
    Messages:
    3,163
    Likes Received:
    0
    It totally depends on what you want to do. Java would cover all platforms, so that's not a bad choice.

    For the scripting language, I would recommend PHP over Perl (and probably Python over both of those). You really don't see Perl too much any more and it's probably a little more difficult to pick up than PHP or Python. If you are more interested in client-side scripting, then Javascript is the obvious choice.
     
  3. Crusty

    Crusty Lifer

    Joined:
    Sep 30, 2001
    Messages:
    12,688
    Likes Received:
    0
    C++ and Ruby.
     
  4. theevilsharpie

    theevilsharpie Platinum Member

    Joined:
    Nov 2, 2009
    Messages:
    2,321
    Likes Received:
    0
    Python for scripting, Java for cross-platform and Android application development.
     
  5. Ken g6

    Ken g6 Programming Moderator, Elite Member
    Moderator

    Joined:
    Dec 11, 1999
    Messages:
    11,754
    Likes Received:
    51
    I'd go with Ruby and maybe C#. Ruby can really do quite a lot of things. It does scripting on its own. It does web apps with Rails (though you also need to know HTML, CSS, and maybe JavaScript). It can even work with C# via IronRuby.

    Python can do a lot of the same things, via itself, Django, and Iron Python respectively. But it isn't quite as popular IMHO.

    Theevilsharpie may have a point about Java if you want to do mobile development, in which case you'll want to look into either JRuby or Jython.
     
  6. beginner99

    beginner99 Platinum Member

    Joined:
    Jun 2, 2009
    Messages:
    2,810
    Likes Received:
    2
    What are your criteria for differentiating between scripting and programming language?

    I would recommend Java to learn Object oriented programming. For some reason I feel it's much better to understand and actually use this principle in Java than say python or php.

    Also you can use it for Android development.

    For scripting the most practical use is obviously JavaScript. For beginners guide this site is pretty nice:

    http://eloquentjavascript.net/

    However for me JavaScript is a bit "funky" so I would suggest to start with java and then do JavaScript.
     
  7. LumbergTech

    LumbergTech Diamond Member

    Joined:
    Sep 15, 2005
    Messages:
    3,624
    Likes Received:
    0
    Java

    I also recommend trying ruby on rails just because it teaches you a lot of things that you can apply elsewhere.
     
  8. lxskllr

    lxskllr Lifer

    Joined:
    Nov 30, 2004
    Messages:
    44,383
    Likes Received:
    28
    Thanks guys. It looks like Java is a winner for programming, but there's no consensus for scripting. To answer a couple questions; in my head I differentiate between scripting and programming by use. Scripting to me is a quick, and sometimes dirty solution to a problem, where pretty and polish aren't immediately necessary. Programming OTOH is more fleshed out, with more thought going into the final product, which may have a fairly wide scope.

    To clarify what I mean by "best"(wasn't the best choice of words) is more like a Swiss Army knife, rather than a surgeon's scalpel. Something that may not even be the best tool for any job, but has a wide range of application, and good functionality.

    Thanks for the ideas. I'm gonna hit up Wikipedia, and try to get a feel for the languages mentioned. I have a little familiarity with Java and Python, but that's about it.
     
  9. Cerb

    Cerb Elite Member

    Joined:
    Aug 26, 2000
    Messages:
    17,409
    Likes Received:
    0
    How about 2 each? Though, both the top two are equally good for serious programming as scripting, so long as you aren't ALU-bound in performance.

    Python
    +on about every distro
    +easy to use ad-hoc polymorphism
    +tons of libs
    -not OO in the way languages made to be OO from the start are (no encapsulation, FI)
    -requires too much work to apply type-checking, sometimes (GvR likes the idea of type decorations, so maybe one of these days it'll make its way to CPython)
    -GIL in the standard implementation (need to go to Jython, Pypy, or use multiple processes, to gain speed from more CPU threads)
    -no TCO (GvR still doesn't seem to get where, much less how, continuations can help, and it's unfortunately a good solution to complicated problems, that are hard to come up with simple contrived examples for)

    Ruby
    +code blocks (who needs explicit lambas/funs?)
    +mixin-style ad-hoc polymorphism
    +good string handling right out of the box (good, as in, "oh, it's that easy, huh...")
    +Rails
    +implements a good security model, almost by accident
    -GIL in the standard implementation
    -Often slower than even Python
    -Less popular outside of Japan, but growing rapidly, thanks to Rails

    Java
    +runs everywhere
    +sometimes performs well
    +used everywhere
    -inclusion-only semantic polymorphism
    -parametric polymorphism implementation too focused on structural typing to be as useful as it aught to be (C++ templates > Java generics)
    -every wheel has been re-invented 100 times in it, because they went with a, "primitives not solutions," mindset for the standard libs
    -awkward iterator implementation
    -checked exceptions
    -GC can often cause temporarily hung programs, especially when throwing away a lot of strings

    C++
    +runs everywhere, after a fashion
    +usually performs well
    +good parametric polymorphism
    +/-no integrated GC
    -derived from C, has a lots of weird syntax
    -sometimes too many options for doing something
    -aliasing and/or not cleaning up your memory will come back to bite you. Not might, will.
     
    #9 Cerb, Dec 16, 2012
    Last edited: Dec 16, 2012
  10. Cogman

    Cogman Lifer

    Joined:
    Sep 19, 2000
    Messages:
    10,078
    Likes Received:
    12
    Pick any language you like.

    C and C++ will give you a good background which can transfer to nearly any language. They make you do most things the hard way while being pretty popular.

    Java and C# are both fairly popular languages. I prefer C# over java for niceties, however, java has a big more industry support (and a HUGE amount of 3rd party libraries/tools to play with).

    Ruby and Python are good languages to learn. I personally like ruby's syntax and style over python, but choose whichever you like they both do a good job of high level abstractions. Python has a larger following, and ruby tends to have a somewhat smaller following with less experience (a large portion of ruby developers are RoR only and have a somewhat lacking knowledge of the language itself in my experience).

    Javascript is a useful to learn language. I don't like it as a language, but it is pretty much all we have for the web. Its popularity is only going to grow as the web becomes further and futher ingrained. Sure, some techs allow different languages to be translated into javascript, however, I don't see them ever fully replacing the language. A caution, there are far too many ways to do the "wrong" thing in javascript. It would be helpful to pick up a good book on clean javascript ("Javascript: the good parts" comes to mind).

    Dart and Typescript are both promising languages IMO. I personally think that Dart is taking the right approach towards web languages and I'm rooting for its success. Typescript looks good and should help to bridge the gap between emcascript 6 and 5.

    Honestly, the only languages that I would not recommend are PHP and Perl. The two are poorly thought out languages with bizarre, confusing, and hard to maintain syntaxes. Perl has a pretty big following of zealots which will claim it has no faults (The only other language that I've seen with similar zealotry is python). Don't be fooled. Perl wasn't originally a programming language, it evolved into one... That is like having XML evolve into a programming language, it just isn't a good place to come from.

    PHP isn't really loved by many except for the inexperienced. It is somewhat of a mismatched collection of ideas. Not to perls extent, but to a significant one none the less.

    Google's Go is interesting. It has some nice ideas, and some not so nice ones. The Go community and team are extremely opinionated on what makes a good language, so if it lacks a feature you think would be nice there isn't much of a chance that it will be adopted.

    There are certainly other languages out there (D, groovy, pascal, haskell.. etc) go exploring, see what is there. You'll only gain from exposing yourself to new languages and ideas. What ever you do, it is really more important that you program. The language is not all that important in the long run.

    That is just my opinion on the state of things. Take it or leave it.
     
  11. Cerb

    Cerb Elite Member

    Joined:
    Aug 26, 2000
    Messages:
    17,409
    Likes Received:
    0
    To be more precise, neither language was thought out at all, until several iterations had come out, and people were already dependent on existing behavior.
     
  12. excommie

    excommie Junior Member

    Joined:
    Dec 14, 2012
    Messages:
    11
    Likes Received:
    0
    No one mentioned ksh/bash yet - these are the backbones of scripting, especially since you're into Unix/Linux - might even get you a high paying job in a Financial world as I've seen several large corporations using Unix systems for trading and backoffice accounting. Korn Shell is very powerful when used correctly.
     
  13. Cogman

    Cogman Lifer

    Joined:
    Sep 19, 2000
    Messages:
    10,078
    Likes Received:
    12
    I have a hard time recommending them. They do a lot of good one off stuff, however, they are less programming languages and more "Run a bunch of programs" things. Most scripting languages (python, ruby, and perl) have the ability to do the same thing in just about as clean a syntax as bash or ksh while providing lots of useful and interesting features.
     
  14. lxskllr

    lxskllr Lifer

    Joined:
    Nov 30, 2004
    Messages:
    44,383
    Likes Received:
    28
    bash is a given since I run GNU/Linux exclusively. I haven't utilized it as much as I should due to lack of need, but I've been meaning to open a book, and look for creative ways to use it.

    Thanks for the detailed replies guys. I still haven't read up on everything, but I'm leaning towards Java and Python. Java should be good for Android, and I have lots of examples to pull apart, and some things I'd like to do. Python seems robust, and popular. A good Swiss Army knife.
     
  15. excommie

    excommie Junior Member

    Joined:
    Dec 14, 2012
    Messages:
    11
    Likes Received:
    0
    Learning curve with perl vs learning curve with ksh is different (I think it is a natural progression to learn ksh, then learn perl)?
     
  16. nickbits

    nickbits Diamond Member

    Joined:
    Mar 10, 2008
    Messages:
    4,125
    Likes Received:
    0
    c# and no scripting
     
  17. Dissipate

    Dissipate Diamond Member

    Joined:
    Jan 17, 2004
    Messages:
    6,829
    Likes Received:
    0
    Scripting: Perl and Python (I put both for scripting. Python has clean syntax and it is easier to get up and running with it, but Perl can be extremely powerful if used properly and Modern Perl with things like Moose have cleared up a lot of things missing from Perl 5).

    Compiled: C# or Go

    Java is a terrible language, as is C++. Stay away from these as much as possible. They will ruin your brain. Java is plagued with a horrible implementation of generics, and C++ is a huge language that has all kinds of clunkiness and gotchas.
     
  18. Dravic

    Dravic Senior member

    Joined:
    May 18, 2000
    Messages:
    890
    Likes Received:
    0
    Python for scripting all day

    It replaced Perl for me, and is becoming the default scripting/admin language for most modern Linux distros post Perl. Many of the system admin tools have been written in python, and its usually installed by default.
     
  19. Dissipate

    Dissipate Diamond Member

    Joined:
    Jan 17, 2004
    Messages:
    6,829
    Likes Received:
    0
    If we are talking about devops/system administration, it looks like Ruby may be winning over Python, at least according to this: http://devopsanywhere.blogspot.com/2011/09/how-ruby-is-beating-python-in-battle.html
     
  20. BrightCandle

    BrightCandle Diamond Member

    Joined:
    Mar 15, 2007
    Messages:
    4,763
    Likes Received:
    0
    There is no magic right answer, there are so many languages. Picking something big and popular will ensure you can get lots of books and high quality tutorials which is the really important part for a beginner. So avoid languages outside of the top 10.

    Beyond that it doesn't matter much, to be good you'll still need to learn them all.
     
  21. Broheim

    Broheim Diamond Member

    Joined:
    Feb 17, 2011
    Messages:
    4,582
    Likes Received:
    1
    "There are only two kinds of programming languages: those people always bitch about and those nobody uses."

    I'd say your choice of Java and Python is pretty solid, but it's not about the language it's about learning to program.

    btw, I get all my e-books from o'reilly, keep an eye on their daily deals and whatever other deal they're running, you can usually find something interesting and useful.
     
  22. TheRyuu

    TheRyuu Diamond Member

    Joined:
    Dec 3, 2005
    Messages:
    5,387
    Likes Received:
    3
    Remember, if you're not learning it the hard way, you're doing it wrong. :p

    It may be beneficial to start with C regardless of what you actually want to use in the end.
     
    #22 TheRyuu, Dec 30, 2012
    Last edited: Dec 30, 2012
  23. cytg111

    cytg111 Platinum Member

    Joined:
    Mar 17, 2008
    Messages:
    2,177
    Likes Received:
    6
    what the hell? Screw ruby/python/scala/groovy/whatnot, hippies smoke it, it is not for you.

    For widest adaoptation and alignment with the industry at large : Java or C#, either one or both, no substitute... well, depending on what industry, put in C++ as a second.
     
  24. cytg111

    cytg111 Platinum Member

    Joined:
    Mar 17, 2008
    Messages:
    2,177
    Likes Received:
    6
    No? Terrible generics? Yes if you're an academic writing your Ph.D on .. generics, then perhaps.. for everyone else who just want to build houses and cars, it's a wonderful language, a language that stretches sooooo far across platforms and frameworks.
    Performance rocks too, the JVM is a rockstar. (and if you're gonna smoke that hippie crap, do it on something that lights up in the JVM, JRuby ex.)
     
  25. Dissipate

    Dissipate Diamond Member

    Joined:
    Jan 17, 2004
    Messages:
    6,829
    Likes Received:
    0
    No, issues with generics do not just come up for people writing an PhD. I was working on a project at my previous job where we had to use Java and an issue with generics came up very quickly.

    How popular a language is has nothing to do with whether or not it is a good language. In fact, I would say that Java is probably a lot less popular outside of corporate environments. It is a terribly verbose language for one thing, and not very fun to program anything in outside of work. This is especially true since it is almost always used in some kind of heavily configured IDE like Eclipse.

    Java != JVM

    What 'hippie crap' are you referring to?

    I don't have a problem with the JVM, I have a big problem with Java. In fact, I'm quite interested in other languages that run on the JVM such as Clojure and Scala, but I haven't had time to investigate them.