It is currently Tue May 21, 2013 10:07 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 52 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Who here likes the BASIC syntax and why ? If notTHENwhichDO?
PostPosted: Thu May 03, 2012 9:36 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
Well i am just wondering how many of you like BASIC syntax and for what reason, i personally am crying about it ;( i want c++ one... brackets ftw...

So ?


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:12 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
I like it, because all commands have their own end keywords. So it is easier to read than many heaps like } } }.

Basic just looks nicer than C++ syntax!

_________________
Image


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
Next.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:23 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
It's a hell of a lot easier to read and comprehend - especially when trying to understand what is going on.

Take an example I came across a couple of years ago:
Code:
for(double Amplitude=1; (Octaves--) && (Amplitude>1/256.); Amplitude*=Persistence, Frequency<<=1) {
// code
}

Now lets take the PureBasic translation:
Code:
Amplitude.d=1.0
amp.d = 1/256
While Octaves And Amplitude > amp
  Octaves - 1
  Amplitude * Persistence
  Frequency << 1

  ; code
Wend


I haven't touched high level math since I was at uni and can't remember for the life of me what a lot of the symbols are. So instead of reading reams of white papers that I can't understand and get bored of, I rely on reading code to understand what it is actually doing.

If I was writing in C/C++, I would have to comment every line, and if I have to comment every line of code to understand it, I might as well as write in pure ASM instead.

If you can write something like that C/C++ statement and in a year glance at it and say "yup, I understand what that's doing", then yes, stick to C/C++.

For the rest of us mere mortals, there is PureBasic


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:35 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
Foz wrote:
It's a hell of a lot easier to read and comprehend - especially when trying to understand what is going on.

Take an example I came across a couple of years ago:
Code:
for(double Amplitude=1; (Octaves--) && (Amplitude>1/256.); Amplitude*=Persistence, Frequency<<=1) {
// code
}

Now lets take the PureBasic translation:
Code:
Amplitude.d=1.0
amp.d = 1/256
While Octaves And Amplitude > amp
  Octaves - 1
  Amplitude * Persistence
  Frequency << 1

  ; code
Wend


I haven't touched high level math since I was at uni and can't remember for the life of me what a lot of the symbols are. So instead of reading reams of white papers that I can't understand and get bored of, I rely on reading code to understand what it is actually doing.

If I was writing in C/C++, I would have to comment every line, and if I have to comment every line of code to understand it, I might as well as write in pure ASM instead.

If you can write something like that C/C++ statement and in a year glance at it and say "yup, I understand what that's doing", then yes, stick to C/C++.

For the rest of us mere mortals, there is PureBasic


The code you poped is very poorly organised you know. It's not PB's nature of being that nicely organised it's just how the programer organised it.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:37 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
Yes, and the code was written by a mathematical genius.

And this is my point - C, C++, C#, Java, PHP, Perl, etc does not lend itself to readable and understandable code.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
Foz wrote:
Yes, and the code was written by a mathematical genius.

And this is my point - C, C++, C#, Java, PHP, Perl, etc does not lend itself to readable and understandable code.


You are mistaken, it's only the way a person prefers, i can make my code of for example 500 lines of code so good for me that in just a minute i understand it completely, while if you gave me BASIC one of such length i would definetly need hours to be able to understand it just partly, but that's not because of BASIC is not the way i like it but because codes are usually poorly coded. For example even c++ code can be very ugly it's because people just spam brackets and never organise, making it really difficult to read.

I think i complicated it... but i like c++ one because it takes only 1 character to write a start or end block, where as in Pure Basic damn 4 for an if end y.y.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 10:59 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
Let's take a simple example:
Code:
int a = 1;
int b = 1;
int c = 3;
If((a == 1 && b == 2) || c == 3) {
  // code
}
vs
Code:
a = 1
b = 1
c = 3
If (a = 1 And b = 2) Or c = 3
  ; code
EndIf

Now, you have to explain the code to someone from the ground.
Let us start with C:
Quote:
Okay, first we have to declare our variables, and we are also assigning the values to them, so a equals 1, b equals 1, etc. Note that the semi colon is required to mark the line as then end of a coding line - every line unless it ends with a parenthesis or a comment.
Then we have a decision branch - the If statement. Now all decisions HAVE to be wrapped in round brackets from start to end. All equivalence tests require TWO equals signs. Also, you will notice that there are some other symbols, the two ampersand signs means you want to combine the left and right results in an AND test, whereas the two pipes means that you want to do an OR operation.
Okay the final bit are the parenthesis - this marks the start and end of a block, so if the condition is true, the code will run whatever is in that code block

And now to PureBasic.
Quote:
Just read it.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:02 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
Primoz128 wrote:
i can make my code of for example 500 lines of code so good for me that in just a minute i understand it completely, while if you gave me BASIC one of such length i would definetly need hours to be able to understand it just partly

It sounds like you need to stick to C/C++ then.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:03 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
Foz wrote:
Let's take a simple example:
Code:
int a = 1;
int b = 1;
int c = 3;
If((a == 1 && b == 2) || c == 3) {
  // code
}
vs
Code:
a = 1
b = 1
c = 3
If (a = 1 And b = 2) Or c = 3
  ; code
EndIf

Now, you have to explain the code to someone from the ground.
Let us start with C:
Quote:
Okay, first we have to declare our variables, and we are also assigning the values to them, so a equals 1, b equals 1, etc. Note that the semi colon is required to mark the line as then end of a coding line - every line unless it ends with a parenthesis or a comment.
Then we have a decision branch - the If statement. Now all decisions HAVE to be wrapped in round brackets from start to end. All equivalence tests require TWO equals signs. Also, you will notice that there are some other symbols, the two ampersand signs means you want to combine the left and right results in an AND test, whereas the two pipes means that you want to do an OR operation.
Okay the final bit are the parenthesis - this marks the start and end of a block, so if the condition is true, the code will run whatever is in that code block

And now to PureBasic.
Quote:
Just read it.


For this yes, but when doing lots of ifs with endifs that ends up a huge mess compared to c++.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:09 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Aug 15, 2009 6:59 pm
Posts: 1024
I also like the readability of BASIC.
Every coder can read BASIC code, no matter what language he is used to. Reading C/C++ code is much harder.

Especialy with the ugly brackets all over the place. And i dont get whats the matter with the semicolon. Both dont make the language bad but if it comes to readability BASIC is just superior.


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:16 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 13, 2007 12:42 pm
Posts: 1307
Location: Manchester, UK
*snort* if you say so - I got completely lost with the brackets and had to use an IDE to work it out.
Code:
if (a = 1) {
  if (b = 1) {
    if (c = 3) {
      // code
    }
    else {
      // code
    }
  }
  else {
    // code
  }
}
else {
  // code
}


Whereas this was easy:
Code:
If a = 1
  If b = 1
    If c = 3
      ; code
    Else
      ; code
    EndIf
  Else
    ; code
  EndIf
Else
  ; code
EndIf


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:25 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
Foz wrote:
*snort* if you say so - I got completely lost with the brackets and had to use an IDE to work it out.
Code:
if (a = 1) {
  if (b = 1) {
    if (c = 3) {
      // code
    }
    else {
      // code
    }
  }
  else {
    // code
  }
}
else {
  // code
}


Whereas this was easy:
Code:
If a = 1
  If b = 1
    If c = 3
      ; code
    Else
      ; code
    EndIf
  Else
    ; code
  EndIf
Else
  ; code
EndIf



My style of formating code:

Code:
if (a = 1)
   {
      if (b = 1)
         {
            if (c = 3)
               {
                  // code
               }
           else
              {
                  // code
              }
         }
      else
         {
            // code
         }
   }
else
   {
      // code
   }


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:34 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
Image

sry, I think it looks more chaotic than in Basic!

EDIT:
In Basic, I can see below what keyword is up,
I see in C++ only } } }
Code:
Repeat
   For N = 1 To 10
      If A = 1
         Select B
            Case 2
               ; ...
         EndSelect
      EndIf
   Next
ForEver

_________________
Image


Top
 Profile  
 
 Post subject: Re: Who here likes the BASIC syntax and why ? If notTHENwhic
PostPosted: Thu May 03, 2012 11:48 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Sep 10, 2011 8:25 pm
Posts: 203
Location: Slovenia
STARGÅTE wrote:
Image

sry, I think it looks more chaotic than in Basic!

EDIT:
In Basic, I can see below what keyword is up,
I see in C++ only } } }
Code:
Repeat
   For N = 1 To 10
      If A = 1
         Select B
            Case 2
               ; ...
         EndSelect
      EndIf
   Next
ForEver


You don't seem to look at my way at all.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: fcb and 3 guests


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