|
|
# ? Oct 2, 2015 19:20 |
|
|
# ? Jun 8, 2024 14:41 |
|
Necc0 posted:BRACKET ALL IF STATEMENTS YOU loving COWBOY CODERS gently caress gently caress FHDUOFDGF all man style, hard tabs only
|
# ? Oct 2, 2015 19:21 |
|
Shaggar posted:all man style, hard tabs only hey the 80s called they want their limited hard drive capacity back
|
# ? Oct 2, 2015 19:29 |
|
allman is good tho
|
# ? Oct 2, 2015 19:29 |
|
Shaggar posted:all man style, hard tabs only
|
# ? Oct 2, 2015 19:40 |
|
|
# ? Oct 2, 2015 19:47 |
|
Necc0 posted:BRACKET ALL IF STATEMENTS YOU loving COWBOY CODERS gently caress gently caress FHDUOFDGF a. ITYM "braces". [] are brackets, {} are braces b. you don't need actually need the braces if the thing inside the if is only one line. that way you can save a little bit of space and it looks nicer
|
# ? Oct 2, 2015 19:53 |
|
Tiny Bug Child posted:a. ITYM "braces". [] are brackets, {} are braces okay man, i've stood with you every time you've defended php, or at least i have loléd on the sidelines at your wicked ownages but you've gone too far now, man.
|
# ? Oct 2, 2015 20:13 |
|
Necc0 posted:BRACKET ALL IF STATEMENTS YOU loving COWBOY CODERS gently caress gently caress FHDUOFDGF
|
# ? Oct 2, 2015 20:25 |
|
Tiny Bug Child posted:a. ITYM "braces". [] are brackets, {} are braces in england they call parentheses brackets Tiny Bug Child posted:b. you don't need actually need the braces if the thing inside the if is only one line. that way you can save a little bit of space and it looks nicer i used to think you were cool
|
# ? Oct 2, 2015 20:26 |
|
pls come 2 the all man's hard tabs club thread if u feel that way, which is the superior one. also i agree that if statements need braces. it is a true sign of a distinguished gentleman.
|
# ? Oct 2, 2015 20:27 |
|
triple sulk posted:pls come 2 the all man's hard tabs club thread if u feel that way, which is the superior one. how do you make "less" show tabs as four spaces instead of eight?
|
# ? Oct 2, 2015 20:31 |
|
Wheany posted:okay man, i've stood with you every time you've defended php, or at least i have loléd on the sidelines at your wicked ownages so i have this new intern who's always asking me questions and trying to learn from me and stuff. also, today is our company "free tech day" where the tech crew gets to dick around with something cool as long as it has some possible business benefit or you learn something (i'm brushing up on R) one of the PMs was like hey i'm gonna teach myself a bit of coding what should i learn. one of the dudes who was over here from the foreign office was like, oh try python, it's pretty easy for a beginner and it'll teach you good coding habits. the new intern, without any prompting from me, immediately said "oh that's not true you can write bad code in any language and PHP is actually really good now days" i've taught him so well
|
# ? Oct 2, 2015 20:39 |
|
VikingofRock posted:Hell yeah, this sounds awesome. Is there any chance you could post the source somewhere? I'd love to read through it. I'll spare you, honestly. it's pre-C++11 code and I didn't make it fully generic, like T can't be a reference type for example (this reminds me I started writing a specialization for Optional<void> but realized that's just an overengineered bool). also I didn't bother with the trick where instead of operator bool you implement operator <member pointer>, which converts explicitly to bool but not implicitly (in C++11 you'd just use explicit operator bool). it's just not publishable material I'll share one of its building blocks, Lazy<T>, to give you an idea of how terrible pre-C++11 is that it is even necessary. I originally wrote it to statically allocate singletons without running their constructors until first use (... in C++11 you'd just use a local static variable ), but then it proved useful to implement Optional<T> and discriminated unions (because in pre-C++11 - - you can't have union members with non-trivial constructors, ever), which are the basis of ValueOrError<T> C++ code:
VikingofRock posted:Jesus, why do they need so many header files? because old C++ compilers, old C++ versions, etc. VikingofRock posted:Personally I think the worst part about boost::optional is its implicit conversion to bool, which makes optional<anything_that_is_also_convertible_to_bool> a bad idea. my Optional<T> has implicit conversion to bool too, because you can then use a handle-like pattern like this: C++ code:
VikingofRock posted:In the past it has caused me some bugs like this. or maybe the worst is that int has a conversion to bool, hmmm! Slurps Mad Rips posted:The implicit bool conversion is super stupid and I'm glad we have explicit operator bool which is only implicit in a boolean context boost::optional is actually explicitly convertible to bool, because its operator bool actually is operator somepointertomember, which doesn't implicitly convert to anything, not just bool
|
# ? Oct 2, 2015 20:54 |
|
Tiny Bug Child posted:b. you don't need actually need the braces if the thing inside the if is only one line. that way you can save a little bit of space and it looks nicer
|
# ? Oct 2, 2015 20:56 |
|
Tiny Bug Child posted:so i have this new intern who's always asking me questions and trying to learn from me and stuff. also, today is our company "free tech day" where the tech crew gets to dick around with something cool as long as it has some possible business benefit or you learn something (i'm brushing up on R) securing the tbc dynasty
|
# ? Oct 2, 2015 21:12 |
|
hackbunny posted:
as I mentioned, this doesn't work if T is a reference. it completely breaks because you can't make a pointer to a reference (reference to reference collapses to just reference though). so we can cheat and store a pointer instead. let's specialize for Lazy<T&> then: C++ code:
e: oh yeah, I should use SFINAE to make construct<U> disappear if U* isn't implicitly convertible to pointer_type, but e: whoopsie, copy-paste embarrassment hackbunny fucked around with this message at 21:28 on Oct 2, 2015 |
# ? Oct 2, 2015 21:22 |
|
If you aren't forced to work with legacy tools, you can use std::experimental::optional I think there's a standard variant type on the way too.
|
# ? Oct 2, 2015 21:25 |
|
prefect posted:how do you make "less" show tabs as four spaces instead of eight? i think it's "less -x4" hth, my friend. god bless
|
# ? Oct 2, 2015 21:37 |
hackbunny posted:Optional code This is pretty neat. Now I'm tempted to go write my own Result/Either type for use in error handling...
|
|
# ? Oct 2, 2015 22:15 |
|
compuserved posted:i think it's "less -x4" oh my god i never even thought to look for this i think i love you
|
# ? Oct 2, 2015 22:55 |
The hardest part about learning the command line is figuring out that the tools/options you want already exist instead of constantly reinventing the wheel with grep/awk/sed. I've been using the command line fairly heavily for ~6 years now (maybe more) and somehow I only recently found out about column and comm. My next goal is to figure out how to print all the lines in one file that are not present in another file, which I'm sure is similarly easy but I haven't had time to look into it yet.
|
|
# ? Oct 2, 2015 23:20 |
|
Ralith posted:I think there's a standard variant type on the way too.
|
# ? Oct 2, 2015 23:21 |
|
VikingofRock posted:My next goal is to figure out how to print all the lines in one file that are not present in another file, which I'm sure is similarly easy but I haven't had time to look into it yet. snack exchange: Is there a tool to get the lines in one file that are not in another?
|
# ? Oct 3, 2015 02:15 |
|
compuserved posted:snack exchange: Is there a tool to get the lines in one file that are not in another? holy poo poo @ those people writing awk scripts and crazy poo poo just use comm you morons
|
# ? Oct 3, 2015 02:19 |
|
compuserved posted:snack exchange: Is there a tool to get the lines in one file that are not in another?
|
# ? Oct 3, 2015 03:05 |
|
Sweeper posted:holy poo poo @ those people writing awk scripts and crazy poo poo even after like 15 years of being a linux nerd there's weird poo poo in coreutils that i've never heard of before today
|
# ? Oct 3, 2015 03:07 |
|
https://en.m.wikipedia.org/wiki/GNU_Core_Utilities
|
# ? Oct 3, 2015 03:09 |
|
Shaggar posted:all man style, hard tabs only idgaf about tabs vs spaces but woe betide you if you don't use allman style
|
# ? Oct 3, 2015 04:22 |
|
have you tried using a linter program to enforce bracing allowing programmers to choose their own indentation and block formatting has only caused the worst form of bikeshedding
|
# ? Oct 3, 2015 05:40 |
|
comedyblissoption posted:have you tried using a linter program to enforce bracing how do you enforce using a linter for bracing without a really long bikeshedding discussion about bracing
|
# ? Oct 3, 2015 07:53 |
Sweeper posted:holy poo poo @ those people writing awk scripts and crazy poo poo Yeah that's exactly what I was talking about! All these people are trying to use complicated awk scripts / uncommon grep options, but the answer is apparently just comm -23. My guess is that most of these people don't know that comm exists (or like me they never bothered to read the comm man page), hence the workarounds.
|
|
# ? Oct 3, 2015 08:08 |
|
VikingofRock posted:Yeah that's exactly what I was talking about! All these people are trying to use complicated awk scripts / uncommon grep options, but the answer is apparently just comm -23. My guess is that most of these people don't know that comm exists (or like me they never bothered to read the comm man page), hence the workarounds. i didnt know about comm before this thread. the name sounds totally like a networkign thing.
|
# ? Oct 3, 2015 09:22 |
|
if{ check$ !
|
# ? Oct 3, 2015 11:03 |
|
MALE SHOEGAZE posted:how do you enforce using a linter for bracing without a really long bikeshedding discussion about bracing "i have picked this, does anybody have a super strong objection? <some people whine, but most people don't give a poo poo> looks like we've got a quorum. okay, now let's talk about commit hooks" - a thing a good lead does
|
# ? Oct 3, 2015 12:01 |
|
i will fire anybody who fucks up the indentation or brace style no warning, out the door.
|
# ? Oct 3, 2015 12:09 |
|
same, except those commits get rejected by the linter
|
# ? Oct 3, 2015 12:16 |
|
Snapchat A Titty posted:i will fire anybody who fucks up the indentation or brace style im glad i live in a civilised country where this kind of thing would be illegal as gently caress
|
# ? Oct 3, 2015 12:16 |
|
I'm glad I live in a civilized country without mass youth unemployment.
|
# ? Oct 3, 2015 12:45 |
|
|
# ? Jun 8, 2024 14:41 |
|
Soricidus posted:im glad i live in a civilised country where this kind of thing would be illegal as gently caress you get 3+ months pay as per the law but youre done. you didnt abide by the terms, literally the only terms.
|
# ? Oct 3, 2015 12:54 |