Discuss Scratch

edward789121
Scratcher
500+ posts

xC - you'll get grades better than a C!

i ain't got nothin' yet, but ideas:
in C++, i find these very frusturating:
#include<something>
int(var){command}
cout << "something"; // i don't like the semicolon
cin >> var;
for(command; command; command;){command}
void {name} {command}
/* having to include int main()
having to include #include <iostream> */
^^^^^^^^^^^^^^^^^^^^LOL
what those will become:
import "something"
using(var){command}
cout "something" // notice the missing semicolon
cin "something" to var
until (bool) using (var) each end {something with var}{command}
def{name}{command}

when I receive [Scratch joined v]
cringe
wait ((pick random (0) to (4)) * ((((60) * (60)) * (12)) * (365.25))) secs
leave
wait ((pick random (0) to (4)) * ((((60) * (60)) * (12)) * (365.25))) secs
broadcast [Scratch joined v]
lugga
Scratcher
500+ posts

xC - you'll get grades better than a C!

edward789121 wrote:

i ain't got nothin' yet, but ideas:
in C++, i find these very frusturating:
#include<something>
int(var){command}
cout << "something"; // i don't like the semicolon
cin >> var;
for(command; command; command;){command}
void {name} {command}
/* having to include int main()
having to include #include <iostream> */
^^^^^^^^^^^^^^^^^^^^LOL
what those will become:
import "something"
using(var){command}
cout "something" // notice the missing semicolon
cin "something" to var
until (bool) using (var) each end {something with var}{command}
def{name}{command}
I don't think understand this…
#include<something>
int(var){command} // What does this mean?
cout << "something"; // i don't like the semicolon It's useful
cin >> var;
for(command; command; command;){command} // Makes more sense allows you to choose increments and others things (It even let's you count down!
void {name} {command} // Invalid no {} arround name
/* having to include int main() // This is a function. It's to do with assembly and the entry point on programs.
having to include #include <iostream> */ // This is telling the compiler to put iostream inside your code
// Yeah! Why not we just put EVERY C++ LIBRARY THAT EXISTS IN THE CODE FOR YOU! Hello 1+GB file :D

Last edited by lugga (Sept. 7, 2016 14:53:03)

edward789121
Scratcher
500+ posts

xC - you'll get grades better than a C!

lugga wrote:

Why not we just put EVERY C++ LIBRARY THAT EXISTS IN THE CODE FOR YOU! Hello 1+GB file
no, the main module is iostream, so it will import just iostream.

when I receive [Scratch joined v]
cringe
wait ((pick random (0) to (4)) * ((((60) * (60)) * (12)) * (365.25))) secs
leave
wait ((pick random (0) to (4)) * ((((60) * (60)) * (12)) * (365.25))) secs
broadcast [Scratch joined v]
lugga
Scratcher
500+ posts

xC - you'll get grades better than a C!

edward789121 wrote:

lugga wrote:

Why not we just put EVERY C++ LIBRARY THAT EXISTS IN THE CODE FOR YOU! Hello 1+GB file
no, the main module is iostream, so it will import just iostream.
No iostream is NOT the main module. It is a terminal / command line IO module. If you are using C++ to build a operating system you would not want to use IOStream. Since C++ was invented for multiple purposes including OS development it would make no sense for IOStream to be included by default. Also, IOStream was made AFTER C++ not WITH C++ so it was not a core part of C++. As C++ is multi-purpose adding a library for just a few purposes would make no sense.
Jonathan50
Scratcher
1000+ posts

xC - you'll get grades better than a C!

lugga wrote:

// Yeah! Why not we just put EVERY C++ LIBRARY THAT EXISTS IN THE CODE FOR YOU! Hello 1+GB file :D
C++ headers should only contain procedure “prototypes”, class declarations, extern declarations and typedefs, none of which add stuff to the compiled code.

EDIT: And preprocessor “statements” like #define, #include, etc.

Last edited by Jonathan50 (Sept. 8, 2016 04:39:35)


Not yet a Knight of the Mu Calculus.
TheMonsterOfTheDeep
Scratcher
1000+ posts

xC - you'll get grades better than a C!

Jonathan50 wrote:

lugga wrote:

// Yeah! Why not we just put EVERY C++ LIBRARY THAT EXISTS IN THE CODE FOR YOU! Hello 1+GB file :D
C++ headers should only contain procedure “prototypes”, class declarations, extern declarations and typedefs, none of which add stuff to the compiled code.
But, still, adding every single header file ever made would be quite a lot of that kind of stuff that the compiler would have to sort through…

Of course, it could be reasonable to just have some number of header files that were in a standard-library-type-thing that the compiler included by default.

my latest extension: 2d vector math
algmwc5
Scratcher
100+ posts

xC - you'll get grades better than a C!

edward789121 wrote:

i ain't got nothin' yet, but ideas:
in C++, i find these very frusturating:
#include<something>
int(var){command}
cout << "something"; // i don't like the semicolon
cin >> var;
for(command; command; command;){command}
void {name} {command}
/* having to include int main()
having to include #include <iostream> */
^^^^^^^^^^^^^^^^^^^^LOL
what those will become:
import "something"
using(var){command}
cout "something" // notice the missing semicolon
cin "something" to var
until (bool) using (var) each end {something with var}{command}
def{name}{command}
i don't like what xC parses C++ to
i prefer “for” rather than until, and semicolons are useful. Even Python needs semicolons for single-line statements:
print("foo"); functionName("arg)
and C++ isn't so bad

Last edited by algmwc5 (Sept. 9, 2016 02:20:41)


Powered by DjangoBB