It is currently Mon May 20, 2013 9:53 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Sun May 06, 2012 2:21 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Jul 09, 2011 7:57 am
Posts: 276
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)

_________________
http://www.mediafire.com/pbstuff


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Sun May 06, 2012 9:42 am 
Offline
User
User

Joined: Tue May 26, 2009 2:11 pm
Posts: 94
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.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Sun May 13, 2012 11:18 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1284
Location: Waterloo, WI - USA
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.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Mon May 14, 2012 8:41 am 
Offline
Addict
Addict
User avatar

Joined: Wed Feb 28, 2007 9:13 am
Posts: 923
Location: Edinburgh
Good retort, Zach.

Something I've been wondering from the thread title... Is "which" a keyword in BASIC? I've never seen it.

_________________
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Mon May 14, 2012 10:15 am 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
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:
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:
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:
; 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:
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! ;)


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Mon May 14, 2012 8:43 pm 
Offline
Addict
Addict
User avatar

Joined: Tue May 10, 2005 10:00 pm
Posts: 1621
Location: Norway
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! :D


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Tue May 15, 2012 6:47 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 379
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!

_________________
Texas Instruments 99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye