Page 4 of 4
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Sun May 06, 2012 2:21 am
by xorc1zt
if you want a very powerful language with a great syntax you should try Ada (my fav language with small talk).
http://www.functionx.com/ada/Lesson02.htm
"C was designed to be written; Ada was designed to be read." -- Jean Ichbiah (ada inventor)
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Sun May 06, 2012 9:42 am
by Lord
MachineCode wrote:After looking at your profile posts, I agree with GeoTrail and Demivec. Your attitude here is indeed very negative and I don't know why you're here. You seem to hate Basic with a passion, but you understand C? I don't get that at all. Seems almost like you're just trolling and/or trying to pimp GameMaker here with every post.
Just look at his age.
We have to be a little patient with children
until they have grown up.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Sun May 13, 2012 11:18 pm
by Zach
Once you get over the hurdle of learning a particular languages syntax, and various idiosyncrasies that come along with a given language, the only reason you should have a problem understanding code is because it is either
A) Poorly formatted / written
B) Poorly commented
C) Both.
C happens more often than A or B in my opinion, no matter what the language. You can sit here and argue about the perceived beauty of one language over another all day long, until you're blue in the balls; It doesn't change the fact you need to separate your personal preferences from bad coding.
I have a tough time reading any other persons code, no matter what language it is written in.. If I am familiar with the syntax, then well-structured and well-commented code makes it a lot easier to see what is going on, but I still think the BASIC-style Syntax is by far, the easiest to read. Just by purely logical standards. It is made of simpler keywords that are often indicative of what the commands are related to.
With more optimized / specialized languages you have a trade off of speed vs efficiency. It may be more efficient to use something like C or C++, but it will costs you some speed in the coding/reading code department.. While BASIC languages allow you to write easily understandable blocks in a fairly speedy manner, but may not always be the most efficient language to use for a given task.. Even then it comes down to situational preparedness and the old addage "the right tool for the right job".
And finally, you are comparing a Procedural language designed around a syntax intended for Beginners to be able to pick up easily, to an Object Oriented language which uses a completely different programming paradigm and is intended for more advanced users in Professional and Academic settings.. (This does not preclude PB from being used for those same purposes, it is simply an added benefit).
You're comparing Apples to Oranges - Great job.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Mon May 14, 2012 8:41 am
by Seymour Clufley
Good retort, Zach.
Something I've been wondering from the thread title... Is "which" a keyword in BASIC? I've never seen it.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Mon May 14, 2012 10:15 am
by Foz
Even comments can be eliminated if coded correctly, take this garbled mess, as if you just found this in the middle of a procedure:
Code: Select all
r = n / 2
While Abs( r - (n/r) ) > 0
r = 0.5 * ( r + (n/r) )
Wend
Debug "r = " + StrD(r)
What are r and n? What does this actually do?
Okay, so that's obviously BAD. How about this then?
Code: Select all
result = number / 2
While Abs( result - (number/result) ) > 0
result = 0.5 * ( result + (number/result) )
Wend
Debug "result = " + StrD(result)
It's still bad, but a bit more readable... but we still don't understand what it's doing!
So how about this:
Code: Select all
; Square Root of a number with Newton-Raphson approximation
result = number / 2
While Abs( result - (number/result) ) > 0
result = 0.5 * ( result + (number/result) )
Wend
Debug "result = " + StrD(result)
Ah ha! We understand what is going on now!
But could it be better?
Code: Select all
Procedure.d SquareRootApproximation(number.d)
Protected result.d = number / 2
While Abs( result - (number/result) ) > 0
result = 0.5 * ( result + (number/result) )
Wend
ProcedureReturn result
EndProcedure
Debug "result = " + StrD(SquareRootApproximation(16))
Why yes, yes it can, and without a single comment!
If coders have a priority of keeping everything readable is maintained, then procedures should be short and well named, variables should be well named, and use logical spacing to separate sections. Comments should be used for the "Whys?" of programming, not the "What?"
I'll admit of failing on these more often than I care to admit, but when I have to revisit code I end up refactoring it all to do it anyway.
We aren't hurting for memory or performance any more, if by doing this your source code inflates by 10kb... well, who cares?
And if you do care, why are you using a single sided 5.25" floppy disk on a modern computer? I'll let you in on a secret - usb pen drives!

Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Mon May 14, 2012 8:43 pm
by utopiomania
I like the BASIC syntax because it was the first programming language syntax I learned, on a
Dragon 64 with twin 160k (floppy)diskdrives.
BASIC still rules!

Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Posted: Tue May 15, 2012 6:47 am
by TI-994A
Hi Primoz128. Like any language, readability usually leans towards the stronger command; and that applies not only to programming languages, but also to the spoken word. For example, one person's command of English, does not diminish another person's preference for French.
Your expression "crying about it" clearly implies a comfort level with the C syntax, but that should in no way reflect negatively on the syntax of other languages. If you wish to learn or use these other languages, fine, but you shouldn't expect them to change to suit you.
However, your argument about readability is inaccurate; hands down, BASIC syntax is anytime more comprehensible than C. The language was explicitly designed for that very purpose, READABILITY, and that's still the general consensus. Google and see for yourself.
As for performance, we have PureBasic! Unmatched in its class, it produces the fastest and smallest standalone cross-platform executables, with no room for any bloatware or unnecessary overheads; and accordingly, no OOP.
So, to answer your question, I like the BASIC syntax, and I love PureBasic!