|
TooMuchAbstraction posted:When you think about it, the real horror is trusting computers with anything important, considering how often we find software to be such a shitshow. Computers and people too.
|
# ? Aug 22, 2017 20:12 |
|
|
# ? Jun 5, 2024 05:53 |
|
TooMuchAbstraction posted:When you think about it, the real horror is trusting computers with anything important, considering how often we find software to be such a shitshow. Can't wait for smart contracts!
|
# ? Aug 22, 2017 21:03 |
|
32-byte bytes for all
|
# ? Aug 22, 2017 21:05 |
|
QuarkJets posted:Can't wait for smart contracts! Have you heard the word of the blockchain, my dude?
|
# ? Aug 22, 2017 21:09 |
|
TooMuchAbstraction posted:When you think about it, the real horror is trusting computers with anything important, considering how often we find software to be such a shitshow. I agree. Working in tech and writing software makes me trust this stuff less, not more, because I know how janky it probably all is under the hood. I probably have some built-in luddite tendencies as well - my co-workers all talk about the latest IoT stuff they’ve installed in their house, but I still set the temperature by hand on my Honeywell thermostat and buy paper bus tickets. I’m sure eventually I’ll add some sort of home automation stuff or a Nest or whatever, but the threshold at which I will consider such things is pretty high.
|
# ? Aug 22, 2017 21:19 |
|
chutwig posted:I agree. Working in tech and writing software makes me trust this stuff less, not more, because I know how janky it probably all is under the hood. I probably have some built-in luddite tendencies as well - my co-workers all talk about the latest IoT stuff they’ve installed in their house, but I still set the temperature by hand on my Honeywell thermostat and buy paper bus tickets. I’m sure eventually I’ll add some sort of home automation stuff or a Nest or whatever, but the threshold at which I will consider such things is pretty high. This, when I think of all the libraries that are in use by companies that just want to make money and don't give a gently caress about the software........
|
# ? Aug 22, 2017 21:51 |
|
QuarkJets posted:Can't wait for smart contracts! Hey, don't diss smart contracts. Name another software that comes with automatic built-in bug bounties
|
# ? Aug 22, 2017 22:09 |
|
Hammerite posted:How do you respond to the discussion on this page? The way I see it, interactions in a highly connected timezoneless world depend on the recipient's presence most of all. It is up to Uncle Joe to set his phone to silent mode if he does not wish to receive calls. He can choose his own presence and live on the schedule he likes, synchronizing it with people only when getting real-time contact it matters to him (hey bro call me between 0800 and 0900 - and nobody cares where the sun is), leaving it for his technological servants to deal with otherwise.
|
# ? Aug 23, 2017 08:01 |
|
Master_Odin posted:Well, for me, I personally hate functions that both mutate their parameters and returns a status flag on completion, especially since this is within a class where you could save data to a class variable. I'd also probably just put all three functions into a try/catch since the point was to quit on error (which shouldn't happen almost ever in production). If you want to nip this in the bud, I have a slightly less egregious pattern to suggest for "bail-out" chaining: code:
Ranzear fucked around with this message at 19:06 on Aug 23, 2017 |
# ? Aug 23, 2017 19:04 |
|
Master_Odin posted:Well, for me, I personally hate functions that both mutate their parameters and returns a status flag on completion, especially since this is within a class where you could save data to a class variable. I'd also probably just put all three functions into a try/catch since the point was to quit on error (which shouldn't happen almost ever in production). Ranzear posted:If you want to nip this in the bud, I have a slightly less egregious pattern to suggest for "bail-out" chaining: Gazpacho fucked around with this message at 19:29 on Aug 23, 2017 |
# ? Aug 23, 2017 19:27 |
|
Gazpacho posted:Just use a goto already, you know you want to. Back when I wrote my first PHP login script, you wouldn't have been wrong. Real solution is more like: code:
|
# ? Aug 23, 2017 19:49 |
|
I'm maintaining Ruby code that uses continuations. My advice is to never use continuations. Particularly when the language barely supports them. What happens when you throw an exception in the middle of your continuation? Who knows, we're just gonna do it and be legends.
|
# ? Aug 23, 2017 22:19 |
|
Gazpacho posted:Just use a goto already, you know you want to. Proposition - of the very few cases where "goto" is an acceptable tool for the job, all are cases where the label is (a) within the same method, (b) in the same scope as the "goto" or in a parent scope, (c) "forwards" within the method (i.e. to a later line)*. Goto implementations should therefore ideally be restricted to work in this way. I'd be interested to see counterexamples (and I realise that the status of a volunteered use case as a counterexample is dependent on my inclination to view said use case as one where goto is "an acceptable tool for the job" and that this description is very vague and subjective) * It follows that goto plus conditional statements would not be sufficient to allow looping, in the absence of loop control structures or recursion
|
# ? Aug 24, 2017 09:38 |
|
Ranzear posted:If you want to nip this in the bud, I have a slightly less egregious pattern to suggest for "bail-out" chaining: A do while loop? You MONSTER.
|
# ? Aug 24, 2017 10:56 |
|
I think a counter example is the odd method you might think is most naturally representable with tail recursion. But since your language doesn't have tail recursion you have a goto to the top of the function. Another might be, I don't know, if you really really wanted to have two entry points into a loop. I have a vague categorical notion that I wanted this once, but I forget why. Another might be to skip a conditional check you know will be true in the future. You could control flow right into it, but hey, performance. So you jump right into the nested scope. I've had occasion to say, hey, I could do that, but I've never really needed it or done it. Another example is where you reach a point in your computation that the right thing to do is to "retry." Well, that might not be best represented as a loop for some reason. I've never seen a solitary goto statement make a function more confusing.
|
# ? Aug 24, 2017 11:19 |
|
Not really a horror, but this site is quite something. https://sidewaysdictionary.com/
|
# ? Aug 24, 2017 14:42 |
|
Carbon dioxide posted:Not really a horror, but this site is quite something. Autocomplete posted:It’s like every bar in the world is your local. You go to order a drink, the staff make a lightning quick judgment based on your location, the most popular orders at that time of day, and the shape your mouth is forming as you begin to speak. Before you know it, a margarita awaits. The bar in this case is a search bar.
|
# ? Aug 24, 2017 14:48 |
|
Cybercrime posted:It’s like the law of the horse. In the early days of the internet, a US judge argued against the idea of a separate field of ‘cyberlaw’ by comparing it to laws for horses. There are many crimes that involve horses, just as there are many that involve computers, but ‘horse law’ isn’t a separate field in its own right – which is a shame, as it sounds like fun.
|
# ? Aug 24, 2017 15:22 |
|
Posted verbatim:C# code:
|
# ? Aug 24, 2017 16:12 |
|
I'm the coding horror because after a long slippery slope of preferring infinite loops with explicit if(...)break; over regular loops if the latter would involve the slightest extra contortion, I'm increasingly catching myself wishing for local jumps in high-level langs and thinking about how many extra control vars I could elide if I my code just consisted of a mostly unstructured set of blocks connected by arbitrary control flow edges.
|
# ? Aug 24, 2017 16:23 |
|
Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell!
|
# ? Aug 24, 2017 16:45 |
|
CPColin posted:Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell! Congrats, you're now the code quality champion. Have fun convincing everyone else they're doing it wrong.
|
# ? Aug 24, 2017 16:47 |
|
CPColin posted:Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell! Same, except I was about 9 hours into my job.
|
# ? Aug 24, 2017 16:52 |
|
ratbert90 posted:A do while loop? You MONSTER. "slightly less egregious" Nobody noticed I put 'while(true)' instead of 'while(false)' though, even myself Vanadium posted:I'm increasingly catching myself wishing for local jumps in high-level langs and thinking about how many extra control vars I could elide if I my code just consisted of a mostly unstructured set of blocks connected by arbitrary control flow edges. I'm concerned that you phrase it this way instead of 'I should put things in functions and call them from a main flow control.' Ranzear fucked around with this message at 00:15 on Aug 25, 2017 |
# ? Aug 24, 2017 17:50 |
|
ChaosArgate posted:Same, except I was about 9 hours into my job. I guess everybody's first, second, third, fourth, or current job is like that.
|
# ? Aug 24, 2017 18:45 |
|
CPColin posted:Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell! Best part is when you discover that one code path is just impossible to reach. Second best part is when you tell your boss about it, and he says, "That's a pretty important piece of functionality. Weird!"
|
# ? Aug 24, 2017 19:16 |
|
CPColin posted:Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell! It took you 2.5 weeks to even see some code? That might actually be more concerning
|
# ? Aug 24, 2017 23:29 |
|
Steve French posted:It took you 2.5 weeks to even see some code? Weird clearances aside, yeah that's super concerning if you're expected to code.
|
# ? Aug 24, 2017 23:32 |
|
I so want to see that utility class
|
# ? Aug 24, 2017 23:34 |
|
People keep being on vacations and we had a week of Scrum training that we promptly took to heart. For example: we just started a three-week sprint by having a three-hour sprint planning meeting that started with an hour of backlog refinement, because the PO hadn't done any of that yet.
|
# ? Aug 25, 2017 00:05 |
|
Vanadium posted:I'm the coding horror because after a long slippery slope of preferring infinite loops with explicit if(...)break; over regular loops if the latter would involve the slightest extra contortion, I'm increasingly catching myself wishing for local jumps in high-level langs and thinking about how many extra control vars I could elide if I my code just consisted of a mostly unstructured set of blocks connected by arbitrary control flow edges. Sounds like you want a finite state machine tbh.
|
# ? Aug 25, 2017 08:19 |
|
CPColin posted:People keep being on vacations and we had a week of Scrum training that we promptly took to heart. For example: we just started a three-week sprint by having a three-hour sprint planning meeting that started with an hour of backlog refinement, because the PO hadn't done any of that yet. Sounds like my experience with most shops that do "agile". Current place will occasionally cancel planning meetings the day of because the PO is OOO as well.
|
# ? Aug 25, 2017 10:17 |
|
CPColin posted:Something like 2.5 weeks into my new job, I got my first look at a small bit of the code. It's a utility class that's 2,077 lines long and has an 818-line method in it that's one giant switch statement. There's also a bunch of stuff that was clearly copied and pasted. Good target for refactoring, right? Well, too bad, because there's no test coverage, as far as I can tell!
|
# ? Aug 25, 2017 11:40 |
|
SupSuper posted:I haven't experienced a workplace with tests yet. Write them yourself.
|
# ? Aug 25, 2017 14:45 |
|
In a method annotated [Test] that is not an actual automated test, but rather is run by hand as part of manual testing:code:
Edit: There's an empty catch block in another one of these "tests," so it always "passes."
|
# ? Aug 25, 2017 16:29 |
|
SupSuper posted:I haven't experienced a workplace with tests yet. I just got my entire group to start writing unit tests. We were stuck in a catch-22 of crushing piles of work to do, but a lot of it was fixing bugs that made it into production. The general attitude was "we dont have time to write tests" but anyone who's actually written tests knows it saves time in the end. So, I just started writing tests. My code was then the most bug-free code. People noticed and wanted the same thing, and there you have it. It was like a sea-change in everyone's perception of how to write code. Everyone is gung-ho about reducing the number of dependencies, writing testable code instead of monolithic monstrocities, taking pride in how many tests they write. It's honestly amazing and you just have to make it happen yourself sometimes.
|
# ? Aug 25, 2017 18:45 |
|
"Be the change you wish to see in the world." -Gandhi
|
# ? Aug 25, 2017 19:26 |
|
porksmash posted:I just got my entire group to start writing unit tests. We were stuck in a catch-22 of crushing piles of work to do, but a lot of it was fixing bugs that made it into production. The general attitude was "we dont have time to write tests" but anyone who's actually written tests knows it saves time in the end. So, I just started writing tests. My code was then the most bug-free code. People noticed and wanted the same thing, and there you have it. Are you just writing tests, or going full TDD?
|
# ? Aug 25, 2017 19:51 |
|
Bongo Bill posted:Are you just writing tests, or going full TDD? TDD is the same thing as writing testable code, and then writing tests for that code. Whether you write the tests before the code or the other way around, the important thing is that you write the code with testing in mind.
|
# ? Aug 25, 2017 19:59 |
|
|
# ? Jun 5, 2024 05:53 |
|
TooMuchAbstraction posted:TDD is the same thing as writing testable code, and then writing tests for that code. Whether you write the tests before the code or the other way around, the important thing is that you write the code with testing in mind. I don't agree with the definition of the term. Writing the tests first is an important part of the practice as I understand it. There are other parts, too.
|
# ? Aug 25, 2017 20:51 |