« first day (1311 days earlier)      last day (3654 days later) » 

user3010322
5:00 PM
Because I using namespace std; in the function so that I can use free-function begin and let ADL activate for the template.
 
sbi
282
A: Why is "using namespace std;" considered bad practice?

sbiI agree with everything Greg wrote, but I'd like to add: It can even get worse than Greg said! Library Foo 2.0 could introduce a function Quux() that is an unambiguously better match for some of your calls too Quux() than the bar::Quux() your code called for years. Then your code still compiles...

 
You really did using namespace std; just for using std::begin;?
 
user3010322
But I have to using namespace std; in the function so I can just call begin() and let ADL kick in, right??
 
No?
Just do using std::begin;
 
sbi
@Rapptz That wouldn't help in this case.
 
5:02 PM
I haven’t used Frontpage in a while
 
@sbi He wants ADL.
 
@ThePhD Sigh.
Repeat after me: there's no use for using namespace std;.
 
user3010322
:(
 
sbi
Damn, why do I now get an invitation to the bin everytime someone bins a message of mine? DEAR SE CHAT GODS, I DO NOT WANT TO BE INVITED TO THE BIN!
 
Weird.
 
sbi
5:04 PM
@R.MartinhoFernandes While that is certainly true, using std::begin would have the same problem in his case.
 
It's true. There isn't and you should learn that and every time you think you've found an use for it, it means you should look around for how to do it properly, because using namespace std; is not it.
 
21 hours ago, by sbi
282
A: Why is "using namespace std;" considered bad practice?

sbiI agree with everything Greg wrote, but I'd like to add: It can even get worse than Greg said! Library Foo 2.0 could introduce a function Quux() that is an unambiguously better match for some of your calls too Quux() than the bar::Quux() your code called for years. Then your code still compiles...

Got it ;)
 
sbi
Good! :)
 
@sbi Why not?
 
sbi
4 mins ago, by ThePhD
But I have to using namespace std; in the function so I can just call begin() and let ADL kick in, right??
 
5:06 PM
@sbi Then using std::begin; is exactly what works.
 
sbi
6 mins ago, by ThePhD
begin, as written in my class, is being confused for the begin free function.
 
Pretty sure that's not a problem when he removes using namespace std;.
 
sbi
@R.MartinhoFernandes But it will be back the moment he's using std::begin.
 
Pretty sure it won't if he does it right.
 
sbi
You might have to better explain what your problem is, @ThePhD, but (I go out here on a limp) could it be you need this->begin()?
@R.MartinhoFernandes Yes, that's certainly a very true statement: If you do it right, your problems are solved. In it's also a rather worthless statement, though.
 
5:08 PM
@sbi That doesn't use ADL.
 
user3010322
The error changed in VC++ after I beat the problem over the head a bit. It was a copy constructor issue.
 
sbi
@R.MartinhoFernandes Indeed.
 
@sbi s/limp/limb
 
user3010322
A bounds( T&& ) overload (despite having SFINAE) was being picked up for copy construction, so I needed to add a few more type traits to the SFINAE to keep it out so it would just generate a regular copy constructor.
 
unless you're happy limping :)
 
user3010322
5:10 PM
VC++, of course, wasn't telling me that it was doing that, and instead told me I was passing too many arguments to the begin function.
 
sbi
@ThePhD Does VC meanwhile do proper two-phase lookup? It wasn't when I used it last time, and whether it did or did not accept a piece of code was rather irrelevant when the code was ported to some other compiler.
 
user3010322
So I thought ADL was going haywire, or something.
 
sbi
@TonyTheLion Too late. :)
 
user3010322
@sbi It fails to do so, spectacularly.
 
user3010322
template <typename T> ProperFunctionISwear () { RIGHTFOLD'S VAGINA; }; // Compiles with no problems in VC++
 
sbi
5:12 PM
@ThePhD So you shouldn't write generic code using VC. Years ago I've run into a dead end doing this, producing code I had to refactor in the face of proper two-phase lookup.
 
@sbi That's in their plans for... probably VS2013+2.
 
user3010322
@sbi I'm in the process of finding a new IDE for MinGW so I don't have to use VC++ anymore.
 
sbi
@R.MartinhoFernandes Oh well. The compiler writer that implements features around their tenth birthday...
 
user3010322
I am unfortunately disappointed by the lack of easy-to-use drop-in build formats, evne when I ignore my pre and post build steps.
 
sbi
@ThePhD You don't need an IDE for compilation.
 
user3010322
5:14 PM
I'm trying to switch entirely so I don't even have to touch VC++ again.
 
sbi
You can still write your code in any IDE you like, you just have to use a proper compiler to compile it.
@ThePhD Why? Why shouldn't your code work on VC, too, as long as it isn't too much hassle?
 
user3010322
Because I have to break my neck when writing generic code, and I've been doing nothing but that lately?
 
Xeo
@sbi There's the catch - ask Robot about 'hassle' and 'MSVC'.
 
> Edit: Guys. It's my fucking opinion, Ok?

This is the last time I open my mouth in this subreddit. Have fun guys.
 
Xeo
He can tell your kids good night stories about it
 
sbi
No, you got this wrong. You need to initially compile generic code with something other than VC, so that you do not run into bad surprises when you do it the first time. However, meanwhile VC mostly accepts correct code.
 
@sbi That's no longer true.
 
Xeo
@sbi Again, ask the Robot about that
 
Maybe for VS2008 or VS2010 within the subset of features they claim to support.
Forget about anything else.
 
sbi
@R.MartinhoFernandes Raises eyebrows. "Mostly".
 
5:17 PM
@sbi I stand by what I said.
 
sbi
Ah, you mean the VC11+14 stuff, right? I haven't used VC since then.
 
Exactly.
I spent a horrible week butchering my boss's refactoring until it compiled in this piece of crap.
He owes me big for taking holidays right before the "now let's get this working on MSVC" phase.
 
user1804599
> I swear
 
user1804599
Stop swearing.
 
i love cheeseburgers
 
sbi
5:19 PM
> [IntelliSense] doesn't even agree with the compiler. Yes, there is a justification for that, but sadly it doesn't make the product any better for that.
Haha!
 
Actually, I just posted the "trip report" for that week on reddit.
 
romanian cheeseburgers are also pretty fucked up in a good way
there's fries in them... and mayo
and cabbage
 
user3010322
Thankfully, MinGW covers almost all the use cases of VC++. I don't see myself writing code for Windows Phone anytime soon. DirectX 11 (even 64-bit) should be perfectly covered. The only thing I'll miss from Visual Studio is the PIX Debugger for graphics, which is fantastic and doesn't really have a rival (But that's more a DirectX thing and I'd lose it when I ported to OpenGL anyways).
 
sbi
@R.MartinhoFernandes So you're the grumpy cranberry, huh? Way to go to reach my age league.
:)
 
@sbi grumpy_cranberry, grumpy_banana, grumpy_strawberry, ... I keep forgetting the passwords so I just pick new fruits.
 
sbi
5:23 PM
Uh oh. The robot keeps forgetting. That's a very bad sign.
 
grumpy_fruit
 
@R.MartinhoFernandes lol
 
Isn't it slightly dangerous to say passwords?
 
@R.MartinhoFernandes KeePass!
You use it, how do you forget?!
 
I do, but for reddit, I honestly don't care.
 
5:24 PM
I personally use correcthorsebatterystaple. Seems safe enough with around 2000^4 unique passwords for me.
 
user1804599
KeepAss
 
user3010322
 
user3010322
@Xeo ^ There, I even got the for syntax down too.
 
(or perhaps I should have said pow(2000, 4), this is C++ room after all)
 
People on reddit are really downvote happy btw
 
sbi
5:26 PM
@R.MartinhoFernandes What are you gonna do when you run out of fruits to abuse for this? Abuse flowers? Animals? Children?
 
user3010322
Now I can make strided things participate in std::sort and friends. Hoo. Rah.
 
sbi
Oh, wow. A sizable portion of the kids from this room are in that reddit thread.
Anyway, I need to go. See you, folks!
 
See ya.
 
@ThePhD: Why such confusing syntax for int items[][5], where the array rows aren't aligned with columns?
 
user3010322
@xfix It's just some test code.
 
5:28 PM
(for a while I assumed it's just C++ standard to do so, I'm more of C programmer)
 
I wish I had motivation to do stuff atm
 
@Rapptz Guess what. He's a game programmer.
 
Yeah I know.
He mentioned PS3.
 
coolest feature about VS - the dark theme it comes with looks REALLY slick! :)
 
Easy to port :v
 
5:33 PM
My editor allows me to choose colors.
(not that I use dark, but it allows to)
 
most IDEs don't let you set the overall theme to dark, just the editor
 
I ended up using dark themes because I couldn't find nice looking light ones.
 
so you end up with light chrome around your shiny dark editor and it looks abhorrant
 
@Rapptz Solarized is niceish
 
@ScarletAmaranth: Well, the entire editor is dark, not just text.
 
5:35 PM
@xfix is it an IDE?
 
No, text editor. I don't like IDEs.
 
I use some weird Monokai derivative now.
 
I just don't like dark windows. I always hated Sublime Text, and its lack of good white themes.
 
@xfix too bad; I like IDEs
 
5:36 PM
-2
Q: What is a single page web application ? and How to create it?

user3583168I am hard core ASP.NET developer and completely abondened ASP.NET and all other platform specific technologies and learning FrontEnd technologies. I can fairly understand Javascript, Jquery, and some Jquery libraries. Recent years I heard people saying about single page applications. I seen some ...

 
I prefer dark themes to light ones now.
 
When your funny bone stops working
 
show me a C++ IDE that lets you set your entire / overall theme to dark
 
Yes, I know, everybody likes dark themes, but I don't :-).
 
(Jetbrains will do that I suspect)
 
5:37 PM
My IDE is terminal.
 
good for you
 
@ScarletAmaranth NetBeans, VC++, Eclipse, vim.
 
@ScarletAmaranth Easier for me to name the ones I know you can't (easily anyway). Qt Creator.
The rest do.
 
@CaptainGiraffe I can't find "set overall theme to dark" in NetBeans nor Eclipse
 
What is the definition of IDE anyway?
 
5:38 PM
Integrated Development Environment m8
 
My editor supports multiple files opened at once, is it IDE?
 
@ScarletAmaranth In both it is an easy css hack/theme
 
@xfix check wiki?
 
> Vim - based on vi, lightweight, highly extensible, keyboard driven, massive learning curve, cross-platform, way better than Emacs
Emacs - lightweight, highly extensible, keyboard driven, massive learning curve, cross-platform, way better than Vim
 
Wow, vim vs Emacs wars.
 
5:38 PM
@xfix One key run/build it is an IDE.
 
@xfix it's the software equivalent of your mom
 
@R.MartinhoFernandes rofl
 
@CaptainGiraffe I have that in Sublime Text.
My text editor isn't an IDE.
 
I have that in vim.
 
emacs also has +3 rsi
 
5:39 PM
@R.MartinhoFernandes Emacs really caught up on the editing with the viper mode.
 
@R.MartinhoFernandes Where'd you get that?
 
I want to mouse over my stuff to see types, I want an integrated debugger; on bad days I also want autocompletion (I can make do without IntelliSense - ish things but they're alright sometimes)
 
@Rapptz The /r/learnprogramming list of tools.
 
lol
It's cute.
 
Ah, MSVC. http://rextester.com/JWWIHU28749
Try commenting out the line XXX.
 
@CaptainGiraffe: Hm, I assume that F2 (open terminal), r (function which compiles, and runs the program), enter is not IDE.
 
heheh
 
@xfix I would say it is.
 
Holy shit, it's late.
 
@ScarletAmaranth You could probably get all of that in a text editor with plugins.
 
5:42 PM
@Rapptz or I can click next 5 times and have it ready in an IDE
 
what?
 
> Opinions about editors are notoriously personal. Obviously it's not "mediocre".
haha
 
I don't want to spend a month learning Vim and then another cherry picking good plugins
 
So, I'm confused. I'm using Kate for KDE, configured to open terminal by pressing F2. Is it IDE or not?
 
@ScarletAmaranth Vim does autocompletion without plugins
Also, in my opinion, it’s worth learning =)
 
5:43 PM
Regardless if you are using the terminal or a dedicated GUI wrapper(NetBeans/Eclipse) your toolset is an integrated development environment if you have integrated your tools with the environment.
 
@minitech Not intelligent auto-complete.
 
@Rapptz What does “intelligent” mean, though?
 
is that auto-complete aware of the programming language?
 
Also, tern, jedi are easy to install
 
I'm thinking about getting a sublime text license
 
user3010322
5:44 PM
I'm thinking about chopping my fingers off so I can't program anymore.
 
well, Jet Brains will have a decent C++ IDE - hopefully
 
@minitech If I do struct f { int x; }; and I have f g; would g. prompt x?
stuff like that
 
@Rapptz No, that’s not built-in, but the plugin is easy to install, after all
 
@ScarletAmaranth: No, it can only suggest other words found in the source code that aren't in the comments or strings.
 
default text editor auto-complete is non-intelligent and basically substring matching.
@minitech I know.
 
5:45 PM
that's by no means sufficient
 
(useful enough for me, at least it doesn't give 5,000 PHP functions)
 
What, easy-to-install plugins aren’t sufficient?
 
@ScarletAmaranth Every popular text editor has plugins for intelligent auto-completions.
 
do I also have a debugger with watches and nice mouse click breakpoints and other things :P?
 
If you want!
(I don’t)
 
5:47 PM
@ScarletAmaranth lol, watches.
 
"lol, he uses debuggers, noob"
 
(actually, now that I look into Kate plugins, it has XML autocomplete plugin (lol))
 
user3010322
I want watches where I can actually use functions
 
user3010322
ANd not dig into 20 class hierarchies of cruft
 
Are the people at my company the only ones that are endlessly frustrated by watch expressions that just get rejected?
 
user3010322
5:47 PM
Fucking VS
 
Ah, ThePhD agrees.
 
user3010322
I sure hope Qt's debugger is better
 
user3010322
If it's not, then I'm just going to ship back to notepad++ and command line my way to victory.
 
I write Haskell in Notepad++
 
Okay
 
5:48 PM
printf debugging FTW!
 
but imperative languages go hand in hand with a good IDE imho
 
@ThePhD AFAIK it's gdb. In terms of watching stuff it's a lot better than VS's.
 
I'm probably crazy, but I don't use debuggers.
I never had the need to.
 
then you obviously haven't written any code
 
Be polite, please
 
5:49 PM
Yes, I know how to use debugger, but I never had to use it.
 
@ScarletAmaranth IDEs aren’t the only things that can contain/be debuggers
 
I've never said they are
 
@ScarletAmaranth: Or perhaps it's just that I code golf a lot, and debuggers don't help with that.
 
I mostly write/wrote client-side JavaScript, and an in-IDE debugger would just be annoying
 
@minitech srsly?
 
5:50 PM
I have this :v
 
@ScarletAmaranth Yes, politeness is seriously a good thing
 
good enough for me
 
@Rapptz: That's great, you have undefined behavior here.
 
@Rapptz yeah this is nice
 
@xfix read the filename m8
 
5:51 PM
@Rapptz What's in the top right corner, looks like smaller version of code or screen.
 
@luk32 It is!
It’s a minimap
Also a scrollbar
 
@AlexM. You know. Despite me liking the editor a bit, I don't feel comfortable playing $70ish for it.
 
@minitech But it doesn't look like it covers bigger than the screen. What's it purpose?
 
I think it's because most of my productivity comes from the free plugins.
@luk32 Fast scrolling.
 
@luk32 If the code is larger than the screen, the small version of the code can still be smaller than the screen
(it is a lot smaller)
 
5:53 PM
@xfix If lines 4, 7 and 8 didn't help him. The filename will not progress his reaction.
 
@Rapptz What is "this"? It looks nice.
 
Sublime Text 3.
with a couple of plugins.
 
I mean, the GDB GUI.
 
SublimeGDB
I like it
 
I guess I could have just googled it. :P
 
5:54 PM
@minitech @Rapptz I mean, I saw something similar, but it was pretty long vertically, so you could click on the piece of code, and it would teleport you there, but here is seems like it covers same area. But I probably would need to see it in action to get it better =).
 
@luk32 It gets longer when the code is longer. The highlight you see just represents the visible portion, and is like the thumb of a scrollbar.
 
@minitech maybe if it's more code.... you got me =)
 
@luk32 See here
 
@Rapptz Thanks, this looks nice, I figured it looks like it when there is not enough screen to fill the minimap it just 'fits to the screen".
 

« first day (1311 days earlier)      last day (3654 days later) »