LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-23-2005, 01:09 PM   #16
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31

QUOTE :: by schneidz
"#1. - make it work.
#2. - make it work better.
#3. - make it look pretty."


how true , how true ...
infact to rephrase al steven from Dr. Dobb magazine :

#1. - make it work , is my first attempt and i'm the only one who use it

#2. - make it work better , is when i attempt to reuse some code for my 2nd program

#3. - make it look pretty , is when i finally try to publish it just for fun and for some kick , and feels like having your pants down infront of the public , so forget about "If It Ain't Broke, Don't Fix It" , its rather "If It Ain't Beautiful , Paint It !!" ...


 
Old 11-23-2005, 02:57 PM   #17
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Personally, I only use Pseduo code when I am going to publish some sort of code example I would like to share with my friends... it makes it alot easier to reimplement into other languages then trying to first translate the syntax of a language you don't already understand...


as an extreme example- it would be MUCH better to write something in psuedocode than assembly language... that would be too plainful for 99.9% of the population lol
 
Old 11-23-2005, 03:58 PM   #18
BillyGalbreath
Member
 
Registered: Nov 2005
Location: Houston Texas
Distribution: Debian Sid
Posts: 379

Rep: Reputation: 31
Like many that have posted here, I too just start coding. I like to start on the back-end of things then later on give it a pretty smile. Some of my friends dont see how I can do that on the bigger projects. I'll tell you what I always tell them: The bigger the project, the more fluid it is going to be. I change my mind almost constantly while programming. I create new ideas, I scratch old ideas, etc. If I am to try and write/draw the program out on paper, in the end it wont look and act anything like that at all. Planning is a waste of time. Just go with the flow.
 
Old 11-23-2005, 04:03 PM   #19
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
If I am to try and write/draw the program out on paper, in the end it wont look and act anything like that at all. Planning is a waste of time. Just go with the flow.
I agree, and I try to carry that motto on to my real life also.. Planning is a waste of time. Just get drunk, er..um.. Go with the flow.
 
Old 11-23-2005, 05:42 PM   #20
Mr_Munkey
Member
 
Registered: Sep 2004
Distribution: Slackware Current
Posts: 33

Rep: Reputation: 15
If it's a really big program I'll write up some psuedo UML (hardly ever do I write correct UML). I'll also jot down some notes about different ideas for particular, more interesting, modules/classes. After that I just dive into getting the framework and back-end working. That way I can test to make sure certain things are going to work well before I get too involved in the front-end. Then I can just focus on how to best display the output, because I know what to expect.

Most of the time you'll make changes to your plans, and sometimes you'll even make some changes to code you already wrote in the same version of the program. Once you're getting ready to put the program out to the masses is when you need to make sure it works as flawlessly as possible. The fewer patches, the better you look. No getting caught with your pants down in public

Somtimes you'll come back to a project you worked on a few months before. You'll look through the code and think to yourself, "Why didn't I just do it this way? Oh, yeah, I just learned how to do that last week." or something along those lines. You're always learning new things as you continue to write programs, so almost any program can be improved upon, with the exception of "Hello World". I suppose you could try to make it all 3-D, but you get my point.
 
Old 11-23-2005, 05:56 PM   #21
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
I just make up all the .h files I need, then fill in the details.
 
Old 11-24-2005, 02:09 AM   #22
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
precisely !!
but sometimes i would like to entertain myself the possibility of whether we are being paid for coding(in one way or another) or not ... i mean what we published onto the public when we are getting paid might be totally different from when we are not paid at all ... heck !! we might just as well scrap the older "home/bedroom" version and start from scratch(maybe heavy reuse of better code) but this time a truely working "commercial"(though still a free software) version and with lesser "flashy" features too


QUOTE :: by xhi
" Just get drunk, er..um.. Go with the flow"

good point ... but to think about it ... its totally possible to create better quality music when we are kind of drunk , but how about amature(professional??) coding ... sometimes i heard people saying that hackers/programmers all love music and sometimes influence by it(either classical or rock) and some of them might be pretty good musicians too ... Go with the flow ^_^

.
 
Old 11-24-2005, 11:07 AM   #23
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
When I work on a project... the last thing I ever think about is the actual language or implementation.

I always start with the logic- "hmm... what is the most logicial way to systematically solve this problem or perform this function?"


All the planning would involve balancing speed with efficiency. Even in these days that we have lots of RAM storage... once you become a C programmer you still can't help but strangle your program of every byte you can spare. Now depending on the program this can be good or bad. For example: if you are using a Bubble Sort (I don't see why yu' ever use one though), then one byte of storage would determine whether it would continue running even though the array is sorted, or just exit. You really need to think about whether it is actually worth it.



The beauty in a program comes from a design... if it is flawed- then there is no use on trying to perfect the code for imperfect logic. That is why I never rewrite code. Yes, I'll implement new functions, yes- I might even replace a small section of the design for one better suited for a different situation- but I never find myself rewriting the code because I found a better idea


Now of course.. no one is perfect, so I shouldn't speak in absolutes because we will always find outrselves forgetting or messing up important aspects of the design


Point is- Perfect the Design, and you'll never touch the code again...


Just like the UNIX System and it's utilities- they've only been modified to add new features, but te core of the design has been untouched for just about forever

Ah I love this discussion... my first 2-page thread



Woot Woot! That is like a little present for my Turkey-Day-Birthday today. Woot Woot.



All you guys on linuxquestons.org are just plain awsome
 
Old 11-24-2005, 03:53 PM   #24
Mr_Munkey
Member
 
Registered: Sep 2004
Distribution: Slackware Current
Posts: 33

Rep: Reputation: 15
Quote:
Originally posted by TGWDNGHN
When I work on a project... the last thing I ever think about is the actual language or implementation.

I always start with the logic- "hmm... what is the most logicial way to systematically solve this problem or perform this function?"


All the planning would involve balancing speed with efficiency. Even in these days that we have lots of RAM storage... once you become a C programmer you still can't help but strangle your program of every byte you can spare. Now depending on the program this can be good or bad. For example: if you are using a Bubble Sort (I don't see why yu' ever use one though), then one byte of storage would determine whether it would continue running even though the array is sorted, or just exit. You really need to think about whether it is actually worth it.



The beauty in a program comes from a design... if it is flawed- then there is no use on trying to perfect the code for imperfect logic. That is why I never rewrite code. Yes, I'll implement new functions, yes- I might even replace a small section of the design for one better suited for a different situation- but I never find myself rewriting the code because I found a better idea


Now of course.. no one is perfect, so I shouldn't speak in absolutes because we will always find outrselves forgetting or messing up important aspects of the design


Point is- Perfect the Design, and you'll never touch the code again...
Well put!

That is more along the lines of what I was thinking. Since I'm fairly new to programming, I'll learn new techniques to do different things from time to time, which I then come back and might re-write something to make it that much better. The design and function really stay the same, it just gets better and more stable.
 
Old 11-24-2005, 07:10 PM   #25
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Some things are mathematically complex... trying to find the idea algorithm, for example, is a biggie.


The shell sort, for example, works great except when it comes to numbers that are powers of 2- for mathematically complex reasons. Now the design might call for something to be sorted, but the design should never specify the sort to be used (unless, of course, you have a program that tests and compares different sorts... or if you are in a programming class and you MUST use a specified sort)


For example: never assume that your input and output consist of the keyboard and screen- always make room for it to, for example, be redirected to a file


This is why Standard Streams are good. If we had some proprietary measures on performing I/O (ex: Keyboard, screen, filesystem-specific file I/O, etc.) then we would have to rewrite a program for every possible situation and environment that it could be used in...

Or you could package it with loads of drivers and stuff, but that defeats the holy UNIX Principals. Te reason why UNIX is the perfect Operating System is because it is perfect by design... the beauty lies in that you can easily replace any of it's modular components and get them to work


Driver programs happen to be even better- because if you don't like the design of the driver then you can just use it to call up another one (Ex: bash shell into ksh/csh/tcsh/zsh/etc.)
 
Old 11-25-2005, 04:11 AM   #26
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
precisely !!

nice to hear people bringing up the unix principle in design ...

its pretty true that *nix are built with perfection in mind although i couldnt totally understand that completely but i just knew it ... and in the context of free software , let us forget about all those non-sensical zealots super-intelligent opinions of they themselves , i think the only truely revolutionary and outstanding idea behind it is that with free software everybody could read , glance and use(let us also forget about the legal implications down here) the codes , something quite unheard of , not even among those published true freeware(cause sometimes we still need to pay for the source)...

revolutionary as in as if we are actually able to see women sharing and exchanging their best and self-invented cooking recipes with other women strangers that they dont know wholeheatedly (ever seen women "pulling each other hair"??) ... what i mean is ... sometimes its really fun helping people in answering their coding problems by stepping through system source codes , we will almost always find something interesting and unexpected and never stop learning just about everything(well ... its also depending on your age , whether you are young enough to be able to do that )


QUOTE :: by TGWDNGHN
"Ah I love this discussion... my first 2-page thread "

yup ... why not ... view count had just sky-rocketed more than 330 , let us flood this thread


ok ... just kidding ... seriously ...
theres a guru in this forum once said that we can either code from the top or from the bottom but never never start coding from the middle !! and i think its very true , at least try our best not to do that ...


*nough said !! if not ... those 0 replies might just as well open their eyes(and their mouth too!!) wondering what the hell those people are doing ... chit-chat chit-chat all the way like nobody else buisness ... something like this ------>


enjoy !!

.

Last edited by alred; 11-25-2005 at 04:29 AM.
 
Old 11-25-2005, 08:34 AM   #27
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
good point ... but to think about it ... its totally possible to create better quality music when we are kind of drunk , but how about amature(professional??) coding ... sometimes i heard people saying that hackers/programmers all love music and sometimes influence by it(either classical or rock) and some of them might be pretty good musicians too ... Go with the flow ^_^
hmmm. being influenced by the product of someone elses drunkenness.... interesting. as far as coding better when drunk, no. not me anyhow. and for that matter not high either, on anything. im a far better sober coder, as hard as that is to admit to myself. maybe i do start coding better after 3 or 4 beers sure, but i can never stop at that point....
 
Old 11-25-2005, 06:15 PM   #28
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
People would think that coding drunk might badly affect the code... I disagree


After all, we can all completely @#$% up our programs or computers simply by TRYING to use pointers correctly...


Some of you all might have heard the old joke... The Engineer, Artist, and Programmer debating over what was Gods occupation. The Enginneer argued that god was an Engineer because of the perfection and architectures of all the designs he had created... the artist spoke of the beauty of the life god created, alluding to the same perfection as the enginneer. Then the programmers speaks up screaming "BUT WHERE DO YOU THINK HELL CAME FROM?!"


Of course... he was not speaking of perfection, he was alluding to pointers. Or maybe assembly language?



Thats why I love programming, its so much fun !


Besides... most programmers are either lightly-carelessly(not) religious or atheists (like me )


Either way, you gotta admit the following:
1. (Especially in game programming,) when we program- we are god. As for out little programs, scripts (, and game NPCs/ characters)- they do as we command
2. Out programs evolve in a fashion strikingly similar to what Darwin had proposed. As a matter of fact- biologists an programms study the evolution between real and computer virus to trace out their similarities



oh yeah, talking about computers, right.


um...


Linux rocks, yeah, lets continue from there :P
 
Old 11-25-2005, 06:21 PM   #29
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
>> Of course... he was not speaking of perfection, he was alluding to pointers. Or maybe assembly language?

I must disagree here. As assembly language is the language of gods. No joke, if you read the back of the bible it clearly says that god wrote us in assembler. Of course it is AT&T that he used not Intel ..

And what do you have against pointers?
 
Old 11-25-2005, 06:38 PM   #30
TGWDNGHN
Member
 
Registered: Aug 2003
Distribution: Slackware 10.0
Posts: 94

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Ha ha I'm sorry I gave the wrong impression, I actually love pointers. I understand them, and make use of them like crazy and I normally dont have a problem. I was wriitng sarcastically as a joke... I happen to know quite a large number of people far and near who cant work out pointers for a can of beans.


As for Assembly- same deal. I learn assembly on the side, and being that all my planning takes all low level aspexts into consideration, I don't even needto change my design to accomodate an Assembly Implementation. I mean heck... I think in binary all the time! no joke, I use binary math for practical purposes, really useful.


So if you didn't feel like reading all that:
1. I love pointers
2. I love assembly
3. I was writing jokingly

yup yup yuppers




Even in Java, a language as pathetic as Java- my peers have problems handling it's references... its so pathetic! How can you get it wrong on something as pathetically pathetic as Java?


Oh well... none of them really care for programming, or think like a programmer. Most of them just cheat and are planning to drop out anyways. But even for those who cares, the little noobies people like to poke every now and then for fun, its amusing to watch them suffer


But its part of growing up and becomming one with the Tao... becomming one with the Foo.... becomming one with the Machine.


After all, we all went through are larval stages, and their time will come too
 
  


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
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
C -communicating with system("ftp"); using "program|ftp>>myfifo" probably hansschmucker Programming 1 03-23-2005 01:39 PM
Getting error: "ALSA device "default" is already in use by another program." brynjarh Debian 7 02-04-2005 11:45 AM
How do I access the "D" drive???:scratch: BigCliff1951 Linux - Software 4 07-26-2004 08:34 PM
"Linux From Scratch" forum renamed? Dark_Helmet LQ Suggestions & Feedback 3 09-03-2003 09:35 AM

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

All times are GMT -5. The time now is 11:50 AM.

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