« first day (1039 days earlier)      last day (3904 days later) » 

11:00 PM
@TonyTheLion With good reason -- a lot of the deeper template stuff is nearly impossible for an (even close to) average programmer to understand. I long ago made a conscious decision to stay away from most of it unless the alternatives are really unreasonable.
 
With around 17k questions in the , it's fairly popular.
 
20 years ago, I'd probably have been whole-hog into the deepest template stuff imaginable, just because it was there. Not so much any more though...
 
the worst thing about templates is that you're writing 'code' that executes at compile time.. but that there's no way to actually debug at compile time
 
templates and the heavy investment into the wankery thereof can produce the very cleanest interfaces and fastest code.
 
i need to write that template-instantiation debugger
 
11:02 PM
but it comes at a pretty high cost.
 
@Rapptz It is, but only a little over half of those are also tagged C++. Quite a bit is things like web page templates, dialog templates, etc.
 
so unless you have some serious cause to have the cleanest possible stuff, it's not usually a worthwhile tradeoff.
 
i'd like a visual debugger (and profiler) for template instantiation
 
I get 8,924 for
 
@JerryCoffin Yea makes sense. Though I'd love to be able to understand it and play with it, but the times I've tried I have found it quite hard.
 
11:04 PM
@Rapptz Seems to match my results -- just => 16.5K, -> 8.9K (where half would be ~8.25K).
 
@willj: a peeve of mine, you don't seem to capitalize I in cases where it should be.
 
@TonyTheLion I think of templates like Saffron in cooking: the best (for some things), and very expensive -- but a little can go a long ways, and using too much can lead to utter ruination.
 
it hurts my eyes and my brain bleeds (in regards my peeve, not templates)
 
I don't even know what you guys consider "deep templates"
Anymore than template<typename T>?
 
@TonyTheLion I'll endeavour to use the correct capitalisation!
 
11:07 PM
@Rapptz Xeo's indices trick, I would consider in that category
@willj :)
 
@Rapptz Like with water, I don't think there's a really clear line of demarcation between "shallow" and "deep".
 
@TonyTheLion Think of it not as indices, but an integer sequence. It's pretty basic really
 
@TonyTheLion Indices are unfortunately pretty simple.
 
My puny mind finds that hard. I don't think I could write it off the top of my head.
 
I was raised in IRC channels where correct capitalisation was considered pretentious ;)
 
11:08 PM
lol
One of my co-workers doesn't do the capitalization of I's and it drives me batty
 
@TonyTheLion Given an upper limit N, make a template of <0, 1, ..., N - 1>.
 
I'm not one to judge people quickly, but do that and I will judge you :P
 
i don't mind
 
I had it coming
 
yes, yes you did :P
 
11:10 PM
@Rapptz I'll have to toy with it some day.
 
Anyway, I actually learned all of this stuff pretty recently
Dec 4 '12 at 0:50, by Rapptz
I still don't know how to use variadic templates.
 
@JerryCoffin I would consider my knowledge of templates pretty deep - but without a way to debug them, doing anything excessively complex is just masochistic.
 
So Robot is a masochist?
 
@TonyTheLion so am I ;)
 
Once you get used to it there isn't much to "debug"
 
11:13 PM
@willj ...and (apparently) Luc, Xeo, etc.
 
@Rapptz It's a lot easier to think of them in terms of core function, IMO.
 
@JerryCoffin OMG Luc.
 
@willj Besides if anything errors out you can use static_assert or the compiler will error out for you.
 
if you have a variadic list of T..., and then a tuple<T...>, then indices is the list of, well, indices, that you need to unpack to access every element with std::get.
 
Template compiler errors are like death
 
11:14 PM
Well, with time you get used to them. Just like every error.
 
@TonyTheLion I think by almost any standards (even somebody like David Abrahams) Luc is pushing the limits.
 
Mysterious internal compiler errors are nasty as well. You end up having to remove line-by-line to see which one is triggering the bug.
 
@JerryCoffin Yea, well, if you say that, it must mean something.
 
@Rapptz Try to understand the errors you get if you use boost::multi_index_container
 
@JerryCoffin No. That guy who wrote an interpreter that would interpret Haskell at compile-time, that was pushing the limits.
 
11:15 PM
@TonyTheLion Yes, but it may mean more about my ignorance than their skills.
 
not that I'm saying that Luc doesn't template wank with the best of them.
 
Sometimes I feel like I'm missing the right way to think about things, in order to solve programming problems.
 
@willj I don't use boost.
 
@DeadMG He likes wanking it for sure.
 
I have it though, almost never use it.
 
11:17 PM
also, boost::mpl, while being awesome, is taking things just a bit too far
 
We should have like a Lounge Template Masturbation Contest
 
room topic changed to Lounge<C++>: Templates 101 [c++] [c++11] [c++-faq] [no-questions]
 
room topic changed to Lounge<C++>: Template Masturbation Contest [c++] [c++11] [c++-faq] [no-questions]
 
:P
 
We could have like Template Masturbator of the Month.
 
11:18 PM
Here's my entry
 
The winner gets a dildo
 
I still don't know how I caused a linker error
 
Apparently I use boost::optional, boost::algorithm::string::replace, boost::variant, boost::container::flat_set, boost::msm and boost::circular_buffer.
 
does it count as masturbation if it's actually used in production code?
 
not really.
but it's pretty unlikely you have a production-code template use that matches the non-production wankery
 
11:20 PM
@DeadMG i'm sure it pales in comparison
 
some of the code snippets I've seen thrown around in this Lounge, are quite mind boggling
 
@TonyTheLion There are enough different programming problems to solve, that I doubt anybody's really great at all of them. Years ago at BoostCon I was talking with Eric Neibler, pointing out some about a way of doing parsing (using the standard library) of which he was apparently unaware. A smart guy who knows a huge amount, but quite apparently hadn't considered how I was doing things. That's not to brag either -- I don't think there's any real doubt that overall he's better at C++ than me.
 
You could probably find some crazy stuff on Coliru's history.
 
On Ubuntu mouse middle click (mouse-wheel click) is equal to paste. So I end up pasting all kind of crap in my code while scrolling through it and only noticing it much later when the build fails.
 
@DeadMG how about a working C++ parser generated (with templates) from a grammar defined in terms of C++ types?
 
11:21 PM
@willj Boost.Spirit?
 
@JerryCoffin Hmmm interesting.
 
@TonyTheLion I know what you mean. I used to be that guy who was like, "Post code, post error message, DEBUG MY CODE PLIX".
 
@DeadMG nope, no third party stuff for the parser - but boost::wave (spirit) for the lexer/prepro
 
Programming seems to require a certain type of mindset, and a certain way of thinking.
 
@willj No, I meant, been there seen that, as it were.
 
11:22 PM
There's also meta-parse that does it in compile-time.
 
ultimately it really depends on exactly what it is that you have because
 
I can step through code and debug it, but sometimes I'm just plain lost, because I don't understand all code around the place I'm debugging
which is something I had a lot at my current job
 
@TonyTheLion I think it requires several ways of thinking, with kind of (so to speak) some meta-thinking about which way applies best to a particular situation.
 
there was just no way I could understand it all without spending weeks debugging it and seeing what it does.
 
I think we could do awesome things with this API. Imagine the "run the code" button bringing up an inline editor that allows running the code and seeing the results, all while still seeing the documentation above. P12 08:24, 20 August 2013 (PDT)
 
11:24 PM
I like to understand what I'm looking at
and generally, that's the first thing I'll try to do
 
cppreference likes your API @StackedCrooked
 
but this huge codebase was just impossible, and debugging it was very hard.
 
Really?
 
@DeadMG but does it parse actual C++ source?
 
so many large classes with huge functions
 
11:24 PM
yeah that P12 guy is the admin iirc
 
@TonyTheLion I think everybody runs into that. In fact, pretty much the definition of a large project is one that nobody really understands (or probably ever did). At most, people can understand pieces (and some general idea of how the pieces fit together).
 
and lots of members
 
@TonyTheLion This is really more about fail interfaces and module limitations.
 
Hmmm
I may be a bit overzealous trying to understand everything I look at
 
Here's the page if you lost it. It's pretty annoying to browse templates in cppreference.
 
11:26 PM
Just found it. Nice :)
 
whoops
 
@JerryCoffin Actually a lot of the code I worked on was all written by one person
 
my parser told my semantic analyzer that it found an operator}.
 
@JerryCoffin after a while of working with large projects, you get good at figuring out how things work quickly ;)
 
@TonyTheLion The vast majority of software engineering centers on remaining ignorant of most of the code, and function anyway.
 
11:27 PM
I gave up after months of frustration and almost burning out on it
I just found myself getting nowhere
@JerryCoffin Yea, I understand what you mean, but if the name of the function doesn't really tell you what it does, or is too generic to really know, you have only one way to find out.
 
@TonyTheLion Doesn't mean he ever really understood the system as a whole. I've written quite a few things that I understood the individual pieces, and knew how they fit together, but that didn't mean I had ever really thought much (if at all) about the precise interact between function X calling function Y in the context of a call by function Z.
 
Hmmmm
 
yay
I made some changes to the Wide compiler and it kinda slightly workses.
 
@JerryCoffin Agreed.. it's essential not to look too hard at the details, in order to see the big picture. The art is to ignore the parts that you don't need to understand.
 
@willj Nope. My definition of "large" is flexible that way -- it's based on effects, not lines of code. As I progress and learn to understand larger projects faster, my definition of "large" changes to suit.
 
11:31 PM
I really suck at understanding somebody else's code. It feels like I'm looking at Egyptian hieroglyphs.
 
@StackedCrooked Same T_T
 
@StackedCrooked I know that feeling.
 
Probably the code quality is a major factor.
And they used an automatic formatter in the past which broke all lines in two.
 
It's like artificial intelligence. It forever remains on the frontier of impossible, because as soon as we figure out a practical way to do something, it's not AI anymore it's "just" <technique X>.
 
I don't know if anyone finds my code hard to read, but I always hope they don't.
 
11:33 PM
My inability to understand code forces me to write clear code myself.
 
most production code is pretty bad.. but most "working" code follows common patterns between codebases
 
Understanding other people's code can be a bitch
 
@StackedCrooked Reading OPC takes an extra level if discipline (and some extra time, but mostly ability to force yourself to continue, even though it's unpleasant).
 
Although, i did read some of the robot's ogonek code and i was able to understand it better than usual, props to him i guess
 
Robot has this amazing skill of writing fairly clean and readable code
 
11:34 PM
I once read a blog post that said it helps to pretend to type the code as you are reading it.
I find the Robot's lack of whitespace rather confusing..
 
Why did no one see the obvious here? stackoverflow.com/a/18346549/85371
 
That's the only thing I understand about his code anyway.
 
my code at work - which other people have to read - is clean and well commented
my own personal projects.. not so much
but i'm working on better habits ;)
 
I always make sure that my code is readable, it's usually one of my top priorities.
 
@sehe Your answers are always long and correct. Nobody reads them anymore we just upvote ;)
 
11:36 PM
basically this ^
 
@sehe lol
 
remote: added 5 changesets with 154 changes to 74 files
 
@Borgleader Don't. It's not even long. I always include fully working, tested examples. It's my incertainty showing
 
I totally did not go too long without syncing with bitbucket.
 
But you never do!
 
11:38 PM
@DeadMG lol
 
@Borgleader Your answers are always long and correct. Nobody reads them anymore so I just downvote and nobody notices :)
Well, that went awry..
 
I always get uncertain when answering, and mostly I expect swarms of downvotes
 
Fuck scrolling..
 
> Note how I subtly changed your to_string method to use a switch where it should :)
 
Its a pleasant surprise when I get upvotes
 
11:39 PM
@TonyTheLion I was like that when I first came to SO. Not so much now
 
@TonyTheLion I hope for swarms of downvotes, most of the time.
 
@sehe I think a lot of it is simply that many (most?) don't really understand Koenig lookup -- and many who do understand it to at least some degree find it counter-intuitive (distasteful?) enough that they basically avoid it anyway.
 
@Rapptz I'm exactly new to SO.
@DeadMG and you get swarms of upvotes
 
only because in the past, I got swarms of downvotes.
 
@JerryCoffin Well, it's not even about ADL here, really, it's just basic function overloading really.
 
11:40 PM
and learned from my mistakes.
 
oh I've learned from my mistakes too
but on occasion I still fall for traps
 
it's a trap!
 
C++ has a few :)
 
@sehe It's not really about ADL, but it still depends on ADL (at least as written).
 
Wide doesn't have any traps.
 
11:40 PM
@JerryCoffin The ADL only involves using the same name as std::to_string to get the best API coherence if you will
 
I would say I've come quite a long way
 
principally because I only implemented a small portion of the language.
:P
 
I was once the noob I now laugh at
 
@DeadMG Yeah, that'll be the day.
 
fuck.
you know, I'm also kinda hungry.
@JerryCoffin heh.
 
11:41 PM
@TonyTheLion I'm still the noob I laugh at ;)
 
I want to eat another chocolate yoghurt thingy I have in my fridge
soooo tempting
@Borgleader I'm less noob, but I mostly cry at my mistakes
 
NOM MOTHER FUCKING NOM.
 
@Borgleader I'm still the newbie, which is why I try to be nice to them instead of laughing. :-)
 
did I mention
that I am fuckin' hungry?
 
@JerryCoffin You're too humble. :)
 
11:42 PM
@JerryCoffin For which definition of newbie?
 
@DeadMG Go eat
 
@JerryCoffin I've updated the wording in the answer to explain this
 
@TonyTheLion Is he also a fuckin' indie bundle?
 
lolll
 
@DeadMG loll
 
11:43 PM
@Borgleader One that fits, but isn't itself very clearly defined, of course.
 
:)
My mother is visiting in three days
My flat better be clean
:P
 
lol
 
man
I better apply for some jobs.
WGP are gonna be checkin what I've been up to.
 
I thought you had come to the realization you're broke
 
I have.
 
11:46 PM
@TonyTheLion Better to hire somebody to clean it, so you can complain about how crappy a job they do when she starts nit-picking.
 
How can one not realize.
 
that doesn't make it less incredibly depressing to search for jobs.
 
@DeadMG I don't think its fair that you, who is legitimately skilled in programming, are having such a hard time finding a job.
 
wwell
by and large, I'm going to say that's what happens when you didn't get along with your university in this country.
 
I thought development was the top field for finding jobs. Possible troll?
 
11:47 PM
plus the whole "recession" thing
 
@JerryCoffin No, I'll clean it myself and be a responsible adult.
 
I was wondering about something, Cat said yesterday that C++ code wasn't portable across architectures because it exposed too many details (such as bitness/endianness/alignment). Now assuming he's correct. Is it possible to "fix" this without notable performance loss?
 
@Borgleader No. It's not possible to "fix" at all, really.
 
I never took very long to find a job though. Part of that is luck certainly. But a big part of it is simply the shortage of software engineers.
 
@DeadMG I think you've had enough time off -- time to go back and finish school. I know it's a PITA, but still honestly worth the trouble.
 
11:48 PM
@JerryCoffin I've actually been thinking about it. The real question is whether or not I can get government funding to re-take my third year.
 
@BDillan It is when you already have some commercial experience, which puppy doesn't have.
 
Not that I care about Forbes.
 
I think the main reason we are in a recession is because computers are virtualizing everything!!!!!
true story
 
It just sounded cool to mention it.
@BDillan Yeah, which leaves us.
 
@BDillan The main reason we are in a recession is because the rich have all the money, so nobody else can afford to start a business or lend money or anything like that.
 
11:49 PM
software engineers are worse than capatalists
 
@TonyTheLion I used to think (more or less) that way too. Then one day I was telling my wife something like "don't worry about getting somebody to do it -- I can take care of it." Her reply really made me think for a minute -- something like "Why? Don't you want him to have a job?"
 
we take the jobs!
 
@DeadMG I don't think that reasoning is economically sound.
 
@DeadMG So basically the only way for this not to be a problem is to have a VM between your code and the machine it's running on?
 
@Borgleader Er, I think you still might be fucked.
 
11:50 PM
@JerryCoffin Yea there is that point that I could give someone half a day of work with this, but then, with my move and stuff, I haven't that thick of a wallet at the moment
 
@TonyTheLion Fair enough.
 
@StackedCrooked I'm not so sure, personally.
IMO it is no coincidence that most people are running low on money, and the wealthiest are running very high on money.
 
@DeadMG So there is absolutely no language that is portable across architectures? Wow...
 
I mean, where the fuck has everyone's money gone, if not to the people with loads of money?
@Borgleader No, I never said that. Just not C++ or any language like it.
 
Money is not a resource that you can monopolize like gold or oil.
 
11:51 PM
@StackedCrooked Most of it simply runs contrary to reality. Most rich people have most of their money invested -- typically in stocks, helping fund companies that produce jobs.
 
Automation will take over factory workers soon enough and agriculture (harvesting) And that requires programming. Hence programmers will be responsible for taking away jobs
so more efficiency means more need for programmers
 
@StackedCrooked What makes you say that?
 
@DeadMG some of it literally dissapeared into nothing in 2008, when the housing market collapsed because of these "toxic assets" and subprime mortgages (ie assets that were decreasing in value instead of increasing, which were backing mortgages)
 
@TonyTheLion That is true. But nowhere near enough to justify the current problems.
 
@DeadMG I don't know. My thoughts, I guess.
 
11:54 PM
Stupid thought - but more money to the public means more damage to the environment. So aren't capitalists actually good in a sense?
 
@Borgleader It's mostly false in the first place. Most code can be written portably if you care enough to bother (at least most code that isn't something like "initializing the paging hardware of the CPU", or something that's inherently pretty non-portable). Mostly it's an economic decision: do you gain enough by making this code portable to justify the expense of doing so?
 
@JerryCoffin Well, that's not strictly true. The user can observe platform-specific values simply by, for example, passing sizeof(void*) to a template or constexpr function.
 
@DeadMG I watched some interesting documentaries about this, and billions did literally go down the drain. I mean, when Lehman Brothers collapsed, and then lots of other banks threathened to go down as well, some of these where bailed out with our tax money, and that wasn't small amounts.
 
If you look at (de)serialization. If have a binary file that you ship with your code which was generated on a big endian machine, and the code is run on a small endian machine you're going to run into some interesting issues.
 
so there's another place money went
 
11:56 PM
I'm wondering if, when designing a language, it's worth making this a non-issue for the programmers.
 
@TonyTheLion Yes. The question isn't really about how much money was lost, but more a question of where that money came from in the first place.
 
then the markets lost confidence and there went a whole lot more
@DeadMG some of it was made up out of thin air
 
quite true.
 
@DeadMG Yes, you can write non-portable code if you choose to do so -- but if you simply look at the end result and ask "can this be done in portable C++?", much more often than not, the answer is yes.
 
money they thought existed but in fact did not.
 
11:57 PM
actually that was a stupid thought
 
banks lend money they don't have, and then make real money off it when the borrower pays back
if the borrow defaults, the bank is fucked
 
@JerryCoffin Right. What I mean is, the core language fundamentally allows for non-portability in a thousand million ways, and removing that would be basically impossible.
 
Just updated My Facebook status from "Single" to "In a Trinity". #wayoverdue
 
@DeadMG It wasn't really money people thought existed that didn't. It's a simple fact that in many cases the real value of something results from perception -- i.e., what I can sell something for depends primarily on what somebody is willing to pay for it. When that's systematically reduced, the real value is reduced with it.
 
11:59 PM
Yep
 

« first day (1039 days earlier)      last day (3904 days later) »