But only the other hand there is the short-term/local/pre-mature optimization of being fast on the send button with "It broke! Nothing should ever break!"
this is me :(
― 𝔠𝔞𝔢𝔨 (caek), Tuesday, 21 July 2020 16:36 (three years ago) link
Knew it!
― Left Eye Frizzell (James Redd and the Blecchs), Tuesday, 21 July 2020 16:39 (three years ago) link
caek’s link is otm
I am in favor of breaking down functions to component parts when they’re overly long or complex. This is a necessity in code of any length, especially when it makes scope of variables clear and you’re doing a specific manipulation of data that is secondary to the purpose of what you’re writing. You don’t need inline parsing of object A into object B if what you’re actually doing is some sort of calculation.
The primary use of functions is to encapsulate code that could be reused somewhere else. If you can add a few comments and make it clear what you’re doing in the primary function, and you’re not reusing anything, just add comments.
Same for code paths that are going to end up calling all functions — why are all of them separate functions if you call every one of them 90% of the time? You’re just replacing comments with function names, and outside of the context of reading *all* of that code, I have no idea what replaceAllInstances does. Instances of.. the one argument to the function? It’s method signature as comment
― solo scampito (mh), Tuesday, 21 July 2020 18:27 (three years ago) link
Well said.
― Left Eye Frizzell (James Redd and the Blecchs), Tuesday, 21 July 2020 18:37 (three years ago) link
Kevlin Henney to thread
― Left Eye Frizzell (James Redd and the Blecchs), Tuesday, 21 July 2020 18:48 (three years ago) link
World’s Finest Commit Message:Merge remote-tracking branch 'origin/master'
― Time Will Show Leo Weiser (James Redd and the Blecchs), Tuesday, 28 July 2020 14:50 (three years ago) link
smh
― all cats are beautiful (silby), Tuesday, 28 July 2020 15:31 (three years ago) link
SMH CARD
― Time Will Show Leo Weiser (James Redd and the Blecchs), Tuesday, 28 July 2020 15:41 (three years ago) link
https://www.youtube.com/watch?v=X23v5_K7cXk
― Time Will Show Leo Weiser (James Redd and the Blecchs), Tuesday, 28 July 2020 18:29 (three years ago) link
speaking of commit messages
https://www.twitter.com/gitlost
― like, I’m eating an elephant head (katherine), Tuesday, 28 July 2020 19:06 (three years ago) link
lol
― shout-out to his family (DJP), Tuesday, 28 July 2020 19:08 (three years ago) link
always happy to see that account again
― all cats are beautiful (silby), Tuesday, 28 July 2020 20:08 (three years ago) link
this component test, two of the 'expected' fields are actually a comma separated list of additional tests and a parallel comma-separated list of the expected values for these tests.
― koogs, Friday, 31 July 2020 12:34 (three years ago) link
Defensive Programming: C/D
― Isinglass Ponys (James Redd and the Blecchs), Monday, 24 August 2020 15:36 (three years ago) link
Depends what it is… but I’d rather have good tests which catch any failures in most cases I would say.
― Chewshabadoo, Monday, 24 August 2020 16:26 (three years ago) link
iirc Go tries to push defensive programming as a defaultiirc the main point of defensive programming is handle all the error conditions *first* then the code does what it’s supposed toit’s smart imo, because happy path programming is terrible
― solo scampito (mh), Monday, 24 August 2020 17:32 (three years ago) link
worst mess up we've had here recently, one that made the papers, was component C relying on previous component B for validation only to then add component A as an input path and component A didn't bother.
― koogs, Monday, 24 August 2020 18:51 (three years ago) link
in short: trustno1
― koogs, Monday, 24 August 2020 18:57 (three years ago) link
Innocuous irrational anger: typos in method/var names that don't get fix and propagate throughout the system wherever the thing is called - check_intant_update_user_permission
― neith moon (ledge), Tuesday, 25 August 2020 10:31 (three years ago) link
intant_update_user_permission = False...return intant_update_user_permission
how can you even c+p all that without noticing?
― neith moon (ledge), Tuesday, 25 August 2020 10:33 (three years ago) link
intant_karma.Said(“Knock You Out”)
― Isinglass Ponys (James Redd and the Blecchs), Tuesday, 25 August 2020 10:57 (three years ago) link
hey my display name is relevant
― assert (MatthewK), Tuesday, 25 August 2020 11:14 (three years ago) link
> don't get fix
you never fix
― koogs, Tuesday, 25 August 2020 11:38 (three years ago) link
who is screaming FIX at my code. i will never fix.
― neith moon (ledge), Tuesday, 25 August 2020 12:45 (three years ago) link
OMG we have a column in our DB called loyality_discount.
― Ruth Bae Ginsburg (Leee), Tuesday, 25 August 2020 16:33 (three years ago) link
that’s right
― solo scampito (mh), Tuesday, 25 August 2020 16:42 (three years ago) link
I think about this Reddit thread a lot pic.twitter.com/w2QxYJ2kx6— Sy Brand (@TartanLlama) August 20, 2020
― koogs, Thursday, 27 August 2020 11:03 (three years ago) link
when that thread was making the rounds I did a lot of mumbling “oh no”
― solo scampito (mh), Thursday, 27 August 2020 13:23 (three years ago) link
i've only seen that one comment but a) wow at the inventiveness of people and b) fuck the inventiveness of people
you can use unicode letters (not punctuation) in java for variable names and i can see delta being useful for all the animations i write but fuck learning how to type it.
also, i think java 9 stopped the use of a single _ as a variable name, but two or more is fine.
― koogs, Thursday, 27 August 2020 13:41 (three years ago) link
the comments thing has come to a head again after they refused to approve a pull request because of comments and *whitespace* in a component test! apparently the blank lines made him think it was a new Scenario even given the indentation.
so now we have a team meeting about it, but it'll be the usual steam-rollering, the alpha programmer forcing his views on everybody by dint of talking the most.
― koogs, Tuesday, 10 November 2020 12:58 (three years ago) link
*sigh*
― An Andalusian Do-rag (James Redd and the Blecchs), Tuesday, 10 November 2020 13:56 (three years ago) link
hopefully sanity prevailed. at least pretty much everybody thought that not approving changes because of comments was unreasonable.
― koogs, Tuesday, 10 November 2020 15:16 (three years ago) link
That's a good sign!
― DJP, Tuesday, 10 November 2020 15:18 (three years ago) link
I hope I never again have to work anywhere that doesn’t have strict autoformatting procedures in place.
― Chewshabadoo, Tuesday, 10 November 2020 15:54 (three years ago) link
even though i have very strong formatting preferences, i've found the best way to deal with the issue is to use an opinionated, non-configurable formatter as part of the build process. that way, everyone dislikes the formatting equally
― diamonddave85​​ (diamonddave85), Tuesday, 10 November 2020 17:19 (three years ago) link
We have flake8 for our Python stuff but not black, autoformatting would make me cwazy
― The Bosom Manor Michaelmas Special (silby), Tuesday, 10 November 2020 17:25 (three years ago) link
my preferences > autoformatters > everyone else's preferences
― 𝔠𝔞𝔢𝔨 (caek), Tuesday, 10 November 2020 17:25 (three years ago) link
i absolutely loathe black, but it's still better than the alternative on a shared repo, so i've learned to live with it.
― 𝔠𝔞𝔢𝔨 (caek), Tuesday, 10 November 2020 17:26 (three years ago) link
is there a thread for just like general CS news and stuff? this seems pretty cool:
https://www.quantamagazine.org/computer-scientists-achieve-crown-jewel-of-cryptography-20201110/
― brimstead, Tuesday, 10 November 2020 19:41 (three years ago) link
― An Andalusian Do-rag (James Redd and the Blecchs), Tuesday, 10 November 2020 20:51 (three years ago) link
cool link, brimstead!
― DJI, Tuesday, 10 November 2020 21:08 (three years ago) link
Haha, yep, in our front-end JavaScript codebase Prettier is a godsend for being almost totally unconfigurable.
― Chewshabadoo, Wednesday, 11 November 2020 11:53 (three years ago) link
generate 84 filescommit to githubupload to server
repeat 40 times, changing one word each time.
(i have replaced step one with a sed script rather than manually editing the files but still...)
― koogs, Thursday, 11 March 2021 20:22 (three years ago) link
Why is programming language documentation so terrible? I mean, look at this shit:
https://www.cplusplus.com/reference/functional/function/
std::functionClass that can wrap any kind of callable element (such as functions and function objects) into a copyable object, and whose type depends solely on its call signature (and not on the callable element type itself). An object of a function class instantiation can wrap any of the following kinds of callable objects: a function, a function pointer, a pointer to member, or any kind of function object (i.e., an object whose class defines operator(), including closures). A decay copy of the wrapped callable object is stored internally by the object, which becomes the function's target. The specific type of this target callable object is not needed in order to instantiate the function wrapper class; only its call signature. The function object can be copied and moved around, and can be used to directly invoke the callable object with the specified call signature (see member operator()). function objects can also be in a state with no target callable object. In this case they are known as empty functions, and calling them throws a bad_function_call exception.
Class that can wrap any kind of callable element (such as functions and function objects) into a copyable object, and whose type depends solely on its call signature (and not on the callable element type itself). An object of a function class instantiation can wrap any of the following kinds of callable objects: a function, a function pointer, a pointer to member, or any kind of function object (i.e., an object whose class defines operator(), including closures). A decay copy of the wrapped callable object is stored internally by the object, which becomes the function's target. The specific type of this target callable object is not needed in order to instantiate the function wrapper class; only its call signature. The function object can be copied and moved around, and can be used to directly invoke the callable object with the specified call signature (see member operator()). function objects can also be in a state with no target callable object. In this case they are known as empty functions, and calling them throws a bad_function_call exception.
Not only is this incredibly complex for the novice reader to understand, but you will notice at no point in the entire article does it mention why you would ever want to use this or what problem does it solve.
― Mr. Snrub, Sunday, 21 March 2021 21:49 (three years ago) link
I’m not going to defend that as a model of clear technical writing but that’s an api reference not a tutorial document.
― 𝔠𝔞𝔢𝔨 (caek), Sunday, 21 March 2021 21:56 (three years ago) link
not that this is in any way more clear, but cppreference.com is the site you want for non-spammy c++ documentation: https://en.cppreference.com/w/cpp/utility/functional/function
― diamonddave85​​ (diamonddave85), Sunday, 21 March 2021 23:03 (three years ago) link
I do like the “Run this code” functionality so you can try it out yourself.
― Mr. Snrub, Sunday, 21 March 2021 23:35 (three years ago) link
Novices should probably not be learning C++
― o. nate, Sunday, 21 March 2021 23:40 (three years ago) link
I think c++ is probably not the reference point for this moment in programming education but as caek said, it’s the reference guide and not a learning onepretty sure there are a few learning documents, books, guides, etc for this language but who can be sure
― mh, Monday, 22 March 2021 04:29 (three years ago) link
I do appreciate the literal nature of “I want to do c++” and literally going to cplusplus.com though
― mh, Monday, 22 March 2021 04:30 (three years ago) link