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.
 
  • Post
  • Reply
tef
May 30, 2004

-> some l-system crap ->
http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/13daeb85-da43-4166-b188-595a4a5d5282/

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Shaggar posted:

no and thats one of those things thats annoying, but its not critical by any means.

Databasing without window functions is like coding with hand behind your back.

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

no and thats one of those things thats annoying, but its not critical by any means.

you're granny querying

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag
here's a c++ question for yalls:

which of these, if any, makes you angry? do any of them make you want to kill yourself?

A
code:
FartBoss::FartBoss()
{
    m_pPototo = 0;
    m_pChipes = 0;
    m_pTigerStyle = 0;
}
B
code:
FartBoss::FartBoss() :
m_pPototo(0),
m_pChipes(0),
m_pTigerStyle(0)
{
}
C
code:
FartBoss::FartBoss() :
  m_pPototo(0)
, m_pChipes(0)
, m_pTigerStyle(0)
{
}

Zombywuf
Mar 29, 2008

All of them; using hungarian notation to denote visibility.

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag
i'd like to find the smallest snippet of c++ that makes people go completely apeshit

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Dr. Honked posted:

here's a c++ question for yalls:

which of these, if any, makes you angry? do any of them make you want to kill yourself?

A
code:
FartBoss::FartBoss()
{
    m_pPototo = 0;
    m_pChipes = 0;
    m_pTigerStyle = 0;
}
B
code:
FartBoss::FartBoss() :
m_pPototo(0),
m_pChipes(0),
m_pTigerStyle(0)
{
}
C
code:
FartBoss::FartBoss() :
  m_pPototo(0)
, m_pChipes(0)
, m_pTigerStyle(0)
{
}

A is the least bad imo

C is the worst

Squinty Applebottom
Jan 1, 2013

Shaggar posted:

idk what this means. are you talking about auto-increment ?

not for identity columns but for example

row_number() over (partition by server order by emails desc)

will allow you to easily select the top X users per server based on emails

Squinty Applebottom
Jan 1, 2013

also page compression owns

JawnV6
Jul 4, 2004

So hot ...
comma before just screams "i debug by commenting single lines"

MeruFM
Jul 27, 2010

Dr. Honked posted:

here's a c++ question for yalls:

which of these, if any, makes you angry? do any of them make you want to kill yourself?

A for normals
B for douchery and code confusion
C is same as B but indicates a person who modifies initializers a lot

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
all microsoft software is terrible, especially their "database" products

java is bad too, overly verbose garbage to keep dumb people from hurting themselves

tef
May 30, 2004

-> some l-system crap ->

Cocoa Crispies posted:

java is bad too, overly verbose garbage to keep dumb people from hurting themselves

it doesn't seem to stop dumb people from hurting themselves :confused:

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tef posted:

it doesn't seem to stop dumb people from hurting themselves :confused:

well it's not particularly good at anything, no surprise it fails at that

tef
May 30, 2004

-> some l-system crap ->
http://stackoverflow.com/questions/262427/javascript-array-map-and-parseint

why does

['1','2','3'].map(parseInt)

yield this:

[1, NaN, NaN]

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

JawnV6 posted:

comma before just screams "i debug by commenting single lines"

this is fine as long as you leave any still-commented lines in when u commit


*ducks*

Posting Principle
Dec 10, 2011

by Ralp

MeruFM posted:

A for normals
B for douchery and code confusion
C is same as B but indicates a person who modifies initializers a lot

Initialization lists are a good thing. B is the best one.

Progressive JPEG
Feb 19, 2003

prefer B here, though I'd probably just write it like this

code:
FartBoss::FartBoss()
  : m_pPototo(0), m_pChipes(0), m_pTigerStyle(0) { }

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag
you're wasting precious screen real estate with that frivolous newline

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Dr. Honked posted:

you're wasting precious screen real estate with that frivolous newline

I like my opening brace at the end of the function-definition line, instead of at the beginning of the next line.

pseudopresence
Mar 3, 2005

I want to get online...
I need a computer!
Is there really anyone who would suggest A is better? It wouldn't make me rage though, I would just think "heh scrub"

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag

Fib posted:

Is there really anyone who would suggest A is better? It wouldn't make me rage though, I would just think "heh scrub"

the worst is when people mix them up

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag
code:
FartBoss::FartBoss():
   m_eFagtron9000(FB_FAG9K), pish(-1)
   , m_bFalse(true)
{
    m_pPototo = 0;
    m_pChipes = 0;
    m_pTigerStyle = 0;
}

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Dr. Honked posted:

code:
FartBoss::FartBoss():
   m_eFagtron9000(FB_FAG9K), pish(-1)
   , m_bFalse(true)
{
    m_pPototo = 0;
    m_pChipes = 0;
    m_pTigerStyle = 0;
}

Shouldn't there be m_something attached to the front of "pish"? (Why no, I am not a C++ guy, why do you ask?)

Posting Principle
Dec 10, 2011

by Ralp
that's it

that's the one that makes me mad

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag

prefect posted:

Shouldn't there be m_something attached to the front of "pish"? (Why no, I am not a C++ guy, why do you ask?)

ah you see that was added by the guy who doesn't follow the coding conventions that the other guys do. it's not incorrect per se, in fact some might say it's more correct

FamDav
Mar 29, 2008
A is straight up bitch code written by people who wrote a C, but i guess its ok if you're in cs101 or something

B is best because it's what you should do

C is weird lookin' and looks like something you'd do in javascript because of semicolon insertion

Progressive JPEG posted:

prefer B here, though I'd probably just write it like this

code:
FartBoss::FartBoss()
  : m_pPototo(0), m_pChipes(0), m_pTigerStyle(0) { }

real talk C++ should let you drop the braces and just write

C++ code:
FartBoss::FartBoss() : pototo(0), chipes(0), tigerStyle(0);

tef
May 30, 2004

-> some l-system crap ->
c++ makes my brain hurt

Dr. Honked
Jan 9, 2011

eat it you slaaaaaaag
right now i am looking at real code which is worse than my above example, it's over 100 lines long and makes me want to hand out beatings. it has function calls interleaved amongst the initialisations in the function body.

FamDav posted:

real talk C++ should let you drop the braces and just write

C++ code:
FartBoss::FartBoss() : pototo(0), chipes(0), tigerStyle(0);

i agree. c++ has so much wankery in it

tef
May 30, 2004

-> some l-system crap ->
let's make c++--

i do like the way rust is progressing though but gamedev is going to be writing terrible c++ for years

JawnV6
Jul 4, 2004

So hot ...

FamDav posted:

C is weird lookin' and looks like something you'd do in javascript because of semicolon insertion
it's so you can use // to comment a line and not worry about fixing up commas since each line ends without one

i guess its more common in verilog?

MeruFM
Jul 27, 2010

JawnV6 posted:

it's so you can use // to comment a line and not worry about fixing up commas since each line ends without one

i guess its more common in verilog?

otherwise known as foresight
it's common in javascript because ~json~
But putting them for initializers is weird unless you're actively adding and removing optionals?

I don't do no ceepeepee

FamDav
Mar 29, 2008

JawnV6 posted:

it's so you can use // to comment a line and not worry about fixing up commas since each line ends without one

i guess its more common in verilog?

i see the same amount of edge cases but if there is a semicolon involved i can see how comma-first would be more convenient.

im talking more about poo poo like

code:
var bitch = 1,
    booty = 2
    bossy = 3;
is valid js that does an entirely different thing from what you want.

FamDav
Mar 29, 2008
since we're talking initializer lists let's talk initializer lists.

Let's say I wrote a class

C++ code:
class BasedGod
{
    int swag;
    int jerry;
    int rice;
  public:
    BasedGod(int lilB) : rice(lilB), jerry(rice), swag(jerry) {}
};
this is undefined because initialization occurs in variable declaration order, not initializer list order

now imagine a class that is 100 lines long and has variable declarations interspersed with method declarations and


tef posted:

c++ makes my brain hurt

Posting Principle
Dec 10, 2011

by Ralp

tef posted:

c++ makes my brain hurt

that means you need to write more until it beats you into numbness

I hope rust works out as well, but I will always a soft spot in my heart for the craziness of c++

Posting Principle
Dec 10, 2011

by Ralp

Jerry SanDisky posted:

that means you need to write more until it beats you into numbness

I hope rust works out as well, but I will always a soft spot in my heart for the craziness of c++

the soft spot is a malignant tumor

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
i still think clay is super cool. how's rust come along in the last year or so?

Zombywuf
Mar 29, 2008

tef posted:

let's make c++--

Clay http://claylabs.com/clay/

lol snap

tef
May 30, 2004

-> some l-system crap ->

Otto Skorzeny posted:

i still think clay is super cool. how's rust come along in the last year or so?

clay looks younger than rust and just as unstable

rust is coming along in the sense that they are writing lots of code in it and then slowly breaking it, trying to make the parts fit together.

give it time, see how it comes out. they seem to be in the process of smoothing out the major features

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->
see also http://chapel.cray.com

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply