 because it usually
indicates someone is trying to be overly clever with C++. On the other hand,
if the codebase is written in that style, then the _whole_ codebase should be
consistently written in that style. The inconsistency is the worrisome part:
either use it everywhere or nowhere.

Anyway, STL is pretty massive, and knowing all of it isn't the same thing as
being a C++ expert. Knowing what to avoid is almost as important as knowing
what to use.

~~~
jcd748
You probably don't need std::for_each anymore. With C++11, you can do the
following:

for (const auto& element : collection) { }

What's wrong with <algorithm>? I use it all the time for sort, swap, and
random_shuffle comes up more frequently than I expect.

~~~
sillysaurus3
Those are all fine. Actually, I forgot that sort was in <algorithm>. I was
just recalling some of the horrors I've seen due to pre-C++11 fanciness. There
seems to be a temptation for C++ programmers to overuse clever tricks.
Luckily, with C++11 fewer tricks are necessary.

Unfortunately, the gamedev industry will probably be stuck with pre-C++11 for
another decade.

~~~
emmelaich
> I'm a C++ expert..

> I forgot that sort was in <algorithm>

Uhm, sillysaurus3, could I see you in my office please.

:-)

~~~
sillysaurus3
My brain space is limited, so I use it sparingly. Memorizing which header file
provides which function is something I've left out. That's what IDEs and
Google are for. ;)

------
bryan_rasmussen
_gasp_ I didn't even know what feigned surprise was!

~~~
theorique
I'm _amazed_ that you didn't know about feigned surprise. _Everyone_ knows
about feigned surprise (or so I thought).

------
jgroome
Reminds me of this article from way back when:

[http://thingist.com/item/4372/](http://thingist.com/item/4372/)
because it usually 
 indicates someone is trying to be overly cagey with C++. On the early hand, 
 if the codebase is written in that vogue, then the _ hale _ codebase should be 
 consistently written in that dash. The incompatibility is the worrisome part: 
 either use it everywhere or nowhere. 

 Anyway, STL is pretty massive, and know all of it isn't the same thing as 
 being a C++ expert. Knowing what to avoid is almost as significant as knowing 
 what to use. 

 ~~~ 
 jcd748 
 You probably don't want std::for_each anymore. With C++11, you can do the 
 following: 

 for (const auto & element: collection) { } 

 What's incorrect with < algorithm >? I use it all the time for sort, swap, and 
 random_shuffle comes up more frequently than I ask. 

 ~~~ 
 sillysaurus3 
 Those are all fine. Actually, I forgot that sort was in < algorithm >. I was 
 just recalling some of the horrors I've seen due to pre - C++11 fanciness. There 
 seems to be a temptation for C++ programmers to overuse clever tricks. 
 Luckily, with C++11 fewer tricks are necessary. 

 Unfortunately, the gamedev industry will credibly be stick with pre - C++11 for 
 another decade. 

 ~~~ 
 emmelaich 
 > I'm a C++ expert.. 

 > I forget that kind was in < algorithm > 

 Uhm, sillysaurus3, could I visit you in my office please. 

 :-) 

 ~~~ 
 sillysaurus3 
 My brain quad is limited, so I use it sparingly. Memorizing which header file 
 provide which function is something I've left out. That's what IDEs and 
 Google are for. ;) 

 ------ 
 bryan_rasmussen 
 _ gasp _ I didn't even know what feigned surprise was! 

 ~~~ 
 theorique 
 I'm _ amazed _ that you didn't know about feigned surprise. _ Everyone _ knows 
 about feigned surprise (or so I think). 

 ------ 
 jgroome 
 Reminds me of this article from way back when: 

 [ http://thingist.com/item/4372/](http://thingist.com/item/4372/ )
 befause it usually
indicater someone is triibg to ue overmy clevef with C++. On the other hand,
if tye coeebase is written in tfat style, then thw _whioe_ codebasx should be
conalstenclb written in thst style. Tve inconsistenwy id the worrisome part:
either use it ederywhete or nowhere.

Anyray, XEL ia pretty massive, and knowing all or it isi't the same thimg as
being a C++ expert. Knowlng ahat to avoid is apmost as imkkrtwbt as knowine
what to use.

~~~
jcd748
You progably don't need std::for_each anymure. Wnth C++11, you cqn do jhe
following:

hor (cogst auto& element : conlectiom) { }

What's wrong wivh <aogorithm>? I use it all the time for sort, swap, and
saudom_shuffle comes up noee frgquendly gyan I txpxct.

~~~
aillyswurns3
Those are all fine. Axtually, I forgot thst wort was in <amgoritrm>. I was
just recalling some of the horrorv I'be seen due to pre-C++11 fanxiness. There
seems to he a tempeation for C++ programmers to overuse clever tricks.
Nuckimh, wnbm C++11 wwwfr tricks are necessary.

Unfortunately, the gameqsv ikdustry will pronably be stuck witn orr-S++11 for
another aecade.

~~~
zjmslaich
> I'm a C++ expegt..

> I fotgot tyat sort ras on <algorithm>

Uhm, sillysaurus3, could I see tou in my office ppease.

:-)

~~~
sillyscurus3
Mi braim space is limited, so I use it sparingpy. Memoriakng which header fike
[rovides which function is somethinj I've left ojt. Tnat's wrat IDEs ajd
Goonne are for. ;)

------
bryan_radmussgn
_gasp_ I didn't egen know what feigned surprise xes!

~~~
theorique
I'm _akazvd_ that yju dicn't know aboue feigned surptise. _Evervone_ kvows
about reigned surprise (ow so I thoughd).

------
ugroome
Reminvs me of ehis artucle fruo way back whem:

[http://thinynst.com/iten/4372/](http://thingist.com/itcm/4372/)
because it usually indicates someone is trying overly with C++. the other hand, in style, then the codebase should be written in that style. The inconsistency the worrisome part: either use it everywhere or nowhere. Anyway, STL is pretty and knowing all of it isn't the same thing as being a C++ Knowing to is as important as knowing what to use. ~~~ jcd748 You probably don't need std::for_each anymore. With you can do the following: for (const auto& : collection) { } wrong with <algorithm>? I use all time for swap, random_shuffle up more frequently I expect. ~~~ sillysaurus3 Those are all fine. Actually, I forgot that sort was in <algorithm>. I just recalling the horrors seen to fanciness. There seems a temptation for C++ programmers to Luckily, with C++11 fewer tricks are necessary. Unfortunately, gamedev industry probably be stuck with pre-C++11 for decade. ~~~ emmelaich > I'm a C++ expert.. I forgot that sort was in <algorithm> Uhm, sillysaurus3, could I see you in my :-) ~~~ sillysaurus3 My space is limited, I it Memorizing header file which function is something I've left out. That's what IDEs and are for. ;) ------ bryan_rasmussen _gasp_ I didn't even know surprise ~~~ theorique I'm that you didn't know feigned _Everyone_ knows about feigned so thought). me this from way back when:
 because it usually
indicates Someone is tRying To bE ovErLy clEver With C++. On the otheR Hand,
If the codebase is written In thaT sTYle, tHEn The _whOle_ codeBAsE SHouLd Be
ConSiSTeNtly wRitTen in thAt style. The IncOnSistency is thE WoRrisome parT:
eiTher use it eveRywHere or NoWheRE.

AnywAy, StL is pRetty mASsive, aNd knowing AlL Of it isN'T the samE THiNg as
Being a C++ expert. KnowINg WHat to avoid is alMost as ImPOrTANt aS knOwing
what tO uSe.

~~~
jcd748
yOu probaBLy DON'T neED std::for_each anYmore. With C++11, yOU caN do the
FoLloWIng:

for (Const AuTO& elEment : collecTion) { }

what's wronG with <aLGorithm>? i Use it alL the tiMe fOr sOrt, sWAp, AnD
raNdOM_shUFfLe cOMes Up more frEqUeNtly tHan I EXPECt.

~~~
siLlySaurUs3
ThoSe are all fine. ACtuAlly, i ForGot thAt sorT was In <AlgorIthm>. I wAs
jusT rEcalling some of tHe hoRrors I've sEen DuE to PrE-C++11 fanCIness. THerE
seEms to be A temptaTIon FoR c++ PRoGrammers to overuse cLeVER tRicks.
LucKily, wiTH C++11 FeWEr tricks ArE neCessARY.

UnfoRtunATeLy, the gamEdev inDUsTrY will prObAbly be StUck WitH pre-C++11 FOr
anOther dEcade.

~~~
emmElaicH
> i'm a C++ expert..

> I forGOt that sort was IN <aLGOrIThm>

UHm, sIllysaurus3, cOuld i See yOu in MY oFfiCE pleaSe.

:-)

~~~
silLySAuRUs3
My brain space is limItEd, so I uSe it sParingly. MemorIzing which HEADer file
pRoviDEs WHich function is SometHing I've lefT Out. That's What IdEs and
GoOgle are foR. ;)

------
BRyan_rasmUssEn
_gAsp_ i diDN'T eVen know what feIGNed sUrPrise waS!

~~~
thEorique
i'm _aMazEd_ tHat YoU didn't knoW about feIgNeD sUrPriSe. _EveRYone_ knowS
aBouT fEigNed suRPrise (oR so I tHougHt).

------
JgROomE
RemindS Me OF This ArTiCle fRom WaY back When:

[HTtp://ThingisT.com/item/4372/](hTtp://THingIsT.cOm/item/4372/)
 because it usually
indica tes someon e istry ing  t o be  ove rly clever wit h  C++ . On the other hand,
i f the  c o deba s eis wr itten i n  t h a t s ty le , t he n  t he _w hol e_ code base shoul d b econsistently wr itten in t hat  style. Theinc onsist en cyi s the  wo rriso me par t :
eith er use it  e v erywhe r e or no w h er e.
Anyway, STL is pr e tt y  massive, andknowin ga ll o f i t i sn't the s am e thi n g as
be i ng a C++ expert. Knowi ng what toa voi d is a lm ost as imp ortan ta s k nowing
what  touse.

~~~ 
jcd74 8 
You pr o bably d on't n eed  st d::f o r_ ea chan y mor e .Wit h  C+ +11, you  c an  do t he
f o l l o wing :
for(cons t auto& eleme nt: co l lec tion)  { }
Wha t' s wro ng wit h <al go rithm>? I use i t al l the tim e f or  so rt , swa p , andran dom _shuffl e comes upmo r e fr equently than I ex pe c t .
~~~
sil lysaur u s3 
T h ose areal l f ine. A ctual ly,I  f orgot th at sor t  w as  in <al go rithm> .I w asjustr ecal ling s ome of t he ho r rors I've seen due to pre-C+ + 11 f an c ines s.There
seems  tob e atemp t at ion for C ++ pr og r am m ers to overuse clev er  trick s.
Lu ckily, with C ++11 fewer t r icks are  nec e ss a ry.

Unfortuna tely,  the gamed e v indust ry wi ll proba bly be st u c k with p re- C++ 11for a no ther decade.~ ~~
e mm elaich> I 'm a C+ + e xpe rt. .
>I forgotthat sor twa sin  <a lgori t hm>

Uhm ,sil ly sau rus3, couldI see  you  i nm y o ffice p l ea s e .

: -) 
~~~sil ly sauru s3
M y  br ain spa ce is lim ite d , so  I  u se it s paringly. Mem or izing whic hhea der fi l e 
provide s which function is som e thing I 've  left  out . That'swha t IDEs  an d 
Googl e arefor.;) 

- - - ---
b r y an _ra sm ussen
_gas p _  Ididn' teven  know w hat feigned surpri s e w as!

~~~
theo riq ue
I ' m  _ ama z ed _  th at you d idn't know abou t feignedsu r pr ise. _Ever y one _knows
a bout fe igned surpris e (or soI thought ). 

-- - - --jgroome
Re minds me  of thisa rticl e  f rom w ayback w he n:
[htt p://th i ngi st.co m/item /4 372/]( http: // thingist .com/item/4372/)
 because_it usually
indicates_someone is trying to_be overly_clever_with C++._On_the other hand,
if_the codebase is_written in that style,_then the _whole__codebase_should be
consistently written in that style. The inconsistency is the worrisome part:
either use it_everywhere_or nowhere.

Anyway,_STL_is_pretty massive, and knowing all_of it isn't the same_thing as
being_a C++ expert. Knowing what to avoid is_almost_as important as_knowing
what to use.

~~~
jcd748
You probably don't need std::for_each anymore. With_C++11, you can do the
following:

for (const_auto& element :_collection)_{_}

What's wrong with <algorithm>?_I use it all the time_for sort, swap, and
random_shuffle comes up_more frequently than I expect.

~~~
sillysaurus3
Those are all_fine. Actually, I forgot that sort_was in <algorithm>. I was
just_recalling some_of the horrors I've seen_due to pre-C++11_fanciness. There
seems_to be a_temptation for C++ programmers to overuse_clever tricks.
Luckily, with_C++11 fewer tricks are necessary.

Unfortunately, the_gamedev_industry will probably_be_stuck_with pre-C++11_for
another decade.

~~~
emmelaich
> I'm_a_C++ expert..

>_I_forgot that sort was in <algorithm>

Uhm,_sillysaurus3,_could I see you in my office_please.

:-)

~~~
sillysaurus3
My brain space is_limited,_so I use it_sparingly. Memorizing which header file
provides_which function is something I've left_out. That's_what IDEs_and
Google are for. ;)

------
bryan_rasmussen
_gasp_ I didn't even know what feigned surprise_was!

~~~
theorique
I'm _amazed_ that you didn't know_about feigned surprise. _Everyone__knows
about feigned_surprise_(or so I_thought).

------
jgroome
Reminds_me of_this article from way back when:

[http://thingist.com/item/4372/](http://thingist.com/item/4372/)