« first day (674 days earlier)      last day (4289 days later) » 

10:00 AM
    if(tempBuffer == NULL)
        free(tempBuffer);
lolwut?
 
The whole question is priceless.
 
temp[strlen(ReadBuffer)] = '\0';
A lot of misunderstanding in that question.
 
Xeo
An unneeded typename was an error in C++03 IIRC.. what about C++11?
 
10:19 AM
> The biology of aphids is bizarre: they can be born pregnant and males sometimes lack mouths, causing them to die not long after mating. In an addition to their list of anomalies, work published this week indicates that they may also capture sunlight and use the energy for metabolic purposes.
WTF.
 
@Xeo the using x = doesn't work in VS2012 RC. Great -.-
 
Xeo
@BartekBanachewicz Yeah, VS is shitty with C++11... other news?
 
there's this clang, right?
 
Xeo
There's Clang, but what should "this clang" be? :P
 
@BartekBanachewicz I have a 32-bit Clang that works with GCC's 4.6.3 libstdc++ on Windows.
 
10:27 AM
Any IDE's that will work with this?
 
not that I know of.
 
Because i really didn't expect VS2012 to be that shitty.
 
you should be able to use Codeblocks and QtCreator though by setting some stuff manually.
@BartekBanachewicz That's entirely your fault. We were already convinced of that.
 
@rubenvb If you look at them based on editor, not compiler capabilities, both are 2 classes below MSVS. That's the problem right now.
And any other compiler won't work that well with VS debugger. It's no-win.
 
@BartekBanachewicz Really? I enjoy QtCreator 2.5 a lot. Both are not compilers, mind you. Pretty stupid to bring up compilers with IDEs that can work with just about any compiler.
 
10:30 AM
@rubenvb I mean that MSVS would be the best IDE if the compiler had a bit more C++11 support.
 
One day I'll understand what's so great about VS.
 
@BartekBanachewicz You'll have to choose: either use MSVC with its debugger and no decent complete C++11, or use something else and learn to write good code so you don't need a fancy debugger, and have nice C++11 stuff at your disposal.
@R.MartinhoFernandes hehe, indeed. I never needed more than the gdb integration in Qt Creator. it already blew my mind away.
 
@rubenvb "You don't need a fancy debugger" that makes no sense. If you need a debugger, make it the best available. And IMHO everyone needs a debugger time to time (althought I observe my code to work pretty much at once lately, which I am indeed very proud of). I don't however think that writing code that works at first attempt should be ultimate goal. It might be worth a try, however, to let go of the IDE for some time and see for myself, i guess.
 
GDB is good enough, and C++11 support is worth more than visual debugger.
Or LLDB.
 
@CatPlusPlus is lldb any good yet?
 
10:35 AM
@BartekBanachewicz And what exactly makes it the best IDE?
 
Works on OSX, at least.
 
@CatPlusPlus is it more than a gdb clone?
 
@KillianDS Stuff. Buttons and shit.
 
@KillianDS Visual debugger, code editor, project management, code-completion and navigation. (and refactoring, which is still shitty in MSVS compared to C#. Duh.)
 
They made it a priority to make consistent command interface.
So, yeah, it might be a bit better. Less arcane, at least.
 
10:36 AM
Code editor is pretty much notepad with syntax highlighting.
 
Haha, VS and good code editor.
 
@BartekBanachewicz You mention nothing that for example eclipse can't do. I assume the C++ support for netbeans will be similar.
 
Only IDE with good code editor is Emacs. The best code editor is vim.
 
@KillianDS Both are written in Java.
 
10:37 AM
@KillianDS Don't forget Qt Creator which has pretty much the same.
 
@BartekBanachewicz your point being?
 
VS is written in C#, so I fail to see the significance.
 
@KillianDS I thought "being written in Java" is point already.
 
(Or did you think it's "native" haha.)
 
@CatPlusPlus Parts of it certainly are.
 
10:38 AM
You know, you could have made actual arguments. Like saying Eclipse sucks.
 
@BartekBanachewicz what does it matter which language it's in when it works decently?
 
@KillianDS He's allergic.
 
@CatPlusPlus Now if you're telling me that code editor based on terminal window is better, i can only wonder what made you so biased.
@KillianDS It doesn't. (work decently).
 
@BartekBanachewicz There's gvim. And I don't see how being based on a terminal window is a problem for a text editor.
 
@BartekBanachewicz why not? where does it perform so much worse then for example VS? I won't say it's the best IDE out there (because I find that statement ridiculous on its own), but you've given no single element why these IDE's are so much worse then VS
 
10:41 AM
@BartekBanachewicz Who says anything about terminals?
Why do people assume "terminal" when talking about vim or Emacs? Who the fuck uses terminal for vim or Emacs. Are you living in 1980 still.
 
Line numbers? Syntax highlighting? Code folding? Vim has all that.
 
I do use terminal for vim. It's great when working over SSH.
 
Also even the best IDE is still terrible, so.
Yes, but not for coding.
 
@CatPlusPlus Others are even more terrible.
 
10:43 AM
Yes, they all are.
 
@R.MartinhoFernandes and change indicators.
 
@BartekBanachewicz was that to be an answer to me? because my employer blocks any dropbox links :p
 
@BartekBanachewicz You can have that too.
 
does anyone here have a favorite terminal text editor?
 
I only ever use terminal for SSH.
 
10:44 AM
The only thing that makes me want VS is R#, and that's for C# code.
 
Duh. Even if you spend all these pointless hours configuring Vim, it's still editor not IDE
 
That's why it's not terrible.
 
Heck, IDE's were made to make programmers more productive than when using editors. And indeed, the goal was met.
 
And it's one of the best editors out there, so yeah, I'll take that over IDE any day.
I'm way more productive when the editor is not primitive as Notepad thanks.
Because writing and navigating code is 95% of the time.
The other 5% is reading it and finding stupid bugs.
Well, okay, maybe 80/20. But still.
 
Last time I checked most IDE's had fairly decent code navigation tools
 
10:47 AM
Visual debugger is nice, but not essential by any stretch, and it's a tool of last resort anyway.
 
Fixing stupid bugs may end up taking more than 5% of your time.
 
That's writing code, bud.
 
I would say, and most research can prove it, that writing code hardly takes more that 20% of the time.
 
C++ IntelliSense is fucked up. How does that count as an advantage?
 
And removing it.
 
10:48 AM
hmm
 
@R.MartinhoFernandes It's less fucked up than any alternative. Enough?
 
@BartekBanachewicz It's not less fucked up.
The alternatives don't have mismatches with the compilers.
 
@R.MartinhoFernandes Are we talking about code completion or live compilation? Because the latter indeed is fucked up. Like in "useless".
 
Code completion is pretty useless, too.
 
@CatPlusPlus Try typing OnHitEventAllocatorCallback::DefaultEventAllocatorCallbackProcessor by hand
 
10:51 AM
@BartekBanachewicz Both are part of IntelliSense.
 
(Of course it's made up, but long names are common).
 
@BartekBanachewicz try using more sensible names ?
 
@BartekBanachewicz If you have names like this, you have a bigger problem.
 
Are you both trying to convince me that 100-file project can have class names such as X and Object? -.-
 
yes
it's called namespaces
 
10:53 AM
@KillianDS You still do have to type the namespace name. I quite don't see the gain there.
 
that can be solved by using
 
You don't have to type the namespace name inside the namespace.
 
Most of the code lives in the namespace, so no, you don't type namespaces most of the time.
 
or indeed, within a namespace you don't even have to do anything
or you can alias a namespace to a shorthand if you dislike using
 
And if you have a lot of inter-namespace interaction, then you might have too tight coupling and your codebase sucks.
 
10:55 AM
If you have so many dependencies that long names are your best option...
 
You can't use using in header files.
 
@CatPlusPlus Meh, any implementation file will likely use some external namespaces, even if it's just std. But that shouldn't be a problem
 
@R.MartinhoFernandes Oh F*ck.
 
@CatPlusPlus I love it for vim as well. Backgrounding is much more usable and it feels snappier than GUI vim. I do use GUI vim to, but only when I enable balloon tips or stuff like that.
 
I still don't think you can avoid long names. And I don't think you should, at any point. Shortening the names "just so they are easier to type" is something that I wouldn't do. Ever. Long names are more descriptive and you don't have to jump a lot through code when reading.
 
10:58 AM
@BartekBanachewicz Like I said, use an alias, it has block scope anyway. you could perfectly do namespace sln=base_namespace::some_long_namespace;
 
"Long names are more descriptive" is not true.
Picking your example above, these long names OnHitEventAllocatorCallback::DefaultEventAllocatorCallbackProcessor actually hurt readability.
 
@R.MartinhoFernandes Havok uses very similar (and long) names. And the library's API is by far the most elegant and intuitive to use I've ever seen. You don't have to jump to documentation every time. After you learn what basic blocks mean (like Event, Allocator etc) the combinations just make sense.
 
even If I don't have any constructors written in Child Class would it shadows ALL constructor overloads of Parent Class ?
 
But if I used it without IDE, it would be really pain in the editor (pun intended).
 
@BartekBanachewicz Guess what, it wouldn't.
Because despite what you may think not all text editors are glorified notepads.
 
11:04 AM
@R.MartinhoFernandes I mean, without the code completion, because they don't offer it. You have to jump to documentation. Intellisense brings the documentation right where you need it.
 
@BartekBanachewicz What text editors are these "they"?
 
@R.MartinhoFernandes vim and emacs.
 
You are wrong, then.
 
Vim's code completion is a total joke.
+ I don't reckon they were able to parse any library headers and provide them to you as code completion
 
@BartekBanachewicz wasn't there a plugin that uses clang? I don't think you can have better autocompletion then what the compiler tells you it may be.
 
11:08 AM
@BartekBanachewicz Why wouldn't they?
That's just the natural thing to do.
 
@KillianDS There's such plugin indeed. I am looking for screenshots right now
 
There's more than one such plugin btw. E.g. one also builds a database to speed up lookups.
 
All these plugins share some traits, though. They're all experimental, they all only tend to work.
That's the problem with OpenSource
 
Lol, you really think closed source is any better?
 
Your problem is the assumption that IntelliSense doesn't also tend to work. You see people complaining that it just stopped popping up all the time.
 
11:13 AM
that's the problem with IT in general
 
IntelliSense works fine in managed languages (and in managed languages you have still superior alternatives).
 
people tend to only test what's used, and if you use it a bit different, it might not work. That has nothing to do with open or closed source. It has to do with software development.
 
Which still leaves me with no reasonable option to code right now. Since nobody really showed me anything that could replace MSVS. (what I've tried : emacs, vim, NetBeans, Eclipse, C::B, QtCreator)
 
Jun 1 '11 at 16:52, by Xaade
@Xeo maybe another reason IntelliSense crashed.... IntelliSense BEING IntelliSense.
Aug 9 at 13:21, by melak47
although I think the template broke intellisense :p
I could go on.
 
@BartekBanachewicz How often have people spontaneously come up to you to recommend a tool?
 
11:18 AM
@BartekBanachewicz Well, my point is that there's nothing particularly great about VS to make it definitely the best one.
 
@LucDanton I ask for alternatives quite often; I am not happy with MSVS either, but I don't have asssets right now to create my own IDE.
 
Conclusion: pointless discussion where @Bartek says VS is the best, everybody disagrees, and nobody wins, only loses [the time spent discussing].
 
All things considered, it seems like a pretty average IDE.
 
Can we now move on to something interesting?
You can use auto in an iterator range-based for right?
 
@rubenvb yes.
 
11:20 AM
yes
 
should I use auto or auto&?
 
Same rules as always.
 
@sehe I prefer true colours and proper fonts and tabs and everything.
 
@rubenvb if you would use for (type x...), use auto. If you would use wtf_pointer<type>, you can use auto const& or auto&
 
@rubenvb If you want value, auto, if you want reference, auto&. Duh.
 
Xeo
11:23 AM
Btw, I recently noticed that technically std::vector<auto> = init; would be allowed, if it wasn't for the grammar saying that auto is only allowed to appear in a decl-specifier-seq outside of function return types or new expressions :(
 
@rubenvb auto&& should be the default. auto means 'I want to hold my own' and auto& means 'I only want to hold a reference'.
 
Xeo
That's "to-be-written-proposal" #3 now. Ugh.
 
@Xeo Well that's by design.
 
Xeo
And all got something to do with auto
 
OK ok. for(auto it = std::begin(somecontainer); it != std::end(somecontainer); ++it) becomes for(auto it : somecontainer), but then it becomes a decltype(*it) from the first version right?
 
Xeo
11:24 AM
@rubenvb Do you want a copy or a reference of the values?
That's the question you need to answer
 
@rubenvb Not in the general case.
 
@rubenvb std::begin gets you iterator. Value of iterator is a reference to value
 
@rubenvb In this case it won't be the same as the iterator version does not copy the value.
 
Hmm, range-based for has no way of checking if there is another element beyond the current one, does it?
you can't do if(++it != std::end(container)) blabla();.
or equivalent.
 
@rubenvb you can do it with while :P
 
11:27 AM
Not the right tool for that, no.
 
Xeo
if(cont.find(value) != cont.end()) :D
(for trees)
 
Then I'll refrain from range-based for for now.
I just moved to std::begin and std::end.
 
Xeo
no wait, nvm
 
good enough c++11 for me.
 
Still, remember to use auto&& as a default.
 
11:28 AM
@rubenvb Doesn't it indicate some error in design?
 
@BartekBanachewicz the current case I have right now is commandline argument parsing: I need to check if an option is followed by another to verify correctness.
I don't see how an error in design is indicated by having to check the next element of a range, and perhaps do ++it manually.
though I'm not saying my design is flawless.
 
@rubenvb You could be using boost program options :p?
 
@KillianDS I know it's stupid and I've been told before, but I don't want to use Boost nor anything else. Just plain ol' C++11 and some OS API calls is all I've needed until now. My defense: it's an self-learning project.
And the code I've written works quite well for my purposes too.
 
@rubenvb It indicates a lack of decent looping (i.e. the language/library's fault, not yours).
afk, lunch.
 
@rubenvb Self-learning is about the best reason to reinvent wheels :).
 
11:35 AM
Boost.Range has adjacent_filtered but no 'adjacent view' or the like.
 
@KillianDS hehe. That's what I figured.
 
@KillianDS wheels like this? en.wikipedia.org/wiki/…
 
I suppose some slicing and zipping can work.
 
Yay: finally getting some command generation done for Ambrosia.
 
11:54 AM
are string literals like "abcdef" in C++ null terminated?
 
@galymzhan yes.
they are of type const char[N+1] where N is the number of characters you see.
 
Gosh, Debian guys made it really hard to install new gcc -.-
 
@rubenvb thanks mate
 
@BartekBanachewicz just use sid...
 
@rubenvb I just wonder why don't they update the packets in squeeze.
 
11:57 AM
@BartekBanachewicz squeeze == stable. Duh. There's no packages to update. There's only new packages, which aren't candidates for stable.
 
@rubenvb I don't see the unstability of 4.7, actually
 
hi
 
@BartekBanachewicz Then you clearly don't understand what "Debian stable" means.
 
@BartekBanachewicz it's a new version, not just a security update or something similar, so they'd need to run all regression on it to qualify. That would be a good indication not to put that upgrade into your stable branch.
 
I was wondering : do you guys think it is possible to come up with a set of #define that would allow me to write valid C++ code that looks like PHP ?
 
12:01 PM
@ereOn How dare you say PHP here!
@KillianDS Ok, a bit more sense.
 
@BartekBanachewicz: I dare ! I sure dare !
 
@ereOn "And no PHP or Java questions, no matter what. "
 
@BartekBanachewicz: It's actually a valid C++ question ;)
@BartekBanachewicz: We do have a "prostitute the language" code contest at work.
 
Xeo
@ereOn No, $ is not necessarily part of the basic character set
 
I'm rather sure I would win with that.
 
12:04 PM
@ereOn Look at IOCCC
 
sbi
I like that one.
 
@Xeo: Do you mean it's not possible to write a #define including $ ?
 
Xeo
It's not possible to write anything that includes $ in its identifier :)
 
If it was JavaScript then you could use #define var auto to emulate var a = 2; But PHP has syntax $a = 2; which is much tougher to emulate.
 
Xeo
Of course, foregoing portability, you might find that one compiler or the other does support it
@StackedCrooked using var = auto would be neat :)
 
12:09 PM
That wouldn't work though, would it?
 
Xeo
Yeah
 
@Xeo: Damn. That ruins all my hopes.
 
Or class var {}; // dirty class with with many constructors, assignment and conversion operators
 
@StackedCrooked boost::any?
 
Xeo
@BartekBanachewicz needs explicit conversion
and doesn't have any kind of interface, really
 
12:12 PM
he's after syntax, not semantics. Well, one probably follows the other, but still.
 
It would just have to look like PHP
and do something (whatever)
 
Good luck with that :)
 
Yeah, well : I feel like I'm gonna give up.
 
if I have for each file_type a source file and an object file to be filled in later, and uniqueness is only determined by the source file's filename, I should use a std::set with a custom comparator right comparing the filename, correct?
 
say
when is a static member variable initialized?
is it different from c++03 and c++11?
 
12:25 PM
Before main.
Except function-local.
 
@Papergay See 9.4.2 Static data members: "Static data members are initialized and destroyed exactly like non-local variables (3.6.2, 3.6.3)".
 
What happens when I value-intialize an enum X { FIRST = 1 };?
 
@LuchianGrigore You get static_cast<X>(0).
 
Is it legal?
 
Yes.
 
12:33 PM
Damn
Is the static_cast legal?
 
Yes.
 
daaaaaamn
:D
 
even with enum class the static_cast is legal I think.
 
Yes. For the same reasons that you don't need to take too many precautions when using an enumeration for a flag type.
enum [class] flag { none = 0, foo = 1, bar = 2, baz = 4 }; and you're good to go.
No need to mess with foo | bar or any other such combination.
(Although if it is a scoped enumeration you don't have operator| for free.)
 
12:36 PM
@LucDanton huh, what do you mean by that exactly?
 
@rubenvb The rules that make that work are the same rules that make static_cast<some_enumeration_type>(0) always valid.
 
@BartekBanachewicz Actually, it isn't. It is word completion, not intellisense. Allthough you can have intellisense to: It's called Omni Completion and you can have it based on libclang too for great justice
'Magic' goat arrested for armed robbery <-- to stupid to be be true?
 
@LucDanton I don't understand what you mean by No need to mess with foo | bar or any other such combination.
 
@zeta but there has to have been made a change from c++03 and c++11
since my current order is not working in c++11
 
@Papergay static initialization order is a fiasco, hence the concept and the evility of statics and globals. Implementation defined, thus, subject to change with the moon cycle.
 
12:40 PM
@rubenvb Mmmh, let me check promotion rules.
 
Promotion is not welcome in chat
 
@LucDanton The reason I ask is because I'm using a plain enum : uint32_t as bitflag thing and I need an explicit cast on assignment after bitwise ORing some enum values.
 
bitfla some serious UNICODE fuck up there
 
Clang diagnostics are still awesome.
 
@rubenvb Okay, after some checking then the crux of my point is that X x = foo | bar; is defined (operator| notwithstanding).
 
12:43 PM
@LucDanton weird, cause as I said, I needed to cast that explicitely.
 
duh. It says g++-4.7 and all that stuff is installed. However, i have no binaries -.-
way to go, Debian.
 
@rubenvb Ya, that should be X x = static_cast<X>(foo | bar);.
 
@LucDanton is there any way to rid myself of such a cast?
 
@rubenvb Introduce your own operator|. You may even consider making your enumeration scoped after that.
 
12:46 PM
but still, this is stupid
 
If you find yourself introducing such types often then you can do some refactoring thanks to ADL.
 
@LucDanton ah yes. I might just do that.
 
What I dont get is why the order of my static allocation worked for c++03 and does not work in c++11
 
@Papergay no, it worked for that specific collection of source files using that specific linker and that specific compiler on that specific OS. I've been bitten by the Static Initialization Order Fiasco a couple of times. After the last time, I refactored all the order-dependent variables into local variables. No fuss, no mess.
 
12:48 PM
so its the compilers fault then :@
since that is the only think that I updated
So gross
 
It's a neat solution but only so-so in terms of code reuse since the operators have to be in the same namespace as the enumerations for ADL to kick in. Can't use the same tricks as for classes (template arguments, bases). Either that or using directives.
 
@Papergay no, it's not. It's yours. Only yours. For relying on undefined behavior.
 
Ah, actually the robot simply put the operators inside the global namespace.
 
fuck me: error: 'ambrosia::lib::target' has a field 'ambrosia::lib::target::m_source_files' whose type uses the anonymous namespace
it's a template type using a lambda for its comparator.
 
[gcc] What symlinks do I need to run g++ from cmdline? My installation of 4.7 somewhat fcked up, and I have these all, but named as g++-4.7, gcc-4.7 etc.
 
12:52 PM
Is GCC correct here (it's a warning but I use -Werror)
@BartekBanachewicz that's not fucked up, that's a Linux multi-version GCC install.
 
@rubenvb So is there any way to create these for me or do I have to do it myself? I'd prefer to write just "g++"
 
@BartekBanachewicz I think update-alternatives has something to do with it. Otherwise you can always create Bash aliases.
 
@rubenvb its not my fault that it is undefined xD
 
@rubenvb I'm sort of non-plussed. Is that C++03?
 
and I always thought it would have been defined - why is it not xD???
 
12:55 PM
@LucDanton nope. GCC 4.7.1 -std=c++0x. I'll see if using a struct with operator< works or not.
@Papergay C++ sucks. Tell me something new.
 
@rubenvb Error definitively doesn't ring a bell. If you have a repro I'm interested.
 
@Papergay because it would require significant build system and toolchain support for something that is generally looked down upon. Not to mention all the issues with static vs dynamic linking.
@LucDanton let me git push first :)
 
I know this isn't the right chat, but it's the only active one... Can you overload a stored procedure with SQL Server 2008? Or are unique SP names enforced?
 
Aug 12 at 10:41, by Cat Plus Plus
If you are new here, read the code of conduct now. Thank you.
 

« first day (674 days earlier)      last day (4289 days later) »