LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Wanting to Start Programming (https://www.linuxquestions.org/questions/programming-9/wanting-to-start-programming-448970/)

SimpJee 05-27-2006 01:04 AM

Wanting to Start Programming
 
Hello, I'm looking to start programming (again). I took a really general programming class in high school and was fairly interested, yet I've forgotten most everything I learned. Now I'd like to start learning how to program in Linux, or ... well that's the goal.

So I'm looking for suggestions on how to start programming, eventually leading me to programming in Linux. Books to read, which languages to start with, where I should progress from there, etc.

Thanks in advance, and I look forward to starting up programming again :D

introuble 05-27-2006 01:58 AM

Get familiar with Richard Stevens and Knuth's works.

Tony Bradley 05-27-2006 06:10 AM

I can sympathise with SimpJee, being a newbie programmer myself.

I can do simple programs (ie hello world type progs), but have come up against the problem of using libraries. How do I know if a library contains a function that I need? Even if I were to know which library name was needed, how do I invoke it...
just include <libraryname>? What if libraryname is in another directory? Would the books by Stevens and Knuth suggested by introuble help me here?

graemef 05-27-2006 09:13 AM

Decide what it is you want to do. This might be to learn a particular language, to perform a specific task. But get focused, goal orientated, because that make it easier for others here to help you when you have a problem, because you problem will be specific.

graemef 05-27-2006 09:15 AM

Quote:

Originally Posted by introuble
Get familiar with Richard Stevens and Knuth's works.

With all due respect to the above authors they are not for the beginning programmer. They cover important material but require a programming foundation to get the most out of their work.

dosnlinux 05-27-2006 09:28 AM

what language are you looking to program in? Learning Bash scripting would be a good place to pick up some of the basics of programming. Try The Advanced Bash-Scripting Guide

exvor 05-27-2006 11:55 AM

all libraries have an assoicated include files. The include files have the fuction / macro / other definitions.

in C for example in a simple program
Code:



#include<stdio.h>

int main ()
{
  printf("Hello world\n");
 return 0;
}

#include<stdio.h> this will use the standard library located in a system include.
also #include"mylib.h" this will use a include file located in the same directory that the source is.

.h files are header files. libraries are linked at compile time

on linux thats usally /usr/include, /include, /usr/local/include

these are where the include files are like math.h witch gives math functions.

when compileing you need to include in the compiler command where the libraries are if they are not part of the standard libraries.

SimpJee 05-27-2006 02:14 PM

Quote:

Originally Posted by dosnlinux
what language are you looking to program in? Learning Bash scripting would be a good place to pick up some of the basics of programming. Try The Advanced Bash-Scripting Guide

This looks like a good place to start. I'm not sure what language I want to program in, what do you guys think is the most usefull language to learn for Linux? C, C++, Java, Perl? I have no idea heh ...

Thanks for the help so far guys.

slzckboy 05-27-2006 02:28 PM

There really is no simple answer to your question because each language has its particular strengths depending on what you are applying them to.

I would recommend C but for every recommendation you will get a different opinion.

As graemef said,you will need to do some reading and try and narrow your goals,then choose a languge that best satisfies your goals.

On a side note I bough a Linux programming book,but then I put it away for 6 months and just concentrated on a programming language (C).
When I went back to the Linux programming book it was Sooo much easier.

Learn the basics first,in what ever language you choose before trying to apply it.
(IMO).

Good luck.

graemef 05-27-2006 02:45 PM

I'd also recommend C as a good language to start with - so that's at least two more post expected with people suggesting another language ;)

However, it doesn't have to be C, I believe that C will provide you with a much better foundation but you may find it easier to start with a scripting language such as Perl, Python or PHP. Get comfortable with that language and then go to C.

Look for a tutorial and see how the tutorial works for you and maybe you find a tutorial for some wacky language that just does it for you, fine go with that and get comfortable. A lot of programming is about learning to think like a programmer the rest is just confidence - okay there is a little syntatical fluff here and there; but most importantly enjoy it.

SimpJee 05-27-2006 04:32 PM

I think I'll start off with C then. I'll make sure to come back if I have any specific questions.

Thanks again guys, all of you have been very helpful :cool:

introuble 05-28-2006 07:40 AM

Quote:

With all due respect to the above authors they are not for the beginning programmer.
Hmm .. :-) You're right. I'd recommend reading K&R The C Programming Language first.

Quote:

I think I'll start off with C then. I'll make sure to come back if I have any specific questions.
Definitely:

-> The C Programming Language [ K&R ]
-> Advanced Linux Programming [ advancedlinuxprogramming.com ]
-> The Art of Computer Programming [ Donald Knuth ]

For network programming:
-> (QuickStart:) Beej's guide to Network Programming [ beej.net ]
-> Unix Network Programming [ Richard Stevens ]
-> TCP/IP Illustrated [ Richard Stevens ]

Also, remember man(1) is your friend ;-)

C might not be the easiest of languages to handle .. but in a UNIX world it can come in very handy.

If you want something that will get you programming quickly, I recommend Python.

JockVSJock 05-28-2006 08:24 AM

Hey, I'm kinda of wanting to get better at programming too...my job requires me to program in sql and pl/sql, but I want to learn more than just that.

I've had a few programming classes in college (php, c, and c++, and Linux) but I've forgotten most of it cause I don't use it on a daily basis.

I'm messing around with perl and shell programming, in the hopes that programming becomes second nature.

cheers!

slzckboy 05-28-2006 08:50 AM

Quote:

Originally Posted by JockVSJock

I've had a few programming classes in college (php, c, and c++, and Linux) but I've forgotten most of it cause I don't use it on a daily basis.

If your interested then the only way around this is to put aside some free time to write programs.

read,..write code ....read some more,and then write more code..

:D

dive 05-28-2006 09:08 AM

For some basic online c/c++ tutorials you can try these:

http://www.cprogramming.com/
http://www.cplusplus.com/


All times are GMT -5. The time now is 09:35 PM.