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!

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:

Originally Posted by Solaris_Delta

...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.

My suggestion would be to start with Python given that its syntax is perhaps the least obtrusive, & dynamic languages tend to hide many implementation details that C/C++ programmers have to overcome. As for what books, etc., consider:

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.

Why do you wish to learn programming? <blunt but well meaning question>

My ultimate goal is to become a database administrator. I know how to set up machines and get certain services configured, but I know I will have to have knowledge about PHP, MySQL, etc but the difficult part is finding problems which would allow me to learn the skills and then put them to use. So, I guess the problem has been finding real, attainable goals.

Quote:

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.

Another problem. Once I get things set up on my FBSD system, they are pretty much set in stone. This may change over time, as I learn more and more (tonight, I'm going to experiment with making jails), but right now I can't think of anything that needs to be automated which as I understand it is the biggest use behind shell scripting. Such scripting knowledge would be useful on the Windows side, where I could automate things such as virus scans, defrags, and disk cleanups.

@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.

Tasks from simple to moderate complexity can be scripted through shell scripts. Given that shells capable of executing Bourne shell scripts are ubiquitous throughout all the Unixes, writing to this lowest common denominator is a skill worth learning. It is the first tool you should take off the shelf.

However at some point (& you will learn this through experience...), shell scripting will not be able to handle all tasks, or to do so will become quite cumbersome, so reaching for a dynamic language such as Python or Perl will be better choice. As stated before, Python is perhaps easier to learn & read, but the add-on modules to Perl was more mature, & a number of books exist explaining how to use Perl to make database administration easier:

If database applications are either that useful, complicated, or require professional polish, they can or may be required to be written in C/C++, complete with GUI interfaces. However note that GUI libraries are also available for Python & Perl, so the divining point is blurred.

The advise you have received in this thread is grounded. Without a specific problem to solve, you will tire of programming & move to other tasks. If your ultimate goal is to be a DBA, learning shell scripting followed by some of the dynamic languages are skills you will use time & again.

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:

Originally Posted by Solaris_Delta

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).

Get a good book, find a quiet place where you won't be disturbed and keep your laptop beside you and try out the examples on the computer (<- and this is very important). Also try solving the exercise problems at the end of the chapter (if any). And don't be in a rush to finish the book, take your time and I am sure you will find the experience quite enjoyable.