« first day (697 days earlier)      last day (4237 days later) » 

sbi
9:02 AM
@Neil Free functions are another tool in your toolbox, meant to be used when they fit the job better than member functions. The core of the STL's algorithms is free function( template)s, and it's an amazing design. Do you want to forfeit that, just because, for some irrational reasons, you happen to dislike free functions?
 
@LuchianGrigore which is significant because...
 
sbi
@Neil I have always said that overloading operators is overrated, and should be done far less than it is usually done — but abandoning it altogether seems, erm, inadvisable.
 
@sbi I never said I wouldn't use them.
 
Sigh, figures I'd get in an argument just because I said the classless ways of C bother me
 
9:04 AM
@sehe my bad, I meant to say 2500
 
@sbi And so? Does that imply I don't use the standard library?
 
@LuchianGrigore Programmers.
 
sbi
@Neil I was talking about the STL, not the whole of the std lib.
 
@sehe which is 7 more than you...
heh
 
@LuchianGrigore Meh. Thanks for warning.
 
9:06 AM
@sbi templates are excusable. I meant loose wild rampant methods
 
C++11 also introduced std::to_string overloads. You should sure be able to grasp the usefulness of that.
 
I predict you will end up at more than double my answers :) You're still running around. Whereas, I'm not :)
 
sbi
@Neil Really, this feels like you have some very wacky ideas in your head. What are function templates, but, um, templates from which functions are created? And if those templates aren't members, then neither are the functions created from them.
 
Also: Choosing between instance methods and free functions? I asked this a few years ago on SO.
 
Is there an explorer badge?
 
sbi
9:11 AM
A class is the blueprint for objects which encapsulate state ("data") and means to modify that state ("methods"). If you need an object that has a state which can be manipulated through methods, then what you need is a class. If you have some algorithm which is passed some data and/or which returns some data, without the need to keep state between invocations, and without the need to share state with other algorithms, then you need a free function.
 
@sbi You're not going to be able to convince me by giving me scenarios in which I would use classless methods
In the end, I perhaps made a mistake being too general, but that doesn't change anything in the end. I still feel it's important not to make global methods
Though not sure at this point if you're being pendant or if you genuinely think I meant that I don't use templates because you've demonstrated that that could be considered in some sense, global methods
In the case of the latter, let me assure you I do use templates, and this argument is turning boring
 
1
Q: simplifying nested for loop in C

chyanogI will obtain Narcissus Number in 3 to 9 digits, but use nested loop is so complexed ,it seemed can be written by recursion method. Here is my code: #include "stdafx.h" #include <time.h> int power(int a,int b) { int t=1,i; for (i=0;i<b;i++) t*=a; return t; } int _t...

 
@Neil I still feel it's important not to make global methods. Where did you even get that idea? Did you read that somewhere?
 
@StackedCrooked Now you're trolling. If you wanted to clutter up global space with methods, you might as well just program in PHP.
When possible, you attach context to methods. Rather than have method "doAction(MyObject obj, string param)", you have "MyObject::doAction(string param)"
 
Anyone here, who know how to build Qt with MySQL support on Windows?
 
9:25 AM
@basic6 try www.stackoverflow.com
 
@Neil I'm not promoting pollution of the global namespace. Maybe I misunderstood but it seemed that you were opposed to free functions in general regardless of whether they are put in namespaces.
 
@sehe Yeah this ain't helping. I've obviously googled for many hours.
 
@basic6 Obviously
 
Have you ever built Qt on Windows?
 
sbi
9:28 AM
@Neil I meant that it simply doesn't matter whether we're talking function templates or functions. Both can be members or free.
 
I once did. It was not worth the effort.
 
Genius. A QR code on a TfL poster. A TfL poster telling you to keep valuable items like smartphones hidden. http://t.co/r5YDNC0t
 
@StackedCrooked Yes, I am. That's the general sentiment behind OOP, though isn't it? I didn't say you wouldn't ever have to have free methods, since sometimes it's necessary. Though "necessary" and "desired" are not synonyms.
 
@StackedCrooked And did you build the MySQL driver into the whole thing too?
 
Don't think so.
 
sbi
9:30 AM
@Neil No, you are trolling. This is utter nonsense. C++ has had free functions from day one (because it built on a language that had nothing else), and free functions certainly are nothing that should be avoided. In fact, they are all across the std lib — and I am not talking of the C part of the std lib. If that doesn't convince you, I don't know what would.
 
I'd probably use Poco::Data for connecting to a database. No need to have it included in Qt.
 
sbi
19 mins ago, by sbi
A class is the blueprint for objects which encapsulate state ("data") and means to modify that state ("methods"). If you need an object that has a state which can be manipulated through methods, then what you need is a class. If you have some algorithm which is passed some data and/or which returns some data, without the need to keep state between invocations, and without the need to share state with other algorithms, then you need a free function.
 
@sbi I'm saying C++ has classes. Fucking use them.
 
Non-sequitur?
C++ has X. Fucking use X.
 
@Neil Free functions don't contradict OO. Nor classes
 
sbi
9:32 AM
@Neil It also has exceptions. Should we now abandon return?
 
Free functions with ADL is OO done right, in a sense. No need for extension method contraptions, if you will
 
sbi
If you want namespaces, use namespaces. Do not abuse classes for that. Putting everything into classes is a necessary nuisance in languages that do not have free functions. C++ doesn't have that restriction, so you should use whatever tool fits the job.
 
@sbi And other control flow structs, because you can easily throw a stateful function object that acts as the current continuation. This enables all kinds of flow control :)
 
@sehe Wow.
 
PHP “programmers” use classes instead of namespaces because :: looks better than \ (fuck you, Markdown) in their opinions.
 
sbi
9:36 AM
@Neil, here's a classic that shows how free functions improve encapsulation over member functions. That article is now 12 years old, and some experienced C++ programmers were saying "yeah, so what?" when it was published. You really, really, really need to catch up with that stuff.
6
 
@StackedCrooked We need a library that totally abuses this. And then reimplement it based on Boost Context to support embedded systems that don't have exception support. Oh well
@sbi Luckily the standard library people have seen the light. As have many libraries, like boost.
 
sbi
Wow. Stars! If @Neil continues to argue against common sense, I'll be all over the starboard by lunchtime.
 
The stars are actually for the linked article, I guess
 
sbi
@sehe When I wrote that, that message had only one star. I have, however, four messages on the starboard.
 
@sbi It was mine. But it was quickly followed by a second star, on my end
@sbi That's because you were making sense before. Had you posted the link first, that would have settled it :) I suppose the rest of the stars were just to lend support
 
sbi
9:46 AM
@sehe Ah, but this seems so obvious to me, I didn't even think of getting authoritative support.
@ScottW It doesn't help, though, that everyone agrees while @Neil has left the room in frustration, going back to employing C++ for writing Java.
 
@sbi Yeah. I agree
It still is on the starboard
That's worth something
 
Aaahhhhrgg merge conflict ;_;
Nah. :p
It’s time for bacon.
 
what are you guys fighting about now?
 
Merge conflicts in the stomach of yo momma.
 
@daknøk Should you ever want to base your meme on something less blurry^
 
9:58 AM
@sehe those things are so awesome.
 
sbi
@TonyTheLion Free vs. member functions.
 
Free the member functions!
 
@sbi yes, reading back a bit in the transcript, that seems to be it.
FREE ALL THE MEMBER FUNCTIONS!
@sehe hi jalf
 
class Pointer {
public:
    void free(); // free function
private:
    void* p;
};
 
@daknøk I'll just post a svg: downloads.sehe.nl/stackoverflow/jalf-simple.svg /cc @jalf
 
10:01 AM
class Foo{ friend void foo() {} };
does this count as a free function?
 
Yes.
 
@sehe looks more like a penguin with down syndrome.
@LuchianGrigore it is a free function.
 
@daknøk hey, ask the artist, not me
 
I know :|
 
It is a free function :)
 
10:04 AM
malloc is a free function!
 
If a member is private, can you access it from a different instance?
At first I thought yes
 
auto* foo = (std::function<void()>*)malloc(sizeof(std::function<void()>));
free(foo); // free function
 
Then I thought no
and now, again, I think that yes
What's the obvious thing that eludes me?
 
@LuchianGrigore Yes.
 
anyone already had a question ban ? I reviewed all of my questions and answer but can't figure out LOL
if I had at least one down voted question or answer that would be much easier to deal with
 
10:09 AM
Ask there.
 
@daknøk oh thanks, according to FAQ page it was supposed to be banned on meta too, seems like it works
but is it tolerated there if it doesn't imply programmation stuff ?
like "what i've done to get banned"
 
Meta is for questions about Stack Overflow. Not about programming.
 
ok
 
@Fred And please be a little more descriptive. Tell that you have tried to find out why you got banned etc.
And write I with a capital letter; it shows more effort.
 
@daknøk Thanks for the hint, I just got really confused about this ban since I help other people here the best I can, when I see junk questions and answers, I find it unfair :)
 
10:15 AM
where is the best place to talk about the design of my app and get suggestions ?
I am having troubles with how C++ and particularly MSVC builds my files
 
@jokoon a wild guess would be Stack Overflow or Code Review.
Oh wait. Nevermind.
I thought you were talking about architecture.
 
I am
 
Then I guess Code Review, but I’d check its FAQ first before asking the question.
Code Review - Stack Exchange is for sharing code from projects you are working on for peer review. If you are looking for feedback on a specific working piece of code from your project in the following areas…

 - Best practices and design pattern usage
 - Security issues
 - Performance
 - Correctness in unanticipated cases
But I think architecture questions are also accepted.
 
lol @ tagline
room topic changed to Lounge<C++>: I don't usually write funny things, but when I do, it's in this tagline. [c++] [c++11] [c++-faq]
 
sbi
@Fred I suppose the offending questions got deleted. I am pretty sure you would have received warnings like comments explaining what's wrong with your questions, and questions getting closed for specific reasons.
@TonyTheLion Unfortunately, that doesn't necessarily mean you are funny when you write in the tagline.
room topic changed to Lounge<C++>: C++ is the ugliest language after French and PHP. [c++] [c++11] [c++-faq]
 
10:33 AM
@sbi In fact, I've asked only 2 questions on stackoverflow, and answered approximately 50 questions, which (I reviewed them) got 0, 1 or 2 upvotes and no down votes
 
sbi
@Fred Well ==> meta.
 
You know.
Sir Jonathan Paul "Jony" Ive, KBE (born February 1967) is a British designer and the senior vice president of industrial design at Apple Inc. He is the lead designer and conceptual mind behind many of Apple's products, including the MacBook Pro, iMac, MacBook Air, iPod, iPod touch, iPhone, and iPad. Early life Jonathan Ive was born in Chingford, London. Ive said about his father, a silversmith who taught at the local college, "He's a fantastic craftsman, his Christmas gift to me would be one day of his time in his college workshop, during the Christmas break when no one else was there...
> Sir Jonathan Paul "Jony" Ive
Sounds so stupid. Sir Jonathan Ive.
Because you know, knightening random designers.
 
Initial attempt at game. Mute the sound though.
 
@daknøk thanks for the help, I'm reading the faq
 
@sbi yea well since funny is really a subjective thing, you're right.
enough failed attempts at being funny, what's everyone up to?
 
10:40 AM
@TonyTheLion writing a chat server in Haskell.
 
oh fun fun
 
Haskell is so beautiful.
 
sbi
1 message moved to Haskell
 
lolz
 
ohhh you have the ape filtering your messages
that was quick
maybe he has a ping every time someone says "Haskell"
 
10:42 AM
@sbi ██████ship!
 
sbi
@TonyTheLion Nope.
 
I guess @daknøk was unlucky then for you to notice :P
 
I notice everything.
 
wasn't talking to you, but about you
 
So?
 
10:44 AM
your response was not appropriate :P
your argument is invalid
 
sbi
@daknøk You didn't notice that.
 
It was not a response.
 
this is bad, and you should feel bad
 
@sbi I even got an invitation to the Haskell room from you…
I never feel bad.
 
sbi
@daknøk Then you didn't notice that a response would have been appropriated and was expected.
 
10:44 AM
If you are going to regret something, why did you do it in the first place?
 
lol
The Cat is lurking. I can see it on his Gravatar :P
lurker :P
 
sbi
@daknøk You are but a child.
 
@sbi I am a child, but I don’t regret being one.
 
lol
I have the distinct feeling creeping up on me that this discussion is so trivial as to be entirely pointless
 
sbi
10:47 AM
@daknøk Nor should you regret it. But you shouldn't try to sound your trumpet about what you've learned in your life. Because it's little.
 
pwnd!
 
@TonyTheLion Discussions are always pointless. You cannot convince me of anything anyway.
 
@daknøk then why are you even in this room?
 
Focus people focus! Watch the crappy video.
 
@Blank why would I watch it twice?
 
10:48 AM
@Blank what crappy video?
 
@daknøk Then don't!
 
@TonyTheLion the one with the crap.
 
Your lack of avatar is very disturbing.
2
 
lol
 
Wait, let me fix it
 
10:49 AM
@CatPlusPlus I agree wholeheartedly
 
@Blank Make it pink.
I want a pickle milkshake.
 
are namespaces resolved at compiled time or link time ?
 
@sehe that is a big penguin
 
@jokoon Compile time, but they usually introduce extra name mangling.
 
can I predeclare a namespace ?
 
10:53 AM
why would you want to do that
 
You mean namespace foo;?
 
is there a way to introduce an implicit conversion between two types, whose sources I can't touch?
 
I don’t know.
@artm 1) maybe. 2) don’t.
 
@artm derive from class and add operator overload?
 
10:54 AM
@jokoon those are just empty namespaces.
 
@TonyTheLion I try to use namespaces instead of classes and objects
 
@TonyTheLion that might work... I'll give it a try, thanks
 
@jokoon why?
 
@daknøk I can put stuff in it after that
 
@jokoon Yes.
 
10:56 AM
namespaces server a specific use, and classes do. Why try to replace one with the other?
 
@TonyTheLion because backslashes are fugly. PHP :P
 
@CatPlusPlus Refreshing should fix it. BTW it was not lacking ;) /cc everyone
 
@TonyTheLion I don't want to use OOP because of getter/setter, so instead I make everything global in namespaces
 
@TonyTheLion hmm, no that probably won't work because implicit conversions only work directly, the child class will introduce an extra step
 
@daknøk I'm not sure I get that?
@artm right, then no it won't work
 
10:57 AM
@jokoon OH NO I USE ANTIPATTERN AND BECAUSE SOME PEOPLE SAY ITS ALWAYS WRONG EVERYWHERE I SHOULD ABUSE THE LANGUAGE OH NO WHAT TO DO
Just use getters and setters when they are needed.
@TonyTheLion PHP uses backslashes for namespaces, which is fugly, so people use classes and ::. :P
 
Use the right level of abstraction
@daknøk ah
 
I hate abstraction. btw why is this an anti pattern ?
 
cause awful
it breaks encapsulation
 
Do I know. Many people say getters and setters are always wrong.
I don’t care about patterns.
 
you create private members and then allow access to them through getxxx setxxx
what?
 
10:58 AM
it's too much boiler plate code
 
@daknøk Getters and setters are not a pattern on their own.
 
I want to have less code
 
either make the member variables public in the first place or find the right level of abstraction for your class
 
@jokoon then make them public or whatever.
 
I tried using struct instead, it was messy
 
10:59 AM
If you need extra logic to modify them, use getters and setters.
 
when initializing my app, I had trouble with PCH
 
@daknøk encapsulate that logic in a member function and modify the private members in that function.
no need for get/set
 
some structs could not see others
 
@TonyTheLion so
class Button {
public:
    void setTitle(std::string newtitle) {
        title = std::move(newtitle);
        this->redraw();
    }
private:
    std::string title;
};
^ OH NO A SETTER EVERYTHING IS BAD AND WRONG
 
void AddCaption(std::string newtitle)
 
11:02 AM
@daknøk each time you add a variable you need to write those, I'm not wasting my time on this
 
@jokoon not if those variables don’t need any logic before or after they get changed.
struct Person {
    std::string name;
    unsigned age;
}; // perfectly fine
@TonyTheLion ambiguous. What if the button already has a caption? What does “Add” mean in that case?
 
@daknøk it overwrites it
 
well I'm making a game and I don't see any problem
 
@TonyTheLion “Add” doesn’t mean overwrite existing.
Add means add to existing, so you now have two captions.
 
my point is, name it something sensible, not setXXXXX
 
11:04 AM
global variables are such a taboo
 
@TonyTheLion That's what it does, though
 
it's fugly
 
Global variables are sometimes needed.
 
@jokoon Hint: that's not OOP.
 
I rather have fugly code than confusing code.
 
11:04 AM
@TonyTheLion Then call it fargleTitle(std::string newFargleTitle)
 
changeTitle lolz
 
If your objects are full of passive data, then your code sucks.
 
I don't want oop. c++ is not made for oop
 
@daknøk That implies there is already a title, but if it has never been assigned, that's technically incorrect
 
@Neil hehe :P
 
11:06 AM
anyway, lunch kbai
 
struct is mostly equal to class btw
 
@Neil enforce it through the ctor xD
 
struct has everything public by default
 
I use struct for just data things like in C, class for classes.
 
thanks for the reminder
 
11:07 AM
@CatPlusPlus what do you mean by passive data?
 
private by default is just a compile time check, it just enforce OOP design
by the way, in a game, you don't have passive data
 
@jokoon it's purpose is to make clear to humans how things should be used.
 
I don't see why a language should advise programmers to code in a certain way
I'm free to do whatever I want, there is no "should be used"
 
> We know about what is oops. It is an object oriented programming structure which help to understand programming logics and method which use many programming language like C++, C# and java. It is give a platform to make an application or software which inspire as a real world. It have various features and advantages which help to write a program with some logical steps.
 
user784668
11:09 AM
@jokoon Because you don't want to write C in Haskell. You're free to, but it sucks.
 
OMG HSAKELL!!1
 
@Fanael can you explain ?
I don't understand what you're saying
 
He’s saying Haskell is great and C sucks.
To which I agree.
 
user784668
@daknøk And that writing C in Haskell sucks, because it means you're in IO every-fucking-where.
 
arguing with "great" and "sucks"
 
11:13 AM
@Fanael hehe :p
 
what does "writing C in haskell" means ?
 
@jokoon it means using IO everywhere even in functions that don’t need it. :P
 
user784668
@daknøk And ODing on malloc and pointers in general. IORefs included.
 
lolz
 
well you just do it once and you're fine
 
11:16 AM
main :: IO ()
main = do
    ape <- readLn
    putStrLn $ ape ++ " is going to move this to the Haskell room."
 
@jalf but less blurry than an inflatable you :)
 
$ echo sbi | ./ape
 
88
A: What can I do when getting "Sorry, we are no longer accepting questions/answers from this account"?

ArjanWhy am I getting this message? As stated clearly in the about links on every page, the Stack Exchange web sites are question and answer sites, not help forums. This implies that all posts are expected to have some value for later visitors too. To enforce that, and to prevent help vampires making...

 
@sehe thanks, but I have read the FAQ section and tried to figure out the reason according to it, I started this thread : meta.stackoverflow.com/questions/146757/…
@sehe I wrote to the support team to get more information
 
@Fred Ok, I hope that resolves your awkward situation... Best of luck!
 
11:26 AM
@sehe Thank you! I sincerly think that it was a mistake, an IP glitch or something, I think I'm doing my best to help people here
 
user784668
@Fred That's what you're banned for. You shouldn't try helping people.
 
@Fanael Troll :)
 
@Fanael hehe, I will jump into questions and answer them with a rick roll or something, maybe they will unban me :)
 
@Fred yeah. Likely here. Unless, you happened to have used a different account in the past - you know,... before you became helpful :)
 
@sehe, it's my only account, plugged in with my facebook account :)
@sehe I'm actually on my own business since a year, so questions here are a good way for me to validate if I am "up-to-date" with actual technologies
 
11:34 AM
woof
 
talk
 
user784668
@DeadMG foow
 
I am so proud of my code.
 
You shouldn't be.
 
six months from now you'll appreciate how terrible it is
 
11:48 AM
Six months from now it will probably not even exist anymore. :P
 
Self-destructing virus code?
 
$ rm ./server/src/Postduif/Message.hs
 
gotta love magic constants...
while (3230)
 
My infinite loop is faster!
 
user784668
while("elvis is alive")
 
11:56 AM
while(__TIME__[6] - '0')
 
is it me or is the font in VS2010 horrible?
 
it's you
 

« first day (697 days earlier)      last day (4237 days later) »