|
correctly remembered that do-while is the loop construct for an indefinite number of loops but at least 1
|
# ? Aug 1, 2024 14:02 |
|
|
# ? Sep 14, 2024 00:55 |
|
I honestly had an absolute hot streak of change tickets slammed through 30 minutes before the cutoff for "normal" changes with rollback written as "it's too complicated, we fix forward" for most of them and the testing evidence all written as "see Jira" knowing perfectly well nobody would ever check it and that the evidence was generally inscrutable to anyone that would look at it one weird trick to make end users happy by increasing delivery speed, change management hate it! now I watch the dev team spend 12 hours to deploy one service component to send emails and somehow gently caress it up such that a) it takes 12 hours jfc how, and b) it keeps sending emails with no content lmao I'm so glad I don't have to manage that, I just get to occasionally lose my poo poo about it and things like "why is there not one single entity relationship or database design diagram for this massive data mode change?"
|
# ? Aug 1, 2024 20:09 |
|
Powerful Two-Hander posted:I'm so glad I don't have to manage that, I just get to occasionally lose my poo poo about it and things like "why is there not one single entity relationship or database design diagram for this massive data mode change?" and doing this is easier than it's ever been, you can just embed mermaid diagrams in tons of stuff now, including readmes, and have github and your ide render them inline. tada, zero effort erd, would you look at that
|
# ? Aug 2, 2024 01:21 |
|
Captain Foo posted:correctly remembered that do-while is the loop construct for an indefinite number of loops but at least 1 i can't remember ever seeing a do-while that made better sense than a similar while
|
# ? Aug 2, 2024 03:04 |
|
I control the execution of my while loops by placing a break statement at the front or end
|
# ? Aug 2, 2024 03:25 |
|
I put a Duff's Device in shipping code (early versions of iChat AV).
|
# ? Aug 2, 2024 06:20 |
|
ryanrs posted:I put a Duff's Device in shipping code (early versions of iChat AV). Dear Lord. Talk about awful programming. Ultrapotassium fucked around with this message at 08:19 on Aug 2, 2024 |
# ? Aug 2, 2024 08:16 |
|
I tried it out just for lols, but it profiled 0.5% faster, so we shipped it.
|
# ? Aug 2, 2024 08:41 |
|
there has on multiple occasions been a duff’s device in the Linux kernel, I’m pretty sure. (possible that they were out-of-tree drivers but I don’t think so)
|
# ? Aug 2, 2024 17:48 |
|
cool av posted:i can't remember ever seeing a do-while that made better sense than a similar while Not my problem lol
|
# ? Aug 2, 2024 18:23 |
|
Captain Foo posted:Not my problem lol he'll yeah its future yous problem
|
# ? Aug 2, 2024 18:42 |
|
i mean it’s literally the correct construct for the use case
|
# ? Aug 2, 2024 20:26 |
|
Captain Foo posted:i mean it’s literally the correct construct for the use case imo any type of loop can be written as any other type if you name & init the variables correctly, the latter being more important cause the compiler is just gonna make a for loop anyway
|
# ? Aug 3, 2024 03:05 |
|
the compiler is just gonna use a goto unless you're on a weird platform with hardware loops
|
# ? Aug 3, 2024 03:37 |
|
Jabor posted:the compiler is just gonna use a goto unless you're on a weird platform with hardware loops i mean like dec+jne is basically a for loop
|
# ? Aug 3, 2024 03:41 |
|
if youre gonna do while just do the thing before the while which immediately terminates based on current state weirdly bad syntactic sugar imo
|
# ? Aug 3, 2024 04:57 |
|
theres prob some assembly related purposeful bad output reason for its existence “our compiled couldnt figure out this only ran once” kinda deal
|
# ? Aug 3, 2024 05:06 |
|
why are you people afraid of do while it's not going to hurt you
|
# ? Aug 3, 2024 05:08 |
|
do while is great in the context of mmio where you know you have at least one input to pull or whatever but the data you read directly affects how many times you have to read next etc
|
# ? Aug 3, 2024 05:11 |
|
The worst thing about do-while is that it needs a semicolon at the end
|
# ? Aug 3, 2024 06:22 |
|
best thing about javascript imo
|
# ? Aug 3, 2024 06:40 |
|
CPColin posted:The worst thing about do-while is that it needs a semicolon at the end but that makes my multiline macros look like function calls
|
# ? Aug 3, 2024 07:34 |
|
yep, very handy when your preprocessor macro needs some local variables
|
# ? Aug 3, 2024 07:38 |
|
I've only ever needed foreach, we can get rid of all the others imo.
|
# ? Aug 3, 2024 08:38 |
|
pokeyman posted:but that makes my multiline macros look like function calls now that's what i call functional programming
|
# ? Aug 3, 2024 09:09 |
|
code:
|
# ? Aug 3, 2024 10:03 |
|
Or if you need to possibly bail early from a block of code and don't have goto:code:
|
# ? Aug 3, 2024 11:51 |
|
a programming structure that you can potentially make an early return from. if only such a thing existed.
|
# ? Aug 3, 2024 12:32 |
|
Sapozhnik posted:a programming structure that you can potentially make an early return from. if only such a thing existed. liskov called and just wanted you to know that they’re very disappointed that you don’t care about ergonomics or performance
|
# ? Aug 3, 2024 12:36 |
|
i honestly can't remember the last time i saw a loop that wasn't a for or foreach
|
# ? Aug 3, 2024 18:37 |
|
Wheany posted:Or if you need to possibly bail early from a block of code and don't have goto: also `do while { } (0)` is the only honourable solution if you want multiple statements within a macro expansion
|
# ? Aug 3, 2024 19:00 |
|
Truman Peyote posted:i honestly can't remember the last time i saw a loop that wasn't a for or foreach While (true) is the flow control of champions
|
# ? Aug 3, 2024 19:08 |
|
i had to write a while loop last week. probably the first one in years.
|
# ? Aug 3, 2024 19:09 |
|
go programmers reading this thread looking very confused
|
# ? Aug 3, 2024 19:11 |
|
I use gotos quite often in C in kernel land. much easier to nail out in multiple parts of a drivers probe function using a goto.
|
# ? Aug 3, 2024 19:12 |
|
Truman Peyote posted:i honestly can't remember the last time i saw a loop that wasn't a for or foreach bro do you even write services in bash comon' son
|
# ? Aug 3, 2024 20:16 |
|
Truman Peyote posted:i honestly can't remember the last time i saw a loop that wasn't a for or foreach Eh, they all have their uses. I use 'for' when I know in advance when the loop will stop and 'while' when .
|
# ? Aug 3, 2024 20:17 |
|
Also while(true) because some rear end in a top hat said we can't just GOTO 10 at the end of our programs
|
# ? Aug 3, 2024 20:35 |
|
instead of while(true) use while(!cancellationToken.IsCancellationRequested)
|
# ? Aug 3, 2024 20:39 |
|
|
# ? Sep 14, 2024 00:55 |
|
no
|
# ? Aug 3, 2024 21:17 |