« first day (2179 days earlier)      last day (1314 days later) » 

9:22 AM
I made my PR. Lukas is my reviewer
 
9:47 AM
In fact... this might not be the ideal months to do PR on a high visibility repo
 
10:05 AM
@DenysSéguret I remember need this but I don't remember what I did
 
@DenysSéguret The functionality is great, but i wouldn't expect a method called "insert" to return a mutable reference to the inserted data
..and you only need "insert" because "replace" returns Option<T>, right?
It probably is the naming that bothers me, it is not self explanatory..
also how does this differ from get_or_insert and get_or_insert_with?
(looks like others have pointed out the same)
 
@PeterVaro this insert whatever
the difference is obvious
 
@Stargateur hmm?
 
get_or_insert only insert if none
insert insert whatever
 
Oh yeeeeaaahh, I missed that bit, yes, yes, sorry
 
10:27 AM
The naming looks consistent to me, I don't like the hack with replace. But the point with insert_with being useless is good
 
@DenysSéguret hack ?
 
@DenysSéguret That means you can pester poke him through here, great!
 
@E_net4usesGitHubreleases accept or downvote
 
@Stargateur [why not both girl]
 
well, using a tupple just to discard the useless value looks like kind of a hack. I don't think the use case I mention, which is setting the value then using it, is rare.
 
10:30 AM
@E_net4usesGitHubreleases I miss his presence in the room :/
 
True, he always knew how to bring an extra aura of GATs.
 
@DenysSéguret well if you name it insert I agree with you about the old value
but replace_and_get also have some usecase I guess
and so is more generic that your insert function
 
@E_net4usesGitHubreleases That. That alone.
 
insert_and_gat
(just to reflect to both threads at the same time..)
 
10:39 AM
well let's wait for more external point of view
 
LOL
user image
2
 
11:14 AM
Should I commit removing insert_with now or should I wait for other comments ?
 
I think it could be safely removed, after Stargateur's comment I realised it myself: it serves absolutely no purpose
 
@DenysSéguret that your call, it's your pull request and so your point of view that matter.
 
I'm removing it. The consistency with get_or_insert_with isn't worth the burden of an almost useless method
 
I’d mention that it’s deliberately left off in your original PR comment.
Since it might not be obvious to a reader.
I played with GATs for the first time for something real-ish play.integer32.com/…
 
@Shepmaster I edited the title and first comment
Rust's contribution guide is amazing
 
11:30 AM
And you were worried
 
Well, it's not yet done
 
To be fair, there are some rough edges around the ways of building the fastest
 
You need to work on several projects and with several computers IMO
 
@DenysSéguret By the way you plan to add unit test ?
 
@DenysSéguret of course not, it doesn’t have GATs yet
 
11:32 AM
@Stargateur I've added a few ones, tested with them, then decided they were mainly noise, the test in doc is enough
The code I've put in my PR comment was tested in tested units
 
And the code in the documentation comments are tested
 
@DenysSéguret I don't think an unsafe code should not be tested what test exist for other option unsafe function ?
 
I've looked at the existing tests: they are rare
 
well in that case at least in the doc add the case where the option is not none
 
Maybe. It's a compromise.
 
 
2 hours later…
1:18 PM
how to make Option<Vec<>> to iter on vec if exist in one line ?
iter + flat_map on the option
nevermind so
 
why flat_map ? You can just do flatten
 
&&vec is not a iterator
 
so you want an Option<&Vec>, not an Option<Vec>
 
1:29 PM
yeah sorry
 
In that case you could use .into_iter().flatten()
 
@trentcl I don't want to consume it
 
@Stargateur Option<&Vec<_>> is Copy
 
perfect so
 
1:32 PM
Some details of the feature addition protocole are hard to guess
 
I quite agree with all suggestion specially the ref mut one :p
I guess you follow previous code on this one
 
I follow the suggestion and add them to my previous changes (making the doc test longer as you suggested) in my next commit
 
2:15 PM
@Stargateur I'm always torn on this in general. I like to both write code such that works on as many versions of Rust as possible but also like using new features.
the stdlib is nice because you know that it's always going to be compiled with one specific version of rustc at least
(well, two, I guess)
 
well stdlib is compiled with the latest compiler no ?
also I HATE ref keyword
 
@Stargateur That's what I mean by "the stdlib is nice because you know that it's always going to be compiled with one specific version of rustc"
and the pedantic correction that it's actually built by two versions — the old and the new
 
 
2 hours later…
4:46 PM
@E_net4usesGitHubreleases no gold hammer necessary
 
 
2 hours later…
6:49 PM
ok, lukas, now come and accept my PR, it starts to attract odd comments ^^
 
I find abbreviations like val to be an awkward middle ground between "this is what this thing is" and "I have to give this thing a name, but it doesn't really matter what"
ident is another one that annoys me
 
@trentcl funny I edit my macro today and it my my exact though :p
I must learn procedurale macro
@DenysSéguret that funny because someone advice longer name than someone suggest shorter one xd
 
@trentcl I first followed the practice of the code (which was the single letter v). Then val as was suggested by jnl (and which is better). Had I chosen myself, I would have used value (which I usually use) but as a newcomer I prefer to follow the customs of the place...
@trentcl ident is a terrible choice IMO
 
@DenysSéguret yeah, criticism not directed at you, just general observation
 
@DenysSéguret as I said there is two time value name in the code :p
 
6:59 PM
Another awkward shortening is the iterator's rev. Everybody can read and write reverse, there was no point making it rev, it's not like if you used it every 20 lines
 
explicit is better than implicit :p
 
"It depends", it's a balance
 
yeah there is always counter exemple :p
Vec... or Vector
 
The thing with Vec is that you use it all the time, so it's OK
 
I use Option more
Opt ?
 
7:01 PM
"Opt" doesn't sound good
 
true
 
@Stargateur fair point
 
In my school there is a not so stupid rule but that make people do stupid thing, a function can't be longer than 25 lines and 80 columns
I have seen code that should exist in any language.
 
This rule is easier to follow in some languages
 
@Stargateur whoof, I get the motivation but that seems extreme
 
7:05 PM
@trentcl In C of course and C++
 
Rust tries to be quite vertical but dealing with temporary variables may make it hard to always limit yourself to 25 lines
In Java you have factory names which don't fit in 100 characters
 
if you fail to respect the norm, -2 at 5 mistake you get -21 as final note whatever good is your project
@DenysSéguret haha
 
I made a library in JS just to be able to break regexes so that I don't have to play tricks with the linters
I remember that Linus himself recently wrote that limiting oneself to 80 columns was stupid today
 
Some of my coworkers seem to code on 4k monitors with 10 point type, so there should be some hard limit on line length
 
@DenysSéguret yeah, I like short function but not at all the 80 limit
@trentcl I think today 120 is good
even 140 is ok
 
7:12 PM
@trentcl Yes. I configured the linters at work (100 or 120 depending on the languages). I don't like these hard limits but without them some horrible code appear
 
.. I just wrote a 68 line function (in C#). And that's already making a helper type and outlining a helper function. I could maybe golf away a few lines? but I don't see how to get this down to 25.
 
A 68 lines function isn't so big in my book
I'm sure I have bigger ones in broot
 
I think I have it out to 160 char, but I'm on huge monitors here. One of the conditionals in this function is out to col 148
 
@Zarenor my main function is like 450 lines long, all my other function are less than 15
 
Oh, I'm not saying I agree with making 25 line functions. Exactly the opposite. I think have have over-100-line functions. If there isn't a good way to separate the control flow, then there isn't
 
7:14 PM
@DenysSéguret well sometime yeah, like exploring the tree of files
@Zarenor the important thing is to know when you need a function
 
@Stargateur App::apply_command is a little more than 200 lines. Big enums tend to do that
 
@DenysSéguret also a good exemple ^^
 
Heh. This is implementing cosine over an interval - so if the interval crosses the pi or 0, that's going to set the min or max of the output interval
 
> “The code is more what you’d call ‘guidelines’ than actual rules.” – Hector Barbossa
 
Heheheh
 
7:18 PM
@Stargateur For curiosity, when you code is most of your screen width taken up by the editor window?
I usually code with an editor in the right half and terminal in the left half of the screen
so when I'm on a laptop, I'd have to turn the font size to pretty small to fit 140 chars
 
I always code in less than half the width so that I can see the lints/compilations/results/etc. in the other half
 
I have two screen
sometime I want 3
 
@Stargateur the second screen is where I keep my browser window open to the docs
 
@trentcl I see you are cultured too
with i3 it's easy to have a lot of workspace so I can switch easily to my console if needed
 
I used to have 3 screens at work but my current setup doesn't support a third unfortunately
 
7:25 PM
one of my co-worker is absent... let steal the monitor tomorrow
 
7:45 PM
I'm quite vexed. Hacktober spammers totally ignore my repos. They're not even good enough for typo fixing spam bots :(
 
 
1 hour later…
9:00 PM
 

« first day (2179 days earlier)      last day (1314 days later) »