Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
JewKiller 3000
Nov 28, 2006

by Lowtax
c++ is a bad programming language

Adbot
ADBOT LOVES YOU

hobbesmaster
Jan 28, 2008

JewKiller 3000 posted:

c++ is a bad programming language

c++ is merely too powerful for most compilerspeople to handle

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
c++ is unnecessary

theadder
Dec 30, 2011


bobbilljim posted:

c++ is unnecessary

swift :)

brap
Aug 23, 2004

Grimey Drawer
lol swift could replace c++ if the only software in the world were cocoa apps

theadder
Dec 30, 2011


i wish

hobbesmaster
Jan 28, 2008

fleshweasel posted:

lol swift could replace c++ if the only software in the world were cocoa apps

win32 delenda est

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal
c++ owns but there's no sensible ide for it so writing anything big in it is super annoying

vs is a horrendous piece of poo poo that crashes all the time and 2013 won't even let you hotpatch libraries anymore :mad:

Captain Pike
Jul 29, 2003

bucketmouse posted:

c++ owns but there's no sensible ide for it so writing anything big in it is super annoying

vs is a horrendous piece of poo poo that crashes all the time and 2013 won't even let you hotpatch libraries anymore :mad:

VS is the best IDE I've used but it blows my loving mind that it needs the "Whole Tomato" commercial plugin to do simple auto-completion. The "Code Blocks" ide can do auto-complete for free, but it has its own set of garbage problems. Why is C++ in this terrible state?

Necc0
Jun 30, 2005

by exmarx
Broken Cake
prob because it lost a lot of popularity when the languages that take full advantage of auto-complete stuff came out

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
c-based languages are actually legitimately more difficult to do autocomplete for, c++ especially. tiny differences in inclusion order might mean you're actually finding the NULL from foo.h instead of the NULL from bar.h. and then you include baz.h, and are you actually sure you're going to get the exact same set of declarations? so much for sharing anything between files

and in c++ you write foo( and even the compiler doesn't technically know all the declarations you might be using until it sees the types of the arguments. plus all the template instantiation you have to do. plus the problems of lookup within templates

xcode does all this, fwiw, though i won't deny it has its own problems

pseudorandom name
May 6, 2007

I'm sure Xcode benefits from the code completer being derived from the compiler.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
it does. it also suffers from it; xcode code completion is a lot slower and less stable than some custom thing with less fidelity might be

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i am mostly irritated by code completion, but i also mostly use plangs. i'm sure if i worked in languages that had more complicated signatures with things like types i would enable code completion more often

Notorious b.s.d.
Jan 25, 2003

by Reene
i really hope emacs/cedet gets the llvm-based completion that people have been talking (well, flaming eachother) about

it would be cool to have a free software c/cpp ide that was as capable as commercial choices

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal

Captain Pike posted:

VS is the best IDE I've used but it blows my loving mind that it needs the "Whole Tomato" commercial plugin to do simple auto-completion. The "Code Blocks" ide can do auto-complete for free, but it has its own set of garbage problems. Why is C++ in this terrible state?

have you experienced the special hell that comes from accidentally stepping into a multiple-argument template function in visual studio and having it just grind for 30 seconds while it walks the entire pdb before presenting you with a dialog showing every single instantiation of that function

and then regardless which you click it shows you the same template definition unless you pick a specifically overloaded template which will just hose VS and force you to do a full rebuild to regenerate the now-corrupt intellisense db

c++ intellisense is the loving worst and even though visual assist makes the language better on the whole, the fact that it apparently figures out line numbers from the often-wrong intellisense info means that half the time you ask it to declare a class method for you it winds up putting the header in a completely unrelated file for no reason

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:

bucketmouse posted:

c++ is the loving worst

qntm
Jun 17, 2009
c++ is absurd

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

rjmccall posted:

c-based languages are actually legitimately more difficult to do autocomplete for, c++ especially. tiny differences in inclusion order might mean you're actually finding the NULL from foo.h instead of the NULL from bar.h. and then you include baz.h, and are you actually sure you're going to get the exact same set of declarations? so much for sharing anything between files

and in c++ you write foo( and even the compiler doesn't technically know all the declarations you might be using until it sees the types of the arguments. plus all the template instantiation you have to do. plus the problems of lookup within templates

xcode does all this, fwiw, though i won't deny it has its own problems

Here's a fun thing with c++ parsing:
C++ code:
#include <cstdio>
template<int n> struct confusing
{
    static int q;
};
template<> struct confusing<1>
{
    template<int n>
    struct q
    {
        q(int x)
        {
            printf("Separated syntax and semantics.\n");
        }
        operator int () { return 0; }
    };
};
char x;
int main()
{
    int x = confusing<sizeof(x)>::q < 3 > (2);
    return 0;
}
Imagine you're just trying to parse this, before applying semantics like the fact that the x in main shadows the char x outside of main. You might then resolve sizeof(x) as 1. In that case you resolve to confusing<1>::q<3>(2) where q is the function and 2 is its argument. On the other hand if your parser knows about the semantics of variable shadowing then sizeof(x) resolves to 4 and you've got confusing<4>::q<3>(2), but q is a variable now and those angle brackets are greater than or less than. In other words it parses to int x = (confusing<4>::q < 3) > 2. So to even parse this correctly your parser needs to know the language semantics. And of course you could put even worse stuff than sizeof(x) in there, you could put the result of some arbitrarily complex template instantiation in there.

Soricidus
Oct 21, 2010
freedom-hating statist shill

HappyHippo posted:

Here's a fun thing with c++ parsing:
C++ code:

#include <cstdio>
template<int n> struct confusing
{
    static int q;
};
template<> struct confusing<1>
{
    template<int n>
    struct q
    {
        q(int x)
        {
            printf("Separated syntax and semantics.\n");
        }
        operator int () { return 0; }
    };
};
char x;
int main()
{
    int x = confusing<sizeof(x)>::q < 3 > (2);
    return 0;
}

Imagine you're just trying to parse this, before applying semantics like the fact that the x in main shadows the char x outside of main. You might then resolve sizeof(x) as 1. In that case you resolve to confusing<1>::q<3>(2) where q is the function and 2 is its argument. On the other hand if your parser knows about the semantics of variable shadowing then sizeof(x) resolves to 4 and you've got confusing<4>::q<3>(2), but q is a variable now and those angle brackets are greater than or less than. In other words it parses to int x = (confusing<4>::q < 3) > 2. So to even parse this correctly your parser needs to know the language semantics. And of course you could put even worse stuff than sizeof(x) in there, you could put the result of some arbitrarily complex template instantiation in there.

lol owned

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
yep

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

the whole C++ FQA is a good time

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal

HappyHippo posted:

Imagine you're just trying to parse this

as a bonus some compilers return uint instead of size_t based on flags so who knows if its gonna hit the overload or not

there's a library called glm that's supposed to provide types that mimic glsl's builtins so you can do glsl type ops like some3dvertex.xz to extract the x and z coords of a vertex as a 2d point

if you want to see the most horrifying templates on earth, check out its source. it's the necronomicon of c++ libraries and man was not meant to gaze upon it

qntm posted:

c++ is absurd

e: vv whoever decided that c++ needed a glsl interop layer is definitely a terrible programmer

bucketmouse fucked around with this message at 00:56 on Feb 16, 2015

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
this is the terrible programmer thread not the terrible programming language thread

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
when the templating language is sufficient to write any program

EVGA Longoria
Dec 25, 2005

Let's go exploring!

MALE SHOEGAZE posted:

i am mostly irritated by code completion, but i also mostly use plangs. i'm sure if i worked in languages that had more complicated signatures with things like types i would enable code completion more often

i make constant typos and code completion helps me catch them

it's also v neat

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

EVGA Longoria posted:

i make constant typos and code completion helps me catch them

it's also v neat

that's what syntax highlighting is for

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I use ctrl+n a lot, ironically most "vimmers" I met irl don't know about it.

Bloody
Mar 3, 2013

code completion is the best thing and always useful. without code completion people become miserly about variable and function/method/class/whatever names and you wind up with illegible garbage.

hobbesmaster
Jan 28, 2008

bobbilljim posted:

when the templating language is sufficient to write any program

no one can be sure since nobody has ever had a boost spirit program finish compiling

hobbesmaster
Jan 28, 2008

the c preprocessor is also a complete language of its own

now combine the c preprocessor and c++ templating :getin:

brap
Aug 23, 2004

Grimey Drawer
whyyyy are header files still a thing

pseudorandom name
May 6, 2007

because retrofitting modules on the creeping horror of C++ isn't quite as easy as you'd think

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Symbolic Butt posted:

I use ctrl+n a lot, ironically most "vimmers" I met irl don't know about it.

I just learned that ctrl+x ctrl+] in insert mode does completion on tags, without the file that the tag belongs being in a buffer (because if it was, just use ctrl+n)

Valeyard
Mar 30, 2012


Grimey Drawer
piece of poo poo javascript, apparently right clicking a link and hitting "open in new tab" doesnt count as a normal click event

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Valeyard posted:

piece of poo poo javascript, apparently right clicking a link and hitting "open in new tab" doesnt count as a normal click event

That kinda makes sense right? Like it happens outside the dom

Valeyard
Mar 30, 2012


Grimey Drawer

MALE SHOEGAZE posted:

That kinda makes sense right? Like it happens outside the dom

yeah youre right, just never thought about it though until just now when it was causing problems

maybe just gently caress javascript generally

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Valeyard posted:

yeah youre right, just never thought about it though until just now when it was causing problems

maybe just gently caress javascript generally

Im not really sure that I'm right but I could be

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

it should give a click event for the right button, I think after the menu is dismissed?

Adbot
ADBOT LOVES YOU

MeruFM
Jul 27, 2010
the event for right clicking with the menu is contextmenu

also don't use that unless you really really need it.
That's definitely not a "good programmer" thing to do

reminds me of when people disabled it on their blogs and then popped up "don't steal code lololol"

  • Locked thread