Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ syntactic sugars

Name: Anonymous 2014-05-30 13:31

Namespaces are syntactic sugar, instead of doing:

namespace penis
{
unsigned char a=0;
}

you could just write:

unsigned char penis_a=0;


Distinction between public and private is stupid for the same reason described above.
Also, instead of using for and while you could just use if and goto. And I have several more examples...

Why do people keep designing bloated programming languages like C++?

Name: Anonymous 2014-05-30 13:33

Use Oberon.

Name: Anonymous 2014-05-30 14:06

Seriously, use Oberon. The whole language spec is 1.5 pages. The compiler is 2 MB. It doesn't even construct an abstract syntax tree. If that isn't minimalistic, then only assembly is.

Name: Anonymous 2014-05-30 14:20

>>3
forced GC
minimalist
I think not.

Name: Anonymous 2014-05-30 14:29

>>4
Who said that?

Name: Anonymous 2014-05-30 14:30

>>5
Who said what?

Name: Anonymous 2014-05-30 14:38

>>6
The quoted text in >>4.

Name: Anonymous 2014-05-30 14:40

>>6
that

Name: Anonymous 2014-05-30 14:40

>>7
I said that, and quoted myself, but due to deforestation optimization the intermediate data structure was fused so now you see only quotes.

Name: Anonymous 2014-05-30 14:44

>>1
namespaces are worse because they can not used in C but one cool thing is that I can do namespace nigger = factory.factory.lgbtqjidf.hax.my.ani.penis.african.american;
nigger.penisPunishment ();

Name: Anonymous 2014-05-30 14:44

Open a bug report in your post compiler then, it doesn't preserve the semantics.

Name: Anonymous 2014-05-30 15:16

>>8
what

Name: Anonymous 2014-05-30 15:31

>>12
are you asking a question!

Name: Anonymous 2014-05-30 15:35

>>13

Are you!

Name: Anonymous 2014-05-30 15:43

>>12
Do they speak English in What?

Name: Anonymous 2014-05-30 15:59

>>15
what again

Name: Anonymous 2014-05-30 16:32

>>16
English, motherfucker, do you speak it?

Name: Anonymous 2014-05-30 22:18

>>17
No. Where I'm from we only speak what.

Name: Anonymous 2014-05-30 22:56

What is love? Oh baby don't what me, don't what me, no more...

Name: Anonymous 2014-05-31 3:07

What what what? What what what, what what what, what what what, what what...

Name: Anonymous 2014-05-31 22:16

áàcêntös

Name: Anonymous 2016-07-11 5:29

(stopping the dubsfaggot from dubsbumping)

Name: Anonymous 2016-09-29 15:38

>>1
Namespaces would only be syntactic sugar if &(ns::var) == &ns_var evaluates to true. Otherwise, they're two different ways of doing the same thing, but they're syntactic sugar ONLY IF the compiler/intepreter views them as having the same meaning. For example, the [] operator is syntactical sugar for pointer arithmetic, because they can be used interchangeably.

Name: Anonymous 2016-09-29 17:53

Say "what" one more time, I dare you.

Name: Anonymous 2016-09-29 18:02

>>24
what

Name: Anonymous 2016-09-29 18:22

#define namespace struct

Name: Anonymous 2016-09-29 18:48

>>25
Ain't never heard of What! Do they speak English in What?

Name: Anonymous 2016-09-29 18:56

>>27
yes

Name: Anonymous 2016-09-30 10:37

>>27
no

Name: Anonymous 2016-09-30 12:43

dubs

Name: Anonymous 2016-09-30 13:45

>>30
no

Name: Anonymous 2016-09-30 14:06

dubs

Name: Anonymous 2016-09-30 14:09

>>32
no

Name: Anonymous 2016-09-30 14:13

>>33
dubs!

Name: C++ syntactic sugars 2016-09-30 14:16

Namespaces are syntactic sugar, instead of doing:

namespace penis
{
unsigned char a=0;
}


you could just write:

struct
{
unsigned char a;
} penis = {.a = 0};

Name: Anonymous 2016-09-30 14:52

>>35
Now define a class inside a struct.

Name: Anonymous 2016-09-30 15:27

>>36
#include <iostream>

namespace foo_a {
class bar {
public:
bar(int n) {
qux = n;
}
int getQux() {
return qux;
}
void setQux(int n) {
qux = n;
}
private:
int qux;
};
}

struct foo_b {
class bar {
public:
bar(int n) {
qux = n;
}
int getQux() {
return qux;
}
void setQux(int n) {
qux = n;
}
private:
int qux;
};
};

int main() {
foo_a::bar *bar1 = new foo_a::bar(5);
foo_b::bar *bar2 = new foo_b::bar(7);

//should output "5, 7"
std::cout << bar1->getQux() << ", " << bar2->getQux() << std::endl;

return 0;
}

Name: Anonymous 2016-09-30 23:10

>>1
Distinction between public and private is stupid for the same reason described above.
private (i.e file local/static variables and functions) are useful because they can easily be eliminated as dead code by linkers if they happened to not be used (like including a header file with a bunch of common static helper functions).

Name: Cudder !cXCudderUE 2016-10-01 14:48

>>38
If code is not used, a linker should not be including it anyway.

Name: Anonymous 2016-10-02 9:40

>>1
You don't understand object oriented programming. You are going to be confused if you try to apply the rules of basketball in a game of baseball.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List