« first day (2058 days earlier)      last day (1438 days later) » 

8:21 AM
@Stargateur That is bullshit and specific to C.. but what would you expect, when you have to put all your module / namespacing information into the type / variable name?
In languages, such as Rust, this is not needed at all. I've written tens of thousands of Rust code already, all with 80 columns width restriction, and I only had to do weird line breaks in a handful of times.
Use short but expressive member and method names as well as type and trait names and learn to use the use keyword properly, and this problem will virtually never come up
 
well a reasonable line length is good but I agree than 80 is short in 2020
 
(Speaking of hardware: I have two 34" monitors I'm working on, and the main reason I use 80 columns is that I can have 5 files open next to each other + a file-hierarchy)
@Stargateur ^
 
well, each people work differently
 
Exactly, my case in point
in 2020 I use the largest available monitors, and this is how convenient 80 columns could be
 
if you limit horizontal you will use more vertical, and vice versa
 
8:26 AM
(not because I have restrictive hardware)
Also, and this is more important: he ignores the ergonomic facts where 80 columns are coming from!
 
I think longer line make more sense than break non breakable line.
 
(It was never about hardware limitation, but imitation of typewriters)
 
and so that not really an good argument.
 
We, human beings, can read text better within the 70-90 columns
(where 80 is a general sweetspot)
 
and where does this fact come from ?!:
 
8:28 AM
From years of research
 
I hardly believe you
 
Have you learnt typesetting?
(I did, that's why I'm asking..)
 
why an arbitrary number of character would make reading better ? I could understand a size like 80cm at like 1m of eye but that all
 
(Obviously there's one thing here that I did not learn: typesetting formal grammar over a natural one.. but no one else ever did that.. Anyway, my point is, typewriters have this limit, because it was easier to read, and thus the first terminals have this same width limitation because of typewriters)
@Stargateur because of the way your eyes move -- they lost the line and the position of the start of the new line
 
there is a difference between code and normal sentence
 
8:32 AM
@Stargateur That's what I meant when I said 'formal grammar' and 'natural language'
 
well, in code I don't mind having more than 80 char by line ^^
 
Good for you, mate
 
specially when the indentation take 20
 
You should not do indentation like that
 
20 characters of indentation wat
 
8:33 AM
That's another good thing about the 80 column limit
 
example:
 
@E_net4isdownhausted of wide tabs :see_no_evil:
 
                        let data = std::mem::replace(&mut buffer, Vec::with_capacity(Self::BATCH_SIZE));
and trust me this indentation is perfectly normal
@PeterVaro never use tab is for devil people
 
                    let data = replace(&mut buffer,
                                       Vec::with_capacity(Self::BATCH_SIZE));
^ use namespace-removal with use
and this is how you would break it if you want to have 24 columns of indentation
 
i don't like this
 
8:35 AM
yet you're still inside 81
 
@Stargateur Except some argue that tab is more accessible to the vision impaired, so that's one odd devil.
 
not to mention this:
                        let source = Vec::with_capacity(Self::BATCH_SIZE);
                        let data = replace(&mut target, source);
 
@E_net4isdownhausted problem of tab is that it's not portable
 
^ This is how I would do it anways
 
@Stargateur The tab is standard. Its width isn't. :)
 
8:36 AM
@E_net4isdownhausted ...
exactly my point
 
I know. :P
 
@Stargateur learn to read between the lines! (an emoji-like word at the end of my comment is genuinely a great clue that I'm joking, you know..)
 
I also usually stick to the 80 maximum width in code, especially in comment blocks.
 
I'm happy to see indentation is still a open war between dev ^^
 
It is one of the holy wars, that will always remain with us..
 
8:38 AM
I accept 120 specially in rust where sometime thing take a lot of space
 
In light of my comments above, I'd say you are doing it wrong
but as we already established: it is, in some ways, a personal preference.. so.. yeah.. I'm going back to work and break some lines at 80
:sweat_smile:
 
must go too
 
 
1 hour later…
9:44 AM
cargo build accepts version = "0.14.1-dev" in Cargo.toml but not version = "0.14.1.1". I didn't find any precise doc on this.
 
@DenysSéguret semver.org
so it's directly follow semver specification
 
ok, so 0.14.1-dev is before 0.14.1
 
I think yes
but I don't really like this notation ^^
 
The goal is to ensure I can know whether users have the released version or compiled from source
(I don't make a release at every commit)
 
and for the record it's written randomly here doc.rust-lang.org/cargo/reference/…
 
 
3 hours later…
12:51 PM
"who can to office ? ok so 4"
"result: I'm fucking alone xd"
 
1:08 PM
that would automatically set such in your cargo. I believe
 
Doesn't seem so: it doesn't look like there's a difference between released versions and non released ones
 
@DenysSéguret the current commit in that repo seems to be exactly what you want tho: "start next development iteration 0.13.5-alpha.0 "
 
@Shepmaster cool. But I prefer to do this manually and be sure of what I do. It's neither long nor painful.
(the thing I automate is building all the versions for all platforms, building the downloadable packages, and archiving it for my bench comparison system)
 
1:28 PM
@Shepmaster eh I need this
 
One thing at least is missing: updating the CHANGELOG
 
@DenysSéguret well, you could follow a strict language in commit message to allow automatic changelog
or you could not care because for now you are alone on the project :p
 
What I mean isn't filling the list of things which changed but adding the tag entries, with dates
 
2:06 PM
People always in a rush to ask questions.
 
2:26 PM
@Shep I'm not sure that this comment fits the context.
 
I edited your question. You have an answer to "How do I get integer values from regex named capture groups?" with your current implementation (caps.name("qrw1").unwrap().as_str().parse::<i32>().unwrap()‌​). — Shepmaster 8 secs ago
@E_net4isdownhausted "How do I do X... here's how I did it, now write it better" questions
 
I'd argue that does not answer "how do I improve from here". But arguably, the question itself is not in a very good state.
 
Otherwise a perfectly fine answer is "you don't" / "cannot"
 
 
1 hour later…
3:42 PM
wowowowowowow
164
Q: We're switching to CommonMark

Ham VockeI’m Ham and I’m a developer on the Teams team here at Stack Overflow. Over the past few months, I’ve been heads down working on the way we turn Markdown into HTML when writing and editing posts across the network. I’d love to share what I’ve come up with. In a nutshell: We’re planning to use Com...

 
2020 what a time to be alive
 
3:59 PM
each time OP comeback he got another downvote xd
not mine !
 
@Stargateur Whelp. The system will stop 'em eventually.
 
 
2 hours later…
6:14 PM
@PeterVaro in some "old" C library I wrote, I remember there's a line with 68 leading spaces of indentation (the line is just a break;, but you can imagine the if just before that breaks the 80-character rule)
 
@FrancisGagné Wow, if you don't mind me saying, that sounds truly awful! :D
I remember I came up with a namespacing rule to all my "public" functions in C
(and types ofc)
and they became quite long
 
namespacing in C == use a macro
 
@PeterVaro I didn't particularly care about overlong lines in that project :P
 
that was before I realised that prior to C99 the number of characters that could be used to name entities were actually limited..
 
void NS(myfunc)(int foo)
 
6:18 PM
@Shepmaster Yeah, I did that as well, but those lines are going to "evaluate" to actual object names, so you still have to name your objects in a long way.. not to mention, that writing:
NS(myfunc)
is not much shorter than
NS_myfunc
(in fact, +1 character long)
 
well, NS is a macro that expands to the_name_of_my_library_
 
Oh, right, gotcha
in that case, it makes sense, sure
 
you can use the same trick to handle declspec junk on Windows
 
@Shepmaster well for dllimport/dllexport specifically, you pretty much have to use macros, because you want dllexport when compiling the library but dllimport when consuming the library
 
Anyway, my original point was: in C (or any namespaceless language for that matter) it makes perfect sense to increase the number of characters in a line (or columns in row if you like)
but for languages which support namespaces (and particularly Rust, which supports them so well!) it doesn't
 
6:22 PM
I just found a function declaration that's 479 characters long
 
@FrancisGagné get outta' here!
Have you ever worked with OpenGL<=4.0?
 
Now those object names could be increadibly long and complicated
 
in my library, it seems I prefixed everything with libasm_ or LIBASM_, even private (static) symbols
 
might as well do it for all of them
 
6:26 PM
@FrancisGagné I did the same (I used to use 2-3 character long lib name prefixes) but not for privates!
 
I like to use 80 character soft margins, but if I am indented 8 spaces then I go to column 88. Indented 16, margin at column 96. It preserves the readability of 80-character lines without having to cut lines ridiculously short just cause they're indented.
Also, don't have to reformat lines when I indent or unindent them
I'll liberally go over 80 if the code reads better that way. It's just a guideline, not a hard limit
Hard limit is somewhere around the 120 mark
 
doesn't rustfmt soft force 80 char limit?
 
@FrancisGagné I found it! FYI this was the naming convention I came up with for an OO like protocol for objects:
mc_Error lib_mod_T_new(T **self, ..., mc_Error muted);
mc_Error lib_mod_T_ini(T *self, ..., mc_Error muted);
mc_Error lib_mod_T_fin(T *self, ..., mc_Error muted);
mc_Error lib_mod_T_del(T **self, ..., mc_Error muted);

mc_Error lib_mod_T_new_copy();
mc_Error lib_mod_T_ini_copy();

const char *T_str();
mc_Error lib_mod_T_fput();
mc_Error lib_mod_T_put();
mc_Error lib_mod_T_sput();

mc_Error lib_mod_T_cmp();
bool lib_mod_T_bool();
mc_Error lib_mod_T_hash();

mc_Error lib_mod_T_get_v();
mc_Error lib_mod_T_set_v();
(where mc_Error was a special error type object I used to use..)
(sweet ol' C times.. Glob, I don't miss 'em at all!)
 
@NebulaFox rustfmt's default line length is 100 chars, if I'm not mistaken
 
@NebulaFox 120, IIRC
I'm wrong!
max_width

Maximum width of each line

Default value: 100
but the default comment width is 80, for some reason
 
6:34 PM
speaking of comments, I now write comments with "semantic line breaks"
with semantic line breaks, I find that my "lines" tend to be around 40-50 characters long
 
OMG, there's a spec for that
There's a spec for that
 
@FrancisGagné ALWAYS! That's more important then anything! (It's almost like typesetting a text into proper paragraphs and sections)
(I even started using the old british two spaces after a full stop tradition, which originates back to typewriters)
(I found them very, very useful and easy on the eyes, as in, helps me quickly parse a longer block of text faster)
 
@PeterVaro Markdown uses two spaces as a line break
just so you know
 
@PeterVaro HTML renders two spaces as one unless you use CSS or something to force it to render both, so meh
 
@NebulaFox not regular MD or MMD -- which flavour?
 
6:39 PM
@PeterVaro Regular MD
 
@FrancisGagné Yup, that's only for fixed with text
 
@PeterVaro but with semantic line breaks, full stops should be followed by a line break, no? unless you mean some other use of the full stop that doesn't mark the end of a sentence (e.g. abbreviations)?
 
(but my search-on-page-fu could be completely wrong)
 
I've used it in every markdown text
 
Oh okay:
> When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.
I've never used this one, because my editor is calibrated that it removes all trailing whitespaces on save
Good to know -- pretty horrible rule, I must say!
(Cheers @NebulaFox)
 
6:42 PM
@PeterVaro I use it a lot, I'm glad it exists XD
 
@NebulaFox It takes all kinds!
 
I think I might have found a bug in std::thread, but it involves unsafe code. If you do a thread::spawn and then call inside the call block unsafe { libc::pthread_exit(std::ptr::null_mut()) } on a call to join(), it will crash with Option::unwrap() at libstd/thread/mod.rs:1357.
 
@FrancisGagné Oh, okay, I just quickly skimmed that page, now I read it in depth: I'm not using this semantic line breaking then.. Not sure it really is that good of an idea..
But if it helps for people, then why not ofc
 
@NebulaFox haha, if you call unsafe code incorrectly, then it's your bug
 
@Shepmaster But I didn't
that's how pthread_exit is meant to be called
 
6:48 PM
> The pthread_exit() function terminates the calling thread
you terminated the thread that you don't have ownership of
 
@PeterVaro here's an example from one of my projects:
#[derive(Clone, Debug)]
pub(crate) struct RawMatchesBuilder {
    // We want to avoid having two or more matches
    // covering the same spans on both sides,
    // because that would cause "copies" to appear in a diff
    // where there should be `Unchanged` items.
    //
    // We also want to avoid having adjacent matches,
    // because that would cause two consecutive `Unchanged` items
    // to appear in a diff.
    //
    // We can only combine two matches if both sides of the match are "aligned".
(some lines are a bit too long there though...)
 
@FrancisGagné I've liked the idea since I first heard of it, but if emacs doesn't know how to auto-reflow it for me, it's not gonna work for me :-(
 
@Shepmaster the idea is that you don't need to reflow comments written this way
 
you certainly do when you edit the comments
 
yeah but it's limited to joining 2 lines/splitting a line in 2
 
6:51 PM
@FrancisGagné That's interesting.. if that would be in my project it look like this:
 
@Shepmaster I don't feel like that's a valid answer. I may not have ownership of the thread, just terminating it early, like a return statement.
 
#[derive(Clone, Debug)]
pub(crate) struct RawMatchesBuilder
{
    // We want to avoid having two or more matches covering the same spans on
    // both sides, because that would cause "copies" to appear in a diff where
    // there should be `Unchanged` items.
    //
    // We also want to avoid having adjacent matches, because that would cause
    // two consecutive `Unchanged` items to appear in a diff.
    //
    // We can only combine two matches if both sides of the match are "aligned".
    // More formally, we can only combine two matches if the difference between
 
Like, I want to be able to type a paragraph as-is, hit meta-q, then commit
@NebulaFox then use a return statement?
 
@Shepmaster well maybe the problem is just that I'm not using an editor that has a function to reformat paragraphs (I got tired of doing that manually)
 
@FrancisGagné well, I like the semantic comments because it reduces git diff noise
which naive-column-reflow makes annoying
The rough version that I saw originally was basically to add newlines on punctuation.
 
6:54 PM
if this was my project there will not be any comment
 
@Shepmaster That changes the scenario into something else that does compile. The thing I'm pointed out here is that pthread_exit has a return type, which naively though Rust thread would somehow read through pthread_join which doesn't seem to be happening. It then get's a None result which is correct, but it can't handle it.
 
@Stargateur LOL
 
@Shepmaster that's a good start, but it often yields lines longer than 80 characters still
especially if like me you like to write long run-on sentences
 
7:06 PM
@Shepmaster Thinking it through: Rust threads were not designed for pthread_exit. There's no thread::exit(). So no support has gone into pthread_join and pthread_exit parameter of a ptr of the return value.
thanks for rubber ducking XD
 
rubber kirby
 
 
1 hour later…
8:33 PM
(kinda how ! is the bottom type)
part of his problem comes from this impl: impl<T> RangeBounds<T> for RangeFull
if Rust had a top type, this could be written as impl RangeBounds<Top> for RangeFull
but then I'm not sure what would happen with the Q: Hash + Eq + ?Sized bound...
instead of a single top type, Rust could infer some abstract, anonymous type that implements Hash and Eq
but then you get to L: Borrow<Q>...
 

« first day (2058 days earlier)      last day (1438 days later) »