« first day (740 days earlier)      last day (4206 days later) » 

6:02 PM
This guy read the GOF and now he's running wild with patterns.
 
> Is it a serious suggestion to use kind of a proxy manager?
 
@R.MartinhoFernandes Yep. Wild, I tell ya.
 
FWIW, PHP programmer.
 
Looks more like Java.
But, yeah.
 
@WTP'-- Wots wrong with giant inheritance trees? How else would you build a GUI system?
 
user142019
6:05 PM
@MartinJames Everything. Want to change a non-leaf class? Well, you’re fucked.
 
Na je nun ta sa ro un in gan jo gin yo ja
Ko pi han ja ne yo yu rul a neun pum gyo gi nun yo ja
Ba mi o myon shim ja ngi tu go wo ji nun yo ja
Gu ron ban jon i nun yo ja
 
user142019
@MartinJames You don’t need OOP for a GUI?
 
user142019
And if you do, something like this is good enough:
 
@MartinJames In a word, "intelligently".
 
user142019
6:06 PM
class Control;
class Button : public Control;
class DropDown : public Control;
class TextField : public Control;
 
Hehe, I knew that preemptive "lol" would come in handy.
 
user142019
No need for subsubclasses and subsubsubclasses.
 
@R.MartinhoFernandes Robotic Prescience to the rescue again!
 
@WTP'-- All those components can take focus. What about the ones that cannot?
 
user142019
@MartinJames virtual bool CanTakeFocus() = 0; in Control? Why would you need a separate class for that? WTF?
 
6:08 PM
class entity;
class window : public entity;
class control : public window;
// ...
 
user142019
@JerryCoffin What? Control inherits from Window??
 
user142019
WTF are you guys smoking?
 
struct thingy;
struct entity : thingy;
struct thingamadingdong : thingy;
 
@WTP'-- Do you know of a GUI system where a control isn't actually a window?
 
user142019
class Window;
class Control;
class Button : public Control;
 
user142019
6:10 PM
@JerryCoffin Cocoa.
 
@WTP'-- Are you sure? I know Cocoa's a mess, but I was pretty sure it wasn't that bad.
 
user142019
NSWindow : NSResponder and NSControl : NSView.
 
user142019
@JerryCoffin Bad? How is a control a window? You know what a window is?
 
@JerryCoffin You probably shouldn't have said that. He's going to unleash a giant pile of teen rage on you.
 
What about components that can contain other components? You gonna give all components a container?
 
user142019
6:11 PM
A window is a thing with a titlebar that you can drag around, you know.
 
user142019
A control doesn’t have those properties.
 
@WTP'-- That's a form, (usually).
 
user142019
@MartinJames A form is a bunch of controls that you can fill in. ಠ_ಠ
 
@WTP'-- ..then how you gonna drag it?
 
@pstrjds. I can't put that in the base class since the structure of a storage is completely free and only specified by specific components. But only a few components will share data. So the base class must stay empty. But I figured out that something like static_cast<Derived*>(BasePointer) would work for me. — sharethis 2 mins ago
ohnoes
 
6:12 PM
@WTP'-- Where in the world did you get the idea that a window necessarily has a title bar?
 
user142019
@MartinJames Why would controls be draggable?
 
@WTP'-- Becasue you can drag the form on which they are parented.
 
@R.MartinhoFernandes Probably a good thing -- my oldest son will be a teenager soon, so getting used to piles of teen rage will be good training.
 
user142019
Having Control inherit from Window is like having Fruit inherit from Banana.
 
Window -> is.gd/M2mXTD
 
user142019
6:14 PM
@MartinJames I think your definition of “form” is “synonym for window”.
 
@WTP'-- do you know how sublime looks for makefiles?
 
user142019
@bamboon no, I never use Sublime.
 
@JerryCoffin Kids these days.
 
@bamboon Doesn't it just run make? I can't imagine it does makefile parsing itself
 
@WTP'-- Are you saying that a window is a control?
 
user142019
6:15 PM
@R.MartinhoFernandes no, but that at least makes more sense than saying a control is a window.
 
@WTP'-- are you joking?
 
user142019
@bamboon what? Why would I make such terrible jokes?
 
This is another one of those threads I wish I'd never started:(
 
user142019
Control : Window really makes no sense.
 
user142019
How are buttons windows?
 
6:17 PM
Yeah, kids these days.
 
@Collin hmm, yeah obviously yes
 
Oh gawd. What did I do wrong?
@R.MartinhoFernandes. So there is no way around a storage manager? That's too bad. — sharethis 1 min ago
 
@WTP'-- because you are the one who brought sublime to the lounge?
 
I really want to post "The way around it is to stop being STUPID"
 
user142019
@bamboon I used it a few times on Windows a few months ago.
 
user142019
6:19 PM
I’ve never used it since then.
 
user142019
And no, I’ve never used it to build things.
 
are there multiple daknoks in this room?
 
@WTP'-- As most of the programming world defines it, a Window is something that can receive messages and may have a drawable surface. A control receives messages and has a drawable surface, so it's a window.
 
@bamboon explain your preferences for bamboos (Bambusoideae)
 
@Collin I'm trying to decide if I should explain that I have no idea what a storage manager is, or just move away before I take too much SAN damage.
 
6:21 PM
@R.MartinhoFernandes Just let it go.. it's not worth it
 
user142019
@JerryCoffin why the hell is that called a window? XD
 
@R.MartinhoFernandes Step away and retain your SANity.
 
user142019
“View” would make much more sense.
 
He'll code up a gigantic pile of UB and give up
 
@WTP'-- EVERY GUI object that can respond to events is considered a "window" in the windows API.
 
6:22 PM
@R.MartinhoFernandes If you take sanity damage, just light your oil lamp
 
@WTP'-- Because, back in the days of Smalltalk, that's what they came up with, and most other GUIs derive from that.
 
user142019
@Chimera oh Windows API. Windows API is a piece of crap.
 
@rogcg well, they are simply cool
 
@WTP'-- Yeah people here like to call everything crap, like it's a meme. But why do you think the Windows API is crap?
 
6:23 PM
Because he never used it.
Because it's C.
 
@bamboon agree.
 
Because it's not from Apple.
 
user142019
@Chimera I used it in the past. Can’t say I’ve ever enjoyed working with it.
 
Windows API has good naming, I'll give it that :)
 
user142019
It was terrible.
 
6:24 PM
A button has to draw itself, it can repond to clicks and keypresses, it must be able to move when its parent 'thing' moves, it may host some icon/glyph or text. Sounds like a window to me..
 
the Windows API is as good as you're gonna get from a shitty C API
 
@WTP'-- I worked with it in the past in C and rather enjoyed it.
 
user142019
Windows Forms is much better than Windows API.
 
You have no idea what you're saying, do you?
 
user142019
I have.
 
6:25 PM
Windows Forms is nothing more than a .NET wrapper over said API
 
user142019
@DeadMG so?
 
user142019
Doesn’t mean it’s equally terrible.
 
@WTP'-- Assuming that was true, it would prove you were just trolling.
 
You know, that patterns guy should be a good candidate for twitter.com/tinkertim/status/261034376891097088
 
@WTP'-- It's fruit of the poisoned inheritance tree.
 
6:29 PM
@Borgleader That may work on video games, but good luck convincing a GM to give your SAN back by lighting a lamp.
 
Windows "Forms" existed before .NET yes?
 
no
Windows Forms is a .NET library
 
Windows "Forms" != Windows Forms
 
What are the quotes about?
 
So I must be thinking of a Win32 "dialog" based application then from the days before .NET
 
6:30 PM
I forgot where I was, again.. :(
 
@R.MartinhoFernandes "Because" "I" "like" "them""."
 
@R.MartinhoFernandes Haha, true.dat. Ever played Amnesia: The Dark Descent?
 
Before .NET, there were other GUI systems built on Win API. I use one every day, (nearly).
 
@Borgleader A little. I have yet to reinstall it since the disk fried.
 
@Chimera possibly the Visual Basic environment
 
6:32 PM
 
@R.MartinhoFernandes Ah I see, because that wallpaper is about Day[9] playing Amnesia. He gets scared really easily so he kept his oil lamp on and kept running out of oil xD
 
@MartinJames Visual Studio supported some kind of GUI Builder in C++ before .NET. I don't recall what it was called though.
 
Yes.
 
For starters, vectors don't decay to iterators; isn't that enough of an advantage? :) — FredOverflow 13 secs ago
 
6:37 PM
Can a vector of char be used as a parameter to a function expecting C still NULL terminated string?
 
data()
 
user142019
@Chimera yes.
 
user142019
@Chimera as long as the data in the vector contains '\0'.
 
@WTP'-- ok thanks
 
6:38 PM
@Chimera You probably want std::string then (as it guarantees the terminator is there).
 
user142019
Otherwise, use std::string::c_str(), but that won’t work with a function expecting char*.
 
You can remove const though...
With const_cast
 
user142019
std::string::c_str() returns char const* so you’d need const_cast.
 
but you really, really shouldn't.
 
@MartinJames lol, that looks like the VB6 GUI designer. Tell me it's not.
 
6:39 PM
@Chimera Not directly, no. If it's expecting a C-style string, the parameter will be a char * (or char const *), so you'll need to pass your_vector.data() or &your_vector[0]. Just trying to pass the vector itself will give a type mis-match.
 
@ToniPetrina You can't. You can remove the const, but you can't make it writable, so it's worthless.
 
especially when you can just do &str[0] or &vec[0] or data()
 
@R.MartinhoFernandes Well, you can't write to it but some functions unnecessarily accept char* and don't modify it :/
 
@WTP'-- No, you would not need const_cast.
 
@R.MartinhoFernandes No Delphi 5 - just happened to have it open, so made a new form. Must remember to remove it from my build:)
 
user142019
6:41 PM
@R.MartinhoFernandes if a function expects char* and you have a char const*, you need const_cast. Am I missing something?
 
For the umpteenth time, const_cast is not for cheating; it's for working with broken APIs.
@ToniPetrina Yes.
 
user142019
@R.MartinhoFernandes Yeah, who says said API isn’t broken?
 
@MartinJames .NET is cool.
 
sbi
> The word "stress" is the same in German, but with a capital S. For obvious reasons. #dailydeutsch@ShitGermansSay
 
@WTP'-- What you're missing is giant pile of UB
 
sbi
6:41 PM
Good evening.
 
user142019
The API expects a C-string rather than std::string, you can expect it’s not const-correct.
 
@R.MartinhoFernandes I absolutely agree :)
 
user142019
@DeadMG I KNOW.
 
No C API is const-correct by definition :D
 
then don't invoke const_cast.
better to waste a few cycles copying the data than to blow your program with a const_cast.
 
6:42 PM
@sbi Hello.
 
@WTP'-- What? Why?
 
@ToniPetrina uh huh
 
Just look at the declaration of, say, strcpy.
 
sbi
@DeadMG "Missing UB" — what am utterly strange concept. If there is one C++ "feature" I did not miss in three years doing C#, it was UB.
 
user142019
@R.MartinhoFernandes Because if it expects char*, it probably sucks because it doesn’t use the Standard Library.
 
user142019
6:43 PM
If said function won’t modify the object, it’s fine.
 
@EtiennedeMartel Doan' need no bloated managed runtime environment.
 
@WTP'-- What if it expects char const*?
 
user142019
@R.MartinhoFernandes Then you don’t need const_cast, so that’s irrelevant.
 
user142019
(And the function still sucks, but that’s irrelevant too.)
 
if a language is designed around UB as the central concept, then it's almost trivially easy to write a program that does anything
 
6:44 PM
Also, don't use strcpy, use strncpy ;)
 
user142019
No.
 
user142019
Use std::string.
 
I mean, if you really really have to use strcpy, then better use ranged versions.
 
user142019
You won’t have to.
 
microsoft's deranged versions are even be44er
 
user142019
6:45 PM
And if you do, you’re doing it terribly wrong.
 
@ToniPetrina Nearly the worst possible advice -- strncpy is almost never a good answer to anything.
 
@WTP'-- But why would you expect it to not be const correct?
 
@JerryCoffin Why?
 
Dismissing examples of const-correct APIs as irrelevant when you're claiming you should expect it not const-correct is dishonest.
 
@Cheersandhth.-Alf strcpy_s?
 
6:46 PM
@ToniPetrina Because no matter what you want, strncpy probably won't provide it.
 
@ToniPetrina yeah, cause the standard library functions are deprecated
they might disappear!
 
@JerryCoffin At least you can prevent buffer overflows and writing over bounds :/
@Cheersandhth.-Alf Yeah, standard functions will be removed in one of the future releases :D
 
Why would anyone in their right mind use strncpy in C++?
 
sbi
@ToniPetrina Says MS.
 
@Cheersandhth.-Alf Not before time, either.
 
6:49 PM
@ToniPetrina strncpy will pointless zero-fill extra space if your source is shorter than the destination. It will leave the string un-terminated if the source is longer than the destination. The only time it's useful is when/if the destination exactly matches the length of the source (in which case strcpy will be fine too).
 
@Borgleader If you don't use null terminated strings ;)
 
@Borgleader Oh - one snag. I NEED the standard library functions for my C++ embedded systems. I have no space for any std library bloat.
 
@ToniPetrina I much rather store my non-null terminated strings in a std::vector<char> and use std::copy
 
@ToniPetrina If they're not NUL-terminated, they're not strings. If you want to copy a buffer that's not NUL-terminated, use memcpy (in C -- of course, none of this makes sense in C++, where you should be using std::string or std::vector<char_type>).
 
@R.MartinhoFernandes You might like this ^.
 
6:55 PM
@JerryCoffin Ok that makes more sense to me.
 
I wish we had spoiler tags
@MartinJames Oh, fair point
 
@Borgleader I never watched that show, and I already know all the spoilers.
 
I was gonna quote "There are only 12 models."
 
Sometimes you have to update an existing code, I know that it sucks, but still, some safety is better than none.
 
sbi
@MartinJames What do you mean, "std lib bloat"?
 
6:59 PM
fuckshitballs
why does this idiot recruiter want me to fill out a five-page application form?
 
@DeadMG Spaghettis?
 
full of information she could have just gotten from my CV?
 
@DeadMG Sounds like redtape.
 
@DeadMG It's part of the game.
 
sbi
@DeadMG If you can't be bothered to do that, how would you ever manage to get through a bad spot at work?
 
6:59 PM
@DeadMG calm down
 

« first day (740 days earlier)      last day (4206 days later) »