ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Distribution: Ubuntu Feisty Fawn, Fedora 7, Windows XP
Posts: 91
Rep:
Programming suggestion
Hey Gang,
I wanted suggestions from the programmers here. I've made the decision to go to my community college for an A.S. in programming. I am in an ongoing learning process with Linux, I am by no means an expert. Other than continuing to learn Linux, is there anything you guys would suggest I do to prepare myself? Read a particular bookn, certain exercises? I know there will be study groups, and there can be hand-holding with teachers if I have any problems. I'm pretty bright, so hopefully there won't any be any major problems. There will be problems I'm sure though. So if you guys have any suggestions, constructive criticisms or 'eye-openers', I'm open to them.
Do you already know how to program? If not, I suggest you do a google search for C/C++ tutorials, and use GCC to try them out. Also, you may consider trying to make some programs for windows (since you will most CERTAINLY be learning that in collage), try using the Borland, Bloodshed, or free MSVC++ compiler.
Read up and understand pointers!!! I've known alot of people who simply can't understand pointers, so they never use them (and they always find very creative ways of coding without them). YOU MUST LEARN TO USE POINTERS TO BE ANY KIND OF PROGRAMMER!!!
General hardware workings are a plus. Sometimes, though not always, knowing HOW your computer works may help you avoid a nasty bug in your program.
All the rest is mostly expirience, so if you want to goto collage and blow off your teacher's socks, then start learning to program (it isn't hard)!
Distribution: Ubuntu Feisty Fawn, Fedora 7, Windows XP
Posts: 91
Original Poster
Rep:
Nerd,
Currently I don't know the first thing about programming. I know what I've heard: it can be tedious and it's very logical. The logical part bodes well for me. Tedious not so much, but it's also my understading that you can make ways to streamline specific parts (commonly used commands?). I do have a pretty good idea of what each piece of hardware does, how it works and so on. Believe it or not, I believe the college I'm going to uses Unix for programming. So, I imagine Windows won't be the only OS we program for. Thanks for the advice Nerd.
If you believe that programming will be tedious, why would you want to make it your life's work? Or did tediousness lose its pejorative nature while I wasn't looking. Just curious.
Read up and understand pointers!!! I've known alot of people who simply can't understand pointers, so they never use them (and they always find very creative ways of coding without them). YOU MUST LEARN TO USE POINTERS TO BE ANY KIND OF PROGRAMMER!!!
Distribution: Ubuntu Feisty Fawn, Fedora 7, Windows XP
Posts: 91
Original Poster
Rep:
I meant tedious in the nicest way possible. It's my understanding that some parts are tedious, but it's something I have NO experience with. My outlook could change once I start doing it. Making the computer doing what you want by telling it to do what you want (not what someone else has created) has always made me curious. It is truly something I believe I want to do. However, plans change and so do people. As it stands, it's something I want to do.
At the risk of going OT, you cannot program effectively even in Java without understanding at least a little bit about how pointers work. Java still has pointers (or "references") even though you can't see it. Try this code:
Code:
import java.util.Vector;
public class Test {
public static void main(String[] args) {
Vector<String> x = new Vector<String>();
x.add("foo");
Vector<String> y = x;
y.add("bar");
Vector<String> z = new Vector<String>(x);
z.add("lolcats");
System.out.println("x = " + x);
System.out.println("y = " + y);
System.out.println("z = " + z);
}
}
Which produces this output:
Code:
x = [foo, bar]
y = [foo, bar]
z = [foo, bar, lolcats]
Because x and y are references to Vector<String> objects, assigning x to y actually assigns the reference to y, not the actual object. The result is that x and y both refer to the same object, so when you appear to add an element to y, the change is reflected in x as well (since they're the same thing). On the other hand, using the right constructor when creating a Vector object copies the elements inside the source Vector (which may or may not themselves just be references -- hence the difference between a shallow and a deep copy -- according to the documentation this "copy constructor" uses an iterator on the supplied collection, which results in a shallow copy), so adding an extra element doesn't change the original.
See how important pointers ("references") are in Java? But there are some languages that forbid aliasing like this.
It's been shown that the best programmers use both sides of their brains: artistic/analytical to design code, scientific/logical to do the actual coding.
The 'tedious' part is simply attention to detail/patience, without which you'll have major issues eg debugging in particular.
As an example, error msgs do usually 'tell you' what's wrong, it's just that they do it from the SW tool's point of view, not yours... sometimes it's more like a hint.
As mentioned, ptrs/references are worth knowing, although I'd start with the basics first.
and when you are half asleep doodling on your pad and someone asks you a question
say:
"er, sorry I don't quite get what you mean there"
hopefully they'll repeat it
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.