The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Unix based programming

    Discussion in 'Linux Compatibility and Software' started by NAS Ghost, May 6, 2008.

  1. NAS Ghost

    NAS Ghost Notebook Deity

    Reputations:
    297
    Messages:
    1,682
    Likes Received:
    0
    Trophy Points:
    55
    Ok, im new to unix based OSs and ive recently (thank you Thomas) put Dream Linux on my laptop to run as a VM. Ive sought to familiarize myself with this system however that will and take sometime, but at the same time i would like to teach myself some programming. Id like your opinion on the easiest language to learn (Ive heard python was good), that is also free.
     
  2. D-EJ915

    D-EJ915 Notebook Consultant

    Reputations:
    123
    Messages:
    161
    Likes Received:
    0
    Trophy Points:
    30
    BASIC is really easy to learn but you'll never use it, lol, try something like C out (ha, ha...ha) for a start, it's kind of a more advanced language but still pretty simple (as in it lacks a lot of stuff new ones have).

    Scheme might be another one, it's easier to get into, it's a LISP variant.


    It also depends on whether or not you want a compiled or interpreted language, scheme and C are compiled while python and basic are interpreted.
     
  3. hollownail

    hollownail Individual 11

    Reputations:
    374
    Messages:
    2,916
    Likes Received:
    0
    Trophy Points:
    55
    Java is pretty easy to get into, though you kinda have to wrap your head around OOP. I've always thought procedural programming is easier to pick up as an intro language.

    Languages like Prolog, LISP and Scheme are neat, but can be really difficult. Well, at least Prolog and LISP are, but I've not had much direct interaction with Scheme. I hear it's great though.

    I personally started with BASIC and a bit later touched on C and when I got to college, I worked in ADA. Ada is a great language that will force you to program well :-D But it's a bit less useful...
    After Ada, I picked up Java then moved into learning a bit of Prolog and LISP.
    If you want to count PHP and ActionScript, those are both really easy but are not clean at all (allow you to do things you shouldn't).
     
  4. Pitabred

    Pitabred Linux geek con rat flail!

    Reputations:
    3,300
    Messages:
    7,115
    Likes Received:
    3
    Trophy Points:
    206
    Start with Bash or Perl to get a feel for programming with a language with a lot of support and to get quick results. Perl is more powerful, but bash is a little easier to grok for a newbie programmer. I'd suggest Java or C/C++ after that, and the best way to do that is with a good book. Really, taking a class or two is the absolute best way to get started. See if you can take an introduction to programming course as an elective or something.
     
  5. timberwolf

    timberwolf Notebook Consultant

    Reputations:
    131
    Messages:
    288
    Likes Received:
    0
    Trophy Points:
    30
    Well, Bash is a feature poor scripting language, for example no string handling. With Bash you have to resort to using external commands such as sed, awk, tr, cut, ...
    I'd suggest learning a little Bash scripting as part learning the *nix commandline, i.e. creating bash one-liners, but don't use it as a way to learn programming.

    Personally, I don't like Perl because it is an ugly language, it can be very powerful but terse, and therefore probably not a good language for the beginner. The counter argument is that you don't have to write it in a terse way, although it's normal for people to go looking for examples and solutions on how to solve problems so you're bound to come across terse solutions.

    I'd go with the recommendation of Python, it forces a clear layout, it has clean use of built-in commands, nice string handling and it doesn't have the hidden results of Perl accessed by obscure symbols.

    The fastest way I know to create simple GUI interfaces is with tcl/tk. The tcl language is a bit odd, but combined with tk, you could follow a tutorial and be creating simple dialog boxes in a few hours.

    I'd learn C because so much of Linux is written in C, but I wouldn't start with that unless you have a specific goal that requires the C language.

    (I can't do this justice at the moment... going to be late for work!)
     
  6. srunni

    srunni Notebook Deity

    Reputations:
    96
    Messages:
    854
    Likes Received:
    0
    Trophy Points:
    30
    Another language you can start with is Python, while it has OO support, it's not so integral to the language that you can't ignore it (unlike Java).
     
  7. lemur

    lemur Emperor of Lemurs

    Reputations:
    524
    Messages:
    1,024
    Likes Received:
    0
    Trophy Points:
    55
    I agree with timberwolf. Use bash (or sh) only when absolutely necessary or when the problem is trivial enough that bash will do the trick without much headaches.

    For everything else, use python. It is a good language to solve a good range of problems. Excellent for scripts and good for small applications. It is possible to use it for large applications too but at that point other languages are better I think. But as a first language, python is great.

    I dislike perl passionately. I used to write glue code in perl. I switched to python as soon as I could.

    This is coming from someone who has professionally designed and maintained code in C, C++, Java, Perl, Python, Bash, ...
     
  8. jnev

    jnev Notebook Guru

    Reputations:
    30
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    15
    python is generally considered to be the easiest language to start off with. it has OO capabilities, but you don't have to take advantage of them, unlike java. once you get comfortable with python, you can try learning C or java.
     
  9. maditude

    maditude Notebook Evangelist

    Reputations:
    132
    Messages:
    341
    Likes Received:
    0
    Trophy Points:
    30
    If you've got a feel for what sort of projects you'd like to work on, we'd be able to give you some good suggestions. But I would definitely say that if you are new to programming, learning C wouldn't be terribly practical at this point, if you are hoping to get into a software career of some sort.
     
  10. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    Do you have a link that explains the various linux commands and their derivations....such as ls=list, cp=copy, rm=remove, grep=wtf?

    EDIT: found some of them: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-11.html#ss11.5 , but it doesn't give me the derivation of GREP for example....tells me what it does, but that's not what I'm after.

    :D
     
  11. Tailic

    Tailic Notebook Deity

    Reputations:
    78
    Messages:
    775
    Likes Received:
    0
    Trophy Points:
    30
    Is this what you are after? Just search for Linux shell commands and you can find more descriptions.

    As for programming, I also heard a lot about Python but I'm not a programmer so I really can't say much else. I'm probably going to get it in though, but right now I'm just trying to get into network administration (maybe *nix server focused but just will have to wait and see)
     
  12. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    Thanks....that's a great reference....I was trying to find how for example, grep, was deemed to be called 'grep' cp is obvious, rm is obvious, etc.....it makes them much easier to remember if you know the rhyme and reason (for me anyway). I don't think linux commands are intuitive at all, not most of them as compared to DOS commands.
     
  13. Tailic

    Tailic Notebook Deity

    Reputations:
    78
    Messages:
    775
    Likes Received:
    0
    Trophy Points:
    30
    I think it just comes from lots of usage and memorization, but I do agree, its a lot to remember.

    The compression commands are pretty easy to remember, bzip2 : bunzip2, gzip : gunzip. But it seems if you want to know those, you'll either need to man the commands or read a beginning *nix book.
     
  14. rm2

    rm2 Notebook Consultant

    Reputations:
    107
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    30
    Python or Ruby are the way to go as a beginner or as an experienced programmer looking for a higher level language. Of the two, I do prefer Python.

    There are several ways to create GUI programs with Python. The good thing is that most of them are cross platform, so your programs will be able to run also is Windows and the Mac. The most refined way to do this is with PyQt. This package allows you to create GUI interfaces with the Qt toolkit (the one used to create KDE). You can use tools like Qt Designer to draw your interfaces (much like Visual Studio) and tie them to your Python code with PyQt.

    Another way of creating powerful cross platform GUI programs with Python is by using wxPython. wxPython uses the wx library which in turn uses GTK in Linux and Windows native libraries in Windows (not sure about the Mac, but I think they were working on using native libraries there as well). Unfortunately, using wxPython is a little more complicated than PyQt, but there is a very good book available written by wxPython's maintainer himself.

    Finally, for quick and easy small GUI programs you can use Python Card. It has a very clean and easy syntax that makes it a joy to use and a snap to learn.

    There are other tools as well, but these are the ones I am personally familiar with.
     
  15. nimish

    nimish Notebook Enthusiast

    Reputations:
    0
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    5
    grep : comes from an arcane command on an ancient text editor.

    a name that actually describes it is a "general regular expression parser" but that is not where grep acually comes from.


    Otherwise, the two languages you should learn are python and C. python is quick to learn and you can do it interactively, by running python in your shell. C is if you want to seriously learn about computer architecture.
     
  16. jas

    jas Notebook Evangelist

    Reputations:
    697
    Messages:
    622
    Likes Received:
    5
    Trophy Points:
    31
  17. theZoid

    theZoid Notebook Savant

    Reputations:
    1,338
    Messages:
    5,202
    Likes Received:
    22
    Trophy Points:
    206
    thanks on both counts, you too jas.....I'll play with python....the only programming I've had was BASIC and Fortran.....was useless to me then....in the early 80's....! I was a compsci major switched over to business.....wish NOW I hadn't
     
  18. Element

    Element Notebook Evangelist

    Reputations:
    192
    Messages:
    537
    Likes Received:
    1
    Trophy Points:
    31
    I think I'll be messing around a bit with Python in the near future.
     
  19. bloodandsoil

    bloodandsoil Notebook Guru

    Reputations:
    0
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    15
    Best to learn C++