« first day (1630 days earlier)      last day (3322 days later) » 

Ctrl+L is cut line
 
but it is not pastable
 
oh derp :)
made it private :D
 
@CatPlusPlus that's not very complicated, hmm
well, less complicated than Xeo's
 
9:07 AM
@MomotapaLimpopo what is delete current line then?
 
@Xeo I actually can't play Stabround until I leave the swamp
 
@JohanLarsson Ctrl+Shift+L
 
Good except from the embarrassment learning this is a good thing
ty
 
@JohanLarsson For future reference: Tools > Options > Keyboard
 
9:15 AM
@MomotapaLimpopo I know, it was just that I ~knew what ctrl + l did. Dunno where I learned it, prolly some talk.
Never read what it did.
 
o_0 just spent a like an hour trying to ram some random python class into an online dohiky just to confirm my ported code is doing the same so far... I guess it's good to know I'am on track...
 
foo_string fail should be to_string
 
@Puppy no, from_string
oh yes, right you are
the first one should to from_string
I'd also make that function template on the enum, you expect to go to/from
 
@Griwes dude
 
@Puppy Yes, probably.
 
9:21 AM
fuck it's an old version
 
std::vector<int> i; auto copy_i(i); // totes works right?
 
@Mr.kbok Knowing the definition of ENUMS_PRODUCE_ENUM would probably be helpful.
 
"why template the two string?" sometimes I surprise my self :\
laters
 
9:29 AM
no
 
> The programming language PHP ­created and sustains Facebook’s move-fast, hacker-oriented corporate culture.
> hacker-oriented corporate culture
 
corporape culture
 
> Startups can cleverly use the power of programming languages to manipulate their organizational psychology.
Ctrl+W
 
wat
 
@Griwes No, I want feedback to be based on usage, not implementation
 
9:41 AM
@Mr.kbok Doesn't look bad.
 
I'll put it on github
 
I probably need to slap something akin to that get_values onto my code somehow, to avoid doing the fragile + 1.
 
Who wrote that
Y no link
 
what
 
>:|
@MomotapaLimpopo
 
9:43 AM
@Griwes Yeah, you need to handle cases where people want to set their own values
(a = 7, x = 9, y, z)
it gets messy quickly
 
Yes.
I just wanted a quick-and-dirty prototype of that.
(Since the primary use-case I have right now doesn't care about actual values.)
 
user1804599
Awesome, you can now embed documentation in Mill code!
 
Useless. You should write self-documenting code instead.
 
that code looks legit
 
user1804599
9:54 AM
@Griwes Wrong.
 
now if only rightfoldslavov won't do something else a fraction of a second from now
 
What do you guys think?
 
@райтфолд Right.
 
user1804599
What you need is precise specification for all public APIs that doesn't require you to read all the source code.
 
9:55 AM
That spec is there in tests. And in the API itself.
And probably in the "tutorial" section.
 
@Mr.kbok Could use an explanation of the expected project structure and how it’s interpreted I suppose.
 
user1804599
Mill already allows you to add preconditions, postconditions and exception specifications to subroutines and these will be included in the documentation automatically, and checked at runtime in debug mode.
 
@LucDanton It's more an idea than a real project right now, so it expects you to just put all your .cpp files in the root directory :)
 
What about the includes?
 
I'll migrate my projects to it while adding the necessary features
They are handled via the babefile. I know, it isn't documented at all.
 
9:58 AM
still don't know of a good API for a generator :(
usually these things just come to me by now
but nope
4-5 days later still nothing
 
user1804599
But some aspects cannot be specified this way.
 
user1804599
For example, what count does on infinite lists (never halt).
 
maybe I should sort my thoughts into a markdown file or something
 
@LucDanton watch out. Use family filter!
 
user1804599
You can also not unit test that.
 
user1804599
10:00 AM
So it has to be specified in English.
 
@райтфолд sorry. "=cut" seems kut
You should not require people to remember more random keywords
 
user1804599
@sehe It's just POD.
 
Has POD always used that? That's kut then
 
user1804599
Yes. It terminates the POD.
 
10:02 AM
=klote
 
user1804599
Currently I just use a regex to find it but I want to switch to a proper POD parser, and fail to lex if POD is malformed.
 
user1804599
@sehe hahahhahaa
 
a link to the docs you use would not be remiss — sehe 3 mins ago
It wasn't a long search. See my answer :) — sehe 24 secs ago
 
4
A: Isn't there an official format specification of .apk?

notverycreativeI don't know if there's an official specification, but from browsing my app's file structure, I have deduced the following: -The .apk is simply a zip file and can be opened as such in any suitable application (7zip, WinZip, WinRAR, any OS's default .zip tool). -It must contain an AndroidManifes...

Okay I didn't expect that.
Like I didn't expect the new MS formats to be zips.
 
Many many many many "file formats" are actually archives
Always have been
 
@sehe I should teach myself to open everything with 7z. :)
 
If you have a class with a "property" of type T that can only be read and not written (talking about C++), would you implement that as a private data member with a getter only, or as a public data member of a type that has a deleted operator = and converts implicitly to T? I feel the latter is somewhat aligned with the "fuck getters and setters" philosophy which seems to be strong in C++, OTOH I haven't seen it much around.
 
Former.
e.g. size()
 
That's what I'm used to
But I was wondering if I'm not used to something sub-optimal
 
I liked how Obj-C worked with properties in the 10 minutes I used it
 
10:21 AM
after all, doesn't the same rationale apply here as the one used to dismiss getters and setters?
Data members could keep their own invariants etc.
 
Yes, this was what I mostly was looking for :) — SebastianK 36 secs ago
Joy. I even debugged his brain
 
@property NSString *fullName; <- automatically generates setFullName and fullName getter
@property (readonly) NSString *fullName; <- only getter
it's a bit funky with the generation tho, it felt weird at first
 
I mean it spawns code invisible to you
following some specific naming convention
 
No. You should teach yourself to use `file` and open it with the respective tool.
/OR/ just use Vim
 
user1804599
10:23 AM
@AlexM. strong and weak and copy are important.
 
user1804599
For NSString and NSArray, always use copy.
 
user1804599
Also use strong or weak for class other types.
 
I pasted it from the official docs I only used obj-c for 10 minutes dont tell me what to do
 
user1804599
Because for silly reasons, NSMutableString is a subclass of NSString.
 
Xeo
@AndyProwl unless you specifically write a type for that member, it likely doesn't know what invariants it should keep.
 
10:26 AM
@Xeo Yes, that's the alternative I was thinking of - writing a type for it
 
user1804599
@AndyProwl That's why good languages like Eiffel, D and Spec# allow you specify invariants!
 
Xeo
@AndyProwl that sounds mightily annoying, though
 
I mean, isn't that the "idiomatic" approach for replacing getters and setters when an invariant has to be kept?
 
@DonLarynx What
 
I wouldn’t say so, I rarely see it in C++, if at all.
 
10:29 AM
@Xeo Yeah, it's more work, but then again even writing RAII classes instead of scope guards is more work - I feel there are more of such examples where laziness should be overcome, so to say
 
@AndyProwl As in read_only<T> ?
 
@LucDanton OK. I remember Jerry suggesting this instead of getters and setters
or was it Puppy?
Probably both of them
@MomotapaLimpopo I had something like that in mind
But I'm not sure it makes sense
 
I usually rename my getters and setters to make sense
instead of like get_garbage, set_garbage
 
I think a getter is more flexible than exposing a data member
 
@Rapptz What would you name those?
 
10:32 AM
don't know, they're garbage
 
collect_garbage() and accumulate_garbage()
 
I usually have T garbage() and garbage(T)
 
I don't think renaming changes the problem though
 
@MomotapaLimpopo Yeah I do that.
If I have no clever name for it
 
Great minds think alike
 
10:33 AM
e.g. resize and size.
 
It's still a pair of getters and setters
 
13 mins ago, by Luc Danton
e.g. size()
 
capacity and reserve comes to mind
 
38 secs ago, by Andy Prowl
It's still a pair of getters and setters
I thought we don't like getters and setters
 
we don't like pointless getters and setters
 
10:34 AM
or is it only for the case when no invariants need to be kept?
 
correct
 
I think I need to ping @Jerry about this
 
size() is not a getter.
 
But exposing a read_only<T> requires you to always store a read_only<T> in the interface. Also you can't add behavior like idk, logging when someone accesses that variable, or putting a breakpoint like you would in a setter
 
10:37 AM
@Rapptz Right, I'm aware of that one.
 
@LucDanton what do you think it is?
 
A setter clearly
 
Mar 19 at 21:16, by Jerry Coffin
@QuestionC 99+% of the getters and setters I've seen had negative value--they made the code (often substantially) less readable, while providing precisely nothing of value in return. Nearly all of the rest that actually did something would have been (far) better served with a public member of a type that overloaded operator= as the setter and operator T as the getter.
Found it
I seem to recall him mentioning this more than once
And it somehow entered my brain
 
@Rapptz The Standard uses 'observers' for those things. It’s a bit surprising there isn’t a langage-agnostic term, isn’t it?
 
22
Q: Portability of Native C++ properties

Josh BrownIn Visual Studio, there is __declspec(property) which creates properties similar to C#. Borland C++ offers the __property keyword with the exact same functionality. In the C++0x, there is mention of a implicit keyword that could be expanded to implement the same functionality. But it didn't m...

 
Xeo
10:39 AM
Meh. It's still a "getter" to me.
 
std::vector<Type> is not guaranteed to have a size_type member though :v
 
kinda related
 
What is it we would be getting?
 
The size?
 
@LucDanton says who?
It's a requirement of the Container concept.
 
10:40 AM
Yeah no.
 
I mean, if we restrict the definition of "getter" to "something that just returns the value of a data member" then yes, size() is not a getter
or, it's not necessarily a getter
 
I hate these one question accounts.
 
Table 96
§ 23.2.1 C++11
says it right there
 
Jul 10 '13 at 4:23, by Jerry Coffin
The answer to that is that if you want to change how assignment is done, you change it to a user-defined type, and overload operator= for that type. Likewise, if retrieving the value is more than just returning an existing value, you overload operator T (for some type T) to do the work necessary to return the value correctly.
Here's another instance
 
size() is in there too
 
10:42 AM
@Rapptz lol, a member of type size_type. That size() would be exposing.
I blame English compounds, this time and every time.
 
personally I'm not a Maximum Fan of that approach since the UDT would need a pointer back to the owning instance and stuff
 
size() has to return size_type
what am I missing
 
@LucDanton Should've said "a size_type-typed member"
 
@Rapptz What is a getter?
 
@LucDanton Baby don't set me, no more
 
10:44 AM
it gets stuff
 
Does anyone think of size()/resize() as natural pairs?
 
no.
 
@LucDanton no
 
clearly I speak for everybody in this matter.
 
@Puppy Right. I'm just done doing that, I look at it, and I'm wondering if it was worth it.
 
10:44 AM
@Rapptz Does std::thread::hardware_concurrency count?
 
I'm not sure what I should think of it
 
(I don’t remember how it’s spelled.)
 
I need a guiding light
 
having a size does not imply something can be resized
 
@AndyProwl Fuck it.
 
10:45 AM
@LucDanton Yeah. A getter without a setter obv.
 
@Puppy Use getters and setters?
 
@AndyProwl Depends on the situation really.
 
@AndyProwl I would write a size() if I would need one. E.g. with size you can write loops, reserve another container with just enough room for everything, and so on. All those things being the result of invariants, equations, laws, axioms whatever you call it.
 
Ok so "fuck it" was not the guideline?
 
@LucDanton I don't see why I have to. A setter doesn't require a getter or vice versa. You can have a setter without a getter etc.
 
10:46 AM
well, no, fuck the UDT.
but I might prefer a getter without any equivalent setter, for example, depending on the circumstances.
 
Isn't "fuck the UDT" the same as "use getters/setters", modulo finding sexier names?
 
nah
 
Then I'm not sure I understood
 
it just means that all you've achieved is getters/setters but with an overcomplicated implementation
but that doesn't mean that getters/setters is the right approach in the circumstances you're in.
 
what exactly is your problem in plain english
 
10:48 AM
Say I have a value that needs to be settable/gettable, and every time the value is set, I need to log its value.
 
@Rapptz Yeah that’s fair. I didn’t want to imply that if one is a getter/setter, then the other one has to correspond though. I wanted to underline how each one makes sense and is useful on its own—with defined semantics re: loops, invariants etc.. Combined with the 'we don’t care whether the container stores this size in a member or not', this is the point where getters/setters considerations are entirely irrelevant.
 
@AndyProwl you use AOP for that
 
@AlexM. Not really good enough.
 
Alternative 1) have a getter/setter, where the setter logs; alternative 2) define a UDT which has overloaded operator T and operator = and logs on assignment
 
Go with #1
 
user1804599
10:49 AM
Lenses are the best getters and setters.
 
@Puppy I tried to make a funny joke :(
Jul 23 '14 at 22:28, by R. Martinho Fernandes
Q: What is aspect oriented programming?
A: Fancy pants logging.
 
C++ does not support such things intuitively, and never can do, you will always lose something in exchange for this feature.
 
(this was not my original question, but it seems my original question was already assuming alternative 2 was preferable)
 
user1804599
C++ is just bad for not supporting UAP.
 
getter/setter seems to me like the least evil
 
10:49 AM
#2 is a pretty bad idea imo
 
but I'm not sure why you need to log every time the value is set.
 
whenever someone mentions logging I immediately remember about Robot's message above
 
that sounds to me like you're trying to replace the debugger.
 
implicit conversions suck
 
I'd like Jerry to be here, so he could argue back
 
10:50 AM
and making it explicit is annoying for the user
 
@Puppy It's just an example
 
it's a lose-lose situation
 
@AndyProwl Well, fair enough. So assuming that you actually have a valid reason to want to log every time the value is set, then a getter/setter probably would be fine. I'm just not sure if this actually occurs in practice.
 
@AndyProwl My advice is to remember the times where you are wearing the implementer hat, and those when you are wearing the client hat. When you are the implementer, then maybe you can think of those things as a getter/setter pair inasmuch as they set or return the value of a member. When you wear the client hat, what matters is what those functions are useful for.
 
@LucDanton When wearing the client hat, I think I'd rather see the data member. The abstraction I'm realizing is that of a data, after all.
 
10:51 AM
Option #2 is probably easier to read
 
you can't see the data member, so that's pretty much tough.
 
@AndyProwl You’re the one in the position to make that decision.
 
user1804599
@AlexM. fancy word for "hooks"
 
OTOH you're leaking details
 
@Puppy The point is, if you go with alternative 2, you can see the data member
It's just a public data member
 
user1804599
10:52 AM
Mill has best use for . operator.
 
ignoring my annoyance comment :(
 
@AndyProwl No, you really can't.
you can't do like, int& x = object.member;.
 
I do share Rapptz’ opinion that implicit conversions are rarely that helpful though. I played it down because I stuck to a more or less language-agnostic view.
 
Compare int member() { log and return; } with a public read_only<logged_access<int>> member;
 
or imagine if it's a string, object.member.push_back('x');.
there's a bunch of shit you can't do with that UDT that completely breaks any attempt to naturally use that data member.
 
10:53 AM
@Puppy Oh, that
 
getter/setter presents it as the operations that are really available on it- a value.
 
I'm starting to see the cons
 
annoyance
 
Yeah but not just implementation annoyance
I don't mind that much
 
idc about that
I mean purely from a usability POV
 
10:55 AM
Yeah
Think I'm going to revert to my original "getters and setters" design
 
I actually wonder if there's any functional alternatives.
 
I’m not a big fan of mutation either so I don’t mind not having auto& internals = foo.bar; if accessing bar is meant to be 'magic'. wait that’s ambiguous
 
like I dunno, object.member([](T& t) { });
 
I don’t mind not having property syntax as it exists in other languages, is what I mean.
 
@Puppy does not seem very practical IMO
 
10:56 AM
properties would be neat yeah
but they're just sugar
 
properties wouldn't really work in C++ in the same way.
because they are not lvalues.
 
yup
 
@AndyProwl I dunno, it is both a getter and a setter, and you can present the member as a mutable lvalue and preserve your setter semantics.
 
what would you guys call a header that you want to mute warnings for?
 
That's true, but from a usage perspective it seems impractical
 
10:58 AM
I've used dependencies in the past
but
 
Clang calls them system headers
 
@Rapptz Normally a 'dependency header' because that’s the only headers I don’t want to hear about.
 
it's now ambiguous with build dependencies, e.g. "depends on libstuff.a"
 
So it’s coincidental.
 
so iunno what to call it now
 
10:59 AM
@AndyProwl Well, I think it offers more flexibility in the usage, since you now can access the member directly.
 
maybe I should just not care about the former
 
> Today's tale of apocalyptic internet near-misses comes from software developer Kamil Hismatullin, who discovered a security flaw in YouTube that allowed him to delete any video he wanted—or all of them, if he so desired. Fortunately, he did not so desire (although he apparently had some thoughts about doing a number on Justin Bieber's channel), and instead he reported the bug to Google and collected a $5000 reward.
 

« first day (1630 days earlier)      last day (3322 days later) »