LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-28-2005, 10:00 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
Serious questions about life ( or better the life of a programmer)


Hi all .... I need to talk about sth that makes me feel bad all these days. Let me explain.. this year i ll graduate from university(school of informatics) and i ll start with my master(networks)..... I am still trying to learn programming and how to become a good programmer.... During my exams i was reading a lot and i have to say that i have very good grades.. My problem became more complex when ihad to implement in c code a difficult project for first time. From the very begginingi have noticed that i didnt have enough knowlege of how to do it.. i think there is a big gap between univeristy knowledge and good programming skills.
All this time i was continually asking to this forum (but also in to other places) "how can i do this?"
"what do u suggest me do?"
e.t.c
This days i finish the project after spending about two months working on it... but i feel really disgusting about my work... The code know can easily be referred as spaghetti code.. i am still not sure if it works completely ok.
If i have started it again i would have written the code simply better
I am thinking what was the problem for this bad conclusion.
so let me point them here
-Lack of knowledge (but u can ask whos is the guy that has the knowledge?)
-Didnt know from start what i should exactly do... I wasnt sure from start if it is needed to implement 3 or 4 function and what of them should do... For example we have to write code that does some things.... which of these things should be written ib a function? When i write function HOW am i sure that they work succesfully? What prices i return for errors and HOW i handle those errors? All these questions the most times didnt have specific answers.. I was called to solve them.. and with no success the most times. All thesequestions have one simply answer SPAGHETTI CODE
-Sometimes i have thought that uml will be a solution but i know that uml is really good for object oriented problems.. not for c programmes..
-All this time i was trying to find a way to keep notes of what is done and what is not... What variables i have and what they store.. Simple comments in source codes are not the best ways to keeping track of them because u have to open and reopen them all the time
-I was using vi for text editor.. i know how to use it but some times i was really bored quitting from insert mode to search for text and then renter insert mode to type more code..
-And a lot more stuff to say.

I am really dissapointed if i will never learn to write some good code.. I am 22 y. old and i feel dissapointed of my programming skills.
I dont know if some books like those ones will help
The art of unix programming :
http://www.amazon.co.uk/exec/obidos/...054132-7964439
(read what the book description)
Advanced unix programming:
http://www.amazon.co.uk/exec/obidos/...054132-7964439
or the other one
http://www.amazon.co.uk/exec/obidos/...054132-7964439

I want to hear your suggestions and comments.. Plz spend some time answering me... I Hope till next morning this post will have more that 100 replies
 
Old 09-28-2005, 10:38 AM   #2
logosys
Member
 
Registered: Jul 2005
Location: Texas
Distribution: RHEL4 - ES
Posts: 178

Rep: Reputation: 31
Programming can be broken down into 2 important things you need to understand. Concepts (problem solving skills) and Language (syntax and capabilities). Programming serves one purpose and one purpose only: Solve problems. When presented with a problem, you have to approach it objectively, determining what you will need to do to solve it. It doesn't matter if you're using C, C++, Perl, Java, ADA, BASIC or punchcards. You have to determine what steps you'll need to take to solve it. Then, you actually code the solution. You have to know the language you're using. Knowing a language is mostly knowing how you can put a solution into syntax, not really knowing "tricks" (although there is some of that). Let me give you an example.

You get hired to develop computational fluid dynamics software. Namely, your software is going to be deployed to long distance oil pipeline flow through cold water with possible hydrate formation. Odds are, you have no idea WTF that means. So first, you need to get the basics of the problem that you're solving. You'll look up info on intermediate fluid flow, pressure vessels and hydrate formation conditions. Then you'll consider possibilities for how you are going to have a user set up a test case. Then you're going to consider possibilites for how you are going to compute the result from the data given. In this case, you're going to want to develop algorithms that minimize the system resources (because these types of problems get HUGE if you aren't careful). After you know how you're going to solve your problem, you think "Ok, what language is best for this" C will run fast, but your user interface options are limited and your algorithms will require a lot of complex, low-level stuff. Java will run slow, but can be developed fast with a good user interface. Fortran will crunch the numbers the fastest, but will be very difficult to do anything else with. ADA will make you kill yourself. After you choose a language, or assortment of languages, you'll figure out what features of that language will help your program run the best.

If you don't know the ins and outs of every language, or how to solve every problem, don't sweat it. You're not supposed to. No one will expect you to have all the answers. The thing that people will expect, though, is that you can FIND all the answers. Google, libraries, experienced friends and message boards like this one are your best resources. To quote a great TV show - "You're not alone, don't pretend to be."

Based on what you said, you mostly just need some experience. My advice is going to take 2 prongs.
Advice 1: Get problems to solve. Best place for this? SourceForge. You can work on real problems that people are trying to solve, work in a team, and get a feel for what's really going on in the computer world. Plus, employers like to see that you're involved in the Open Source community (it promotes ethics, studies say). This is also beneficial because, if you get stuck, help is easy to find with no worry about getting fired. No one will think less of you because you don't know the inner workings of something. There is no schedule, so there's less pressure, so it's easier to learn.
Advice 2: Read code. Go to sourceforge, and look around at some of the problems that have already been solved. Look at how they were solved. What language did they use? What algorithms? Why did they do it this way instead of another? If you have questions, email the Project Manager, or post the code here, and we'll help you out. This helps you understand HOW people solved problems, all while building your coding skills. You'll be surprised how many times you'll say "I didn't know you could do THAT!"

More than anything, give yourself a break. You're 22 years old, you have lots of time left to make a lot more mistakes. No one is expecting you to be an expert, and anything you do professionally will have a safety net. Now, this won't always be the case, but it is for now, so use that to your advantage. Experiment, mess up, apologize and learn. It's the only way you'll get better.
 
1 members found this post helpful.
Old 09-28-2005, 11:06 AM   #3
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Don't cry
You know what your problem is: you're expecting too much too soon from yourself. You think that since you study CS you should be able to program without problems, but that's wrong. You can have the best theoretical knowledge you can learn in a university, but it won't help you without practical experience, and the only way to gain this is to experiment and to try.
IMO you shouldn't start with large projects but little programs, something that pops into your mind (nevertheless: think before you torture the keyboard - make a plan of what you want to reach (and how) before your enter a single line of code), like a backup script (always a good idea ).
I know, when I hadn't much experience, I didn't understand the simplest things (simple in retrospect), but with the years the understanding comes magically.

You say you're 22, I guess you've been studying for 2-3 years now; that's quite a bit late to start programming, but it's not too late.
 
Old 09-28-2005, 11:35 AM   #4
smurff
Member
 
Registered: Sep 2004
Location: England
Distribution: Mandriva 2005LE / Whitebox
Posts: 48

Rep: Reputation: 15
The Head First series of books explain good programming designs. The two replies here have been great advice but I was the same when I started out. If I look back at my old programs I could die Some skills better with age and experience. I also use koders.com and see what other people are doing.

Relax, enjoy coding. Give yourself another "small" project and learn a few design patterns and then its down to practice and experience.
Good luck
Smurff
 
Old 09-28-2005, 02:56 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, Alaois -

I can understand your frustration. But addy86 hit the nail on the head - I think you might be expecting too much of yourself, too soon. Arguably, that's to your credit. In my experience working with you, I've found you to be very intelligent. To say nothing of curious, motivated and ambitious. All, to my mind, outstanding qualities.

Please contact me via e-mail. I've got a couple of ideas you might be interested in.

But in the meantime - please lighten up. Recognize the FACT that you're ALREADY brighter and more capable than a disproportionate number of developers I've met in "Corporate America". The important thing is to ... Have Fun! Honest!

Your .. PSM
 
Old 09-28-2005, 09:38 PM   #6
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Man, keep programming and self-confidence apart, at least some time, and learn to program. Enjoy those moments of analytical rigor, and learn to code. The problem these times is that we all want to consume more in the lesser time. Many universities suck because of this.
 
Old 09-29-2005, 02:22 AM   #7
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
My experiences as a programmer: Sadly, because so many software projects go over budget and over schedule, buggy and late code is almost expected. If you happen to know your stuff though, it's also true that anyone who can deliver clean, functional code according to the existing schedule will always be considered a rock star. In other words, it doesn't really matter how much you know; what matters is how much you can figure out. Although it's a cliche, "you can't argue with results". As long as you can deliver those results, you've got nothing to worry about. Good luck with your studies and I'm sure you have a bright future -- J.W.
 
Old 09-29-2005, 11:30 PM   #8
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Programming Advice

It is my belief, that one of the single most important things in life is this: be courageous. In order to be successful at anything, you have to start with the courage to accomplish it. Don't let failure get you down: you only truly fail if you let yourself be defeated. We all make mistakes; that's how we learn.

When it comes to computers and programming, it's no different. I can tell you've got courage, because it took that to ask for help. Well, I'm certainly no expert, but I'll offer whatever I can.

First, never be satisfied to take knowledge for granted. Part of what makes a great programmer is that constant questioning: "How does this work? Why does it work? Could it work different? Could it work better?" Only by questioning the world around us can we truly become better programmers, otherwise we merely imitate what has already been done.

Second, never stop learning. The programmer's world is constantly changing; new things are popping up all the time. Yesterday it was Java and "write once, run anywhere"; today it's AJAX and web-based applications. You never know what the next big technology will be. Only by continually learning can we become better programmers, otherwise we will not be able to keep up with the constantly changing world we live in.

Third, trust in your community. The Internet has allowed programmers to come together to create something more than they ever could individually. The GNU Project, the BSD Unixen, and Linux: all are massive projects, and none would even exist without the Internet. Online groups like LinuxQuestions, too; they bring programmers together so that we can help each other. Only by embracing the global community can we become better programmers, otherwise we will remain alone, unable to achieve our goals and unable to help our comrades.

Fourth, believe in yourself. This is the simplest put and the most difficult to accomplish. But remember that even Linus Torvalds started programming on his grandfather's computer at his house in Finland. Remember that UNIX came out of a game called SPACEWAR, that Ken Thompson had written for the PDP-7. Everyone starts small, but where you end up is your choice. Only by having faith in ourselves can we become great programmers, otherwise we will fall into obscurity and become nothing.

It's rather difficult to sum programming up in four points, but I think that's pretty good. As I said, I'm no expert; but I would like to refer you to two people whom I believe are experts at the technicalities of being a better programmer. Dave Thomas and Andy Hunt, known together as the Pragmatic Programmers, wrote a book that has totally changed the way I look at programming. It's called "The Pragmatic Programmer: From Journeyman To Master"; for more information, see: http://www.pragmaticprogrammer.com/ppbook/index.shtml. I would highly recommend it to get you started to becoming a technically better programmer. I think it's really helped the way I program, and the way I think about programming.

Well, I hope I've been of some help. If you want, feel free to email me: taylorvenable@gmail.com. I hope that you are able to overcome your current obstacle. Life isn't easy; it's full of hard times, but they are only temporary. It will get better!
 
Old 09-30-2005, 12:01 AM   #9
Brain Drop
Member
 
Registered: Feb 2003
Location: just outside reality
Distribution: balanced
Posts: 752

Rep: Reputation: 35
I like the source forge idea, it is the type of thing I want to try myself, soon. But if you also want to help develop general problem solving skills, and become more fluent in the code, then I recommend working on the problems at the acm website. They have hundreds of short problems with a range of difficulty. Many of them are just delicious. They even have the online judge to check the work.

Last edited by Brain Drop; 09-30-2005 at 12:12 AM.
 
Old 09-30-2005, 01:31 AM   #10
carl.waldbieser
Member
 
Registered: Jun 2005
Location: Pennsylvania
Distribution: Kubuntu
Posts: 197

Rep: Reputation: 32
Re: Serious questions about life ( or better the life of a programmer)

Like any other skill, programming takes time to develop. Mostly, you learn to write good code by first reading and writing lots of really awful code. Programming tends to attract problem solvers, as it is a very logical discipline. After having some exposure to more code out of the classroom, you will start to develop a feel for what works and what doesn't. It can be entirely situational, too.

There is no one approach to a problem the every programmer takes. Some people like to think things out very carefully and plan everything out. Others like to code as fast as they can and go back and revise the structure of the program dozens of times. The more you do it, the more natural it becomes. Experience is the key.
 
Old 10-04-2005, 09:11 AM   #11
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Thx a lot for your replies.... but still i am not sure how to fill the gap between spaghetti code and good development... All the previous time writing code i had to face some tough tasks... for example i have writted a function that takes an oid from a snmp server now what should i do if an error ocurrs? For example how to implemet this situation just return a value as an error code and what to do the error code? Print it to the user and terminate the programme or keep trying till get what u want
 
Old 10-04-2005, 11:37 AM   #12
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
One of the best exercises that you can do to help improve your code actually doesn't involve coding.

It involves a pen, and a piece of paper.

Any problem that you're going to face (and this applies to a lot more than engineering) can be made much easier if you decompose the problem into multiple parts.

Take writing a game, as an example.

For a game you have a few things:
1 - graphics engine
2 - physics / interaction engine
3 - AI engine
4 - I/O interface

Under #1 you need things like
- Model drawing component
- Texture rendering component
- Colorizing component
- Camera interface to I/O system

Under #2 you need things like
- Object representation
- collision detection
- movement controls via I/O and AI engines
- display via graphics engine

etc..

Imagine now, trying to write a game without decomposing the problem.

You'd start by writing some way of displaying things on the screen. Then you'd make those things be whatever individual pieces you're going to have. All of a sudden your code is needlessly complex, choppy, and difficult to maintain. You have multiple functions that do the same thing with only slight differences, or even none at all.

Problem decomposition is a practical skill you can develop that will help you.

As for OTHER important skills, learning how to find information is incredibly important. Knowing how to read and write documentation, and writing descriptive code comments are all important skills.

Try taking a look at other people's code and seeing how they did what they did. Learning by using others' experiences is a huge advantage.

-Aaron
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows: 4-5 hour battery life, Gentoo : ~2:30 battery life numerous Linux - Laptop and Netbook 3 01-17-2005 08:39 PM
windows, good battery life -> fedora, bad battery life daedalusq1115 Linux - Laptop and Netbook 1 01-17-2005 06:40 AM
What should I do with my life? j03 General 22 08-21-2004 03:39 PM
Get a life ! harrygraham LinuxQuestions.org Member Intro 5 06-10-2003 08:07 PM
Life is like.... Cage47 General 11 02-20-2003 03:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration