|
Programming C, bash, Python, Perl, PHP, Java, you name it. |
|
Thread Tools | Display Modes |
|
|||
Learning how to program
I see alot of threads in this forum dedicated to learning how to program this or that and so on, but this thread is a wee bit different. I know nothing about programming. Time and time again, I've tried learning but continue running into a brick wall as far as putting everything together. I seem to only get one or two chapters into any book before running into this wall (I.E; I know and understand what an if,then statement does, but how do I integrate this into a larger project and what are some examples of projects I could work on). I took ONE programming course back in high school around four years ago, and was lost after the hello world program. This is somewhat embarassing, because as far as administering a machine, I can pick that up pretty easily (I may not know alot, but so long as there is documentation, I can pull myself along pretty much where I need to go).
Anyway, I just want some suggestions/advice on what would be the easiest programming language to start with, and some books/documentation to help me along the way. I'm determined to master at least ONE language, I don't care if it takes me until I'm 50! |
|
|||
If you have no problem in administering machines, you could start with shell programming. That way you have small tasks which you can automate with a shell script.
My experience is that many people who, don't have any problem to solve, quit learning programming rather fast.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
ephemera's point is that without a problem to solve, there may not be enough motivation to move up the learning curve. Having a tangible goal helps.
Quote:
|
|
||||
If you're used to using a unix shell, learning shell scripting is a very good idea; especially when you find yourself entering mini shell scripts into your shell prompt, rather then abusing history / line editing features lol.
In my personal opinion there is a great difference between learning programming, and learning a programming language. One is an art form, the other is just a canvas. I would also recommend reading this article sometime. Interpreted languages make a lot of things easier -> /bin/sh, Ruby, and Python are all good choices. In my experience, Pythons docs are boring as horse-crap if you're not used to the lingo, but is very handy when solving problems. Ruby is on par with Python and is a very easy language to learn (~couple hours), but the overall documentation lacks in some spots when placed along side other languages (Python, Perl, Java, C, C++). The bourne shell (sh) and related ones (bash/ksh), are about as simple as it gets;but one needs to b/p to think outside the box often, in order to manipulate data at times. If you use an editor like Vim or Emacs, that has their own internal scripting language; you might try utilizing it (vimscript/elisp) to do odds an ends.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Quote:
Quote:
@ocicat: Thanks for the references. I take a look at them, and hopefully the book will be available at my local library to at least skim over. |
|
|||
Each sequence of commands that you repeat a couple of times can be scripted. Not only configuring can be automated. Actually reporting is a more thankful target for automating.
For instance: Code:
#!/bin/sh HOMES=" \ /home/j65nko /home/john /home/robert /home/packages " CMD="du -ks" # -k : blocks of 1024 bytes # -s : grand total only (no individial files) echo "Home directory usage on $(uname -n)" date echo "===============================================" ${CMD} ${HOMES} | awk '{ total += $1 ; printf "%-30s : %10u\n", $2, $1 ; } END { printf "%+30s : %10u\n", "TOTAL", total }' Code:
$ sudo home-usage Home directory usage on hercules.utp.xnet Wed Dec 24 02:30:50 CET 2008 =============================================== /home/j65nko : 5829316 /home/john : 2686 /home/robert : 20 /home/packages : 262100 TOTAL : 6094122
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
There are three levels in which tasks can be automated:
|
|
|||
Excellent observation that is true of most things.
|
|
||||
For Perl I would recommend this book:
http://www.amazon.com/Beginning-Perl.../dp/1861003145 It's also available free online: http://books.simon-cozens.org/index.php/Beginning_Perl Perl is a good choice for administration - its powerful, has a huge library of software available via CPAN and its available on all *nix and also windows (activestate.com). oh, and it also has good support for databases. Python is interesting too. Its has a clean language implementation, is under active development (perl6 is not releasing anytime soon) and appears to be gaining some momentum. Though I wonder if its just as easy to create the one-liner tools of Perl in Python also I believe CPAN is still unmatched. Quote:
Last edited by ephemera; 24th December 2008 at 08:13 PM. |
Tags |
novice, programming |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Undertaking computer science degree, which BSD for learning professional assembly? | lionsong | Programming | 15 | 18th October 2009 11:26 PM |
Learning Content Management System | Oko | General software and network | 0 | 31st October 2008 04:02 AM |
Learning Programming | Crypt | Programming | 35 | 27th October 2008 04:54 PM |
Learning Perl | mtx | Book reviews | 7 | 22nd October 2008 05:55 PM |
Executing a c program | Libran | Programming | 13 | 12th August 2008 11:42 PM |