SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Java is one language that's lost a LOT of mindshare over the last decade. Its current niches are being taught as a first language to people learning object-oriented concepts, and being used in large legacy enterprise systems that were written a long time ago and still need to be maintained. A direct result of the second niche is that most Java libraries are just horribly overdesigned and overengineered. It has also failed to attract new developers (who have any desire to use it for more than the one year they are required to), which means its user support is stagnant and sparse.
The following questions should give you an idea of where Java is:
I love perl, and have been using perl for a living for fifteen years, but I do not recommend learning perl until after you have learned awk, sed, and tr. Otherwise you will never learn how to use them, because perl does everything they do (and in similar ways).
You should start with sh (which on most linuxes is bash in legacy compatability mode). Take a look at /etc/rc.d/rc.* and *.SlackBuild on your Slackware system to see what it can do (often with awk and tr), and what it is commonly used for.
For practice, you could customize your /etc/rc.d/rc.local (and similar) to automate administrative tasks you normally have to do by hand when a system boots up (if any).
You could also write SlackBuild scripts for making slackware packages out of applications not currently in the http://www.slackbuilds.org repositories. If there are any packages you use for your work which you currently have to build/install manually from sources, that's a good place to start. I'll be writing one for GlusterFS sometime along here, since it's a very useful service for me but takes a little wrangling to install on Slackware from sources.
For a next language, I'd heartily recommend perl or python. Perl has a long history of sysadmin use, and http://www.cpan.org/ is full of useful modules that do the heavy lifting for you for many common tasks (like https://metacpan.org/pod/LWP::Simple for fetching contents from remote websites). Python is a new up-and-comer, with fewer modules but perhaps more marketability (everyone likes the new hotness for new projects).
Whatever language you decide to learn, find its IRC channel (like #python on chat.freenode.net, or #perl-help on irc.perl.org) and hang out there to ask questions. Experienced programmers dedicated to helping out the newbies will put you on the right path. Go through a couple of tutorials first, though, as seen at http://perl-tutorial.org and http://learnpythonthehardway.org or they'll just tell you to read a tutorial and come back. There are programming forums on http://www.linuxquestions.org of course :-) and also on linkedin.
For a next language, I'd heartily recommend perl or python. Perl has a long history of sysadmin use, and http://www.cpan.org/ is full of useful modules that do the heavy lifting for you for many common tasks (like https://metacpan.org/pod/LWP::Simple for fetching contents from remote websites). Python is a new up-and-comer, with fewer modules but perhaps more marketability (everyone likes the new hotness for new projects).
I don't know if the "fewer modules" part is true (it may well be), but I do know that lack of modules is a problem that you will never experience with Python either.
The Python counterpart to LWP::Simple, btw, is requests.
Ok, so lets talk Java quick. I'm contemplating learning that, along with BASH. Good? Bad? Seems well supported,and used on multiple platforms. I have friends who have experience programming in it, and I have access to some Java Programming videos as well. But I want to know how it is in combination with Slack. I'd like to hear from you all why and why not to do it, anyone here have strong experience in Java programming?
I do. I've been programming in it since the turn of the century. I've used JDEE (Java Development Environment for Emacs) for almost 10 of those years and I've used NetBeans for the remainder.
FWIW, I've been dicking around with programming since 1976 (and made a living from it since 1995). I know Fortran 77 (first language), Pascal, Forth (several dialects), Basic (several dialects), Common Lisp, Emacs Lisp, C, C++, Python, Scheme, Ruby, Java, Groovy, and various assemblers (mainly 8 bit processors). Oh, and I know some Perl (to my immense shame) and a tiny bit of Objective-C. Been there, done that, bought the T-shirt, and the T-shirt has holes in it from too much washing.
And I know Protel and OO-Protel (which will tell some of you one of my employers).
Java's not a bad language and has gotten better over time. Anything that you'll create in that language will be a class so I think it's a good language to teach object oriented skills. Its syntax is not that far off from C and C++, so if you know either of those two, Java is not much of a stretch.
I'm gonna stick my neck out and promote 'C' (after you have checked out bash, sed, awk,tr, etc - in short, 'shell scripts')
'C' is a 'small' language, meaning that you can actually remember most of the library functions and their arguments and the language built-ins - I don't think that is true in _any_ other language. I have been through most of them in my time - but always come back to (and prefer) 'C'. Besides, there is nothing that will run faster! I shall gladly admit that if you are into object-oriented programming, 'C' should not be your choice - but hey - I just love it to death. My job mostly deals with pumping huge amounts of data through a lot of machines - there is nothing that will beat 'C' in this aspect.
I started off with fortran (like so many others of my (somewhat advanced) age), combining it with assembly, you could do almost anything. However, I've never looked back after meeting 'C'.
Good luck to you anyhow - whatever path you choose!
I don't know if the "fewer modules" part is true (it may well be), but I do know that lack of modules is a problem that you will never experience with Python either.
You're right, python has quite a few modules racked up. After deduplicating the entries from https://pypi.python.org/pypi/ it comes to 38,234 packages, which is a lot by any measure. I only wrote python for a living for a couple of years, but found a great many powerful tools in that time (some of which were full-fledged frameworks, like Twisted).
If I hadn't grown accustomed to the 164,860 perl packages available at CPAN, python's collection would seem like a lot. But with perl in decline and python on the rise it's just a matter of time before python catches up.
If you don't know how to program or what programming language to pickup for your first, I'll make a suggestion: Python.
Python is a modern and practical language. It's also cross platform: If you're on your Slackware box, type `python` into the terminal and say "Hi". If you're on Windows, I'm sure you'll have no problem finding the installer on the python website.
Next, you'll need some learning material... Good thing there's a huge list of books here! There's something like 40 Python books in that list, ranging from absolute beginner on up to advanced topics. A few of them are kinda dry, others are more fun, some are more like cook books. There's enough there that you can skip around between them depending on how fast you're picking things up.
As someone who learned to program not so long ago (and I'm still learning), I wish someone had just told me to use Python and give me a fat list of tons of cool books to read and type programs from, so that's what I'm doing. Stick with it, read, program, learn - only you can hold yourself back at this point.
And Thank you Myk267. Also, Richard, I might check out Java after some playing around with Bash and Python. And thank you everyone else, you all have been very helpful, once again. +1
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
On top of what other folks have said let me encourage you toward shell programming (whether with BASH or KornShell or whatever shell programming language tickles your innards); I happen to use KornShell exclusively, taught a course at a university in it and have found it stable and usable since, oh, the late '80's. BASH (Bourne Again Shell) is a rewrite of the Bourne Shell with functions and features of KornShell thrown in by the Free Software Foundation so as not to infringe AT&T copyrights on sh (the Bourne Shell) and ksh the KornShell. Enough history.
Shell programming (I really don't like the word "scripting" to describe what you do with a shell programming language) can get you a long, long way toward understanding programming concepts, program structure and the what, who, why, where, when and how of things. If you go look, you'll see hundreds of shell programs that help make up the tools and utilities you find in Slackware (and other Linux distributions). If you do something like
Code:
file /usr/bin/* | grep POSIX
you'll see what I mean. Shell programs are all over the system (and you don't even know that they're there when you use them).
Shell programs can make decisions (if condition, else if condition, else), do loops, do arithmetic, execute utilities with arguments and use the output of them, pretty much anything you wish to do in a programming environment you can do with the shell -- and not necessarily just as a quick-and-dirty, but as actual production software.
Much of what you do in programming is text. You manipulate text, you alter text, you do what needs doing with text. The shell, in combination with utilities such as sed (the streaming editor), awk to only name a couple is used to perform useful work (including work done with compiled programs; you can filter and manipulate arguments to be piped into a compiled program). You also do the basic type a command and the shell executes that program for you, it's the interface.
One of the hardest things to do in computer programming is deciding what you're going to use to solve which problem. Programming breaks down into a three-step process: what have got, what do you want and what do you have to do to get there (that last is the hard one). The shell can go a long, long way toward solving much of that.
You've not going to do mathematics with the shell, you'd do that with C or FORTRAN (yes, Virginia, FORTRAN is alive and well for Big Math) or some other option. If you learn C++, you've also learned (pretty much) Java (which is really just C++ without structures and pointers and some bells and whistles thrown in).
At the bottom of everything is Linux (Linux is the kernel, all the rest is utilities that talk and listen to the kernel). Right above the kernel is the shell and above that is everything else; wouldn't hurt to know it.
The other thing you really want to learn are regular expressions -- which, at first glance look like gobbledegook (and kind of are actually). Regular expressions, once mastered, make your life a whole lot easier because the same syntax works in just about everything: the shell, the editors, utilities like awk, you name it.
Take a look at rosettacode.org: it shows examples of the same task coded in every language you can think or have heard of... you can get a feel for the syntax of the languages...
Many languages are customized for a task -- like tk can make widgets; openGL can do graphics, etc. etc.
C is great language to understand the hardware -- you have to allocate the correct amount of RAM for various types (integers, long integers, etc.) However, mistakes in code can cause buffer overflows and other things that could compromise security. Some languages, like common lisp, that are not as low level as C, will do the type casting and memory allocation for you.
I like common lisp -- it's stood the test of time, and it has lots of bindings to other languages, such that it is like a programming language that can program in other languages for you; for example, instead of having to learn TK, I can load lisps bindings to tk (a system called ltk) and then manipulate widgets using standard lisp syntax that I got used to -- I figured if it could program the space shuttle, lisp could do anything I needed... And its syntax is derived from lambda calculus, and isn't just arbitrary constructs--as such there are lots of parentheses, but with the color coding and indenting provided by emacs, its not hard to keep track of the parentheses.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.