Page 3 of 6

Posted: Fri May 12, 2006 5:04 pm
by Pupil
Joakim Christiansen wrote:All people using GOTO's are gays!! :P
LOL, and those who don't use GOTO's are lesbians!! :P

Posted: Fri May 12, 2006 5:15 pm
by Henrik
Pupil wrote:
Joakim Christiansen wrote:All people using GOTO's are gays!! :P
LOL, and those who don't use GOTO's are lesbians!! :P
Hiii... but what about all the gays who don't use goto, what are they ?? now i'm really confused :?: :roll:

Posted: Fri May 12, 2006 5:24 pm
by Pupil
Hades wrote:@Pupil

Using Goto at all is bad coding style. That's all I wanted to say. You don't have to agree.
It's like I said: Do what you like.
I can't believe you're telling me my coding style is bad, how rude! ;)
At least we can agree on disagreeing. :)

Posted: Fri May 12, 2006 6:12 pm
by Kale
Goto's are gay!

Posted: Fri May 12, 2006 6:20 pm
by thefool
Kale wrote:Goto's are gay!
Like you? :twisted:

Posted: Fri May 12, 2006 6:42 pm
by Kale
:shock:

Posted: Fri May 12, 2006 6:59 pm
by dioxin
GOSUB/GOTO are powerful features but not everyone is up to handling them.
Those that can, get on with it.
Those that can't tell everyone else they're wrong.

Paul.

Posted: Fri May 12, 2006 7:17 pm
by Hades
The wheels on my car are cornered. It's perfect that way. And anyone who tells me it isn't just can't drive. :roll:

Posted: Fri May 12, 2006 8:31 pm
by Edwin Knoppert
dioxin wrote:GOSUB/GOTO are powerful features but not everyone is up to handling them.
Those that can, get on with it.
Those that can't tell everyone else they're wrong.

Paul.
A typical nonsense discussion, this matter seems often based on being scared what others think.

Is using an open file statement not equally 'bad'?
I mean i can overwrite a windows dll in a snap.

At least gosub's where very handy to me, goto's a little less but sometimes..
It's a pitty .net abandoned these at all.
Oh well, that's another topic :)

You know what REALLY bad programming is?
1) Things like DEFINT and so.

2) A programming language not being able to set an OPTION EXPLICIT (or lookalike).
I believe pb has this feature at last in this v4.0 release, if so, apreciated.

3) Well, you might think of this one.. not forcing a winmain procedure, well.. can't explain why but somehow i find this having to much of a Quick Basic taste..

Posted: Sat May 13, 2006 2:12 am
by Phoenix
Hades wrote:Using Goto at all is bad coding style
No, it's just a personal opinion. How you code is your own business. If the source code to PureBasic showed that Fred used Gotos everywhere, would that make you lose respect for Fred? Of course not.

Posted: Sat May 13, 2006 8:11 am
by Hades
:?

I'm well awere it's just my opinion that using Goto is bad coding style, but I have strong reasons to believe so. I always said do what you like. And it's absolutly possible to write a great program in a bad style. It's just harder.

Some people here sound like Goto is their god. :roll:

Posted: Sat May 13, 2006 8:46 am
by blueznl
well, i've never ever found a reason to use goto or gosub...

i tend to believe goto's are not the best choice in most cases, but i don't like the 'break' command either

in fact, anything that breaks the 'flow' of the code is what i do not like

ie. i want code to be 'closed', as in

Code: Select all

for a = 1 to 10
  b = b+1
next a
there's no jumping in or out, and it's quickly possible to see what belongs to what

well, perhaps someone can show me a case where goto is improving your code? (ah, a challenge! :-)) if no one can i think i'll switch to the 'goto is bad' camp :-)

Posted: Sat May 13, 2006 9:50 am
by Edwin Knoppert
>where goto is improving your code?
I think no-one but it's simply a benefit, espec. a gosub.

I'm doing .NET, you know what i think is bad programming style?
Being possible to reuse a dimming statement in a loop like:

Foreach(...)
{
(objecttype...) x = new (objecttype...);
}

It works but i found it counter productive (speed reasons and such)

Note that this won't compile:
(objecttype...) x = new (objecttype...);
(objecttype...) x = new (objecttype...);

So why should it work in a loop?
I do understand but it's not logical to me.

Posted: Sat May 13, 2006 10:53 am
by Dare2
IMO, bad code is code that is hard to support.

If it does the job adequately: If the next guy can understand it and enhance it: If you can maintain it 1 year down the track: Then it is good code.

That is all that really matters.





Edit and aside: C++ is bad code waiting to happen.

Posted: Sat May 13, 2006 11:52 am
by Edwin Knoppert
Dare2 wrote:IMO, bad code is code that is hard to support.

If it does the job adequately: If the next guy can understand it and enhance it: If you can maintain it 1 year down the track: Then it is good code.

That is all that really matters.

Edit and aside: C++ is bad code waiting to happen.
Hmm, no programmer will be able to understand code from someone else if it's size is becomming to large, even if it is rock solid code.
I mean all the jumps to different functions make it very difficult to understand the code.
Often a rewrite is a valid option, we encounter these matters so now and then.
Sometimes the decision is made to wait with updating to plan a major rewrite.

Yes.. all bad practises, documentation is poor and if someone leaves the building... well you can fill that one in yourself. :)

Frankly, i don't even think that documentation would help.
But then, i never document, i keep functionality as modular as possible.
Each functionality in a separate includefile.
Each function described briefly.
It is maintanable but does not help other programmers, at least myself.