Who here likes the BASIC syntax and why ? If notTHENwhichDO?
Who here likes the BASIC syntax and why ? If notTHENwhichDO?
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 ?
So ?
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
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!
Basic just looks nicer than C++ syntax!
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
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:
Now lets take the PureBasic translation:
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
Take an example I came across a couple of years ago:
Code: Select all
for(double Amplitude=1; (Octaves--) && (Amplitude>1/256.); Amplitude*=Persistence, Frequency<<=1) {
// code
}Code: Select all
Amplitude.d=1.0
amp.d = 1/256
While Octaves And Amplitude > amp
Octaves - 1
Amplitude * Persistence
Frequency << 1
; code
Wend 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
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
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.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:Now lets take the PureBasic translation:Code: Select all
for(double Amplitude=1; (Octaves--) && (Amplitude>1/256.); Amplitude*=Persistence, Frequency<<=1) { // code }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.Code: Select all
Amplitude.d=1.0 amp.d = 1/256 While Octaves And Amplitude > amp Octaves - 1 Amplitude * Persistence Frequency << 1 ; code Wend
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
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
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.
And this is my point - C, C++, C#, Java, PHP, Perl, etc does not lend itself to readable and understandable code.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
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.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.
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.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
Let's take a simple example:
vs
Now, you have to explain the code to someone from the ground.
Let us start with C:
Code: Select all
int a = 1;
int b = 1;
int c = 3;
If((a == 1 && b == 2) || c == 3) {
// code
}Code: Select all
a = 1
b = 1
c = 3
If (a = 1 And b = 2) Or c = 3
; code
EndIfLet us start with C:
And now to PureBasic.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
Just read it.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
It sounds like you need to stick to C/C++ then.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
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
For this yes, but when doing lots of ifs with endifs that ends up a huge mess compared to c++.Foz wrote:Let's take a simple example:vsCode: Select all
int a = 1; int b = 1; int c = 3; If((a == 1 && b == 2) || c == 3) { // code }Now, you have to explain the code to someone from the ground.Code: Select all
a = 1 b = 1 c = 3 If (a = 1 And b = 2) Or c = 3 ; code EndIf
Let us start with C:And now to PureBasic.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 blockJust read it.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
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.
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.
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
*snort* if you say so - I got completely lost with the brackets and had to use an IDE to work it out.
Whereas this was easy:
Code: Select all
if (a = 1) {
if (b = 1) {
if (c = 3) {
// code
}
else {
// code
}
}
else {
// code
}
}
else {
// code
}
Code: Select all
If a = 1
If b = 1
If c = 3
; code
Else
; code
EndIf
Else
; code
EndIf
Else
; code
EndIfRe: Who here likes the BASIC syntax and why ? If notTHENwhic
Foz wrote:*snort* if you say so - I got completely lost with the brackets and had to use an IDE to work it out.Whereas this was easy:Code: Select all
if (a = 1) { if (b = 1) { if (c = 3) { // code } else { // code } } else { // code } } else { // code }Code: Select all
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: Select all
if (a = 1)
{
if (b = 1)
{
if (c = 3)
{
// code
}
else
{
// code
}
}
else
{
// code
}
}
else
{
// code
}
Re: Who here likes the BASIC syntax and why ? If notTHENwhic

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: Select all
Repeat
For N = 1 To 10
If A = 1
Select B
Case 2
; ...
EndSelect
EndIf
Next
ForEver
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: Who here likes the BASIC syntax and why ? If notTHENwhic
You don't seem to look at my way at all.STARGÅTE wrote:
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: Select all
Repeat For N = 1 To 10 If A = 1 Select B Case 2 ; ... EndSelect EndIf Next ForEver

