[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1599146371973.png (325 KB, 517x501)
325 KB
325 KB PNG
https://www.youtube.com/watch?v=LguOA6HS1es

it took this homo multiple DAYS to make a fucking text spinner because he insisted on doing it the """modern""" TDD way
and the solution he ended up with was was fucking terrible

this is what i came up with in ~5 minutes
struct Spinner
{
static constexpr char States[]{'-', '\\', '|', '/'};
std::chrono::milliseconds Speed{ std::chrono::milliseconds{500} };

void Update()
{
thread_local auto firstUpdateTime = std::chrono::system_clock::now();
std::cout << States[ ( (std::chrono::system_clock::now() - firstUpdateTime) / Speed ) % sizeof(States) ];
std::cout << std::flush;
std::cout << '\b';
}

void Clear()
{
std::cout << "\b \b";
}
};
Spinner s;
while(true) s.Update();
s.Clear();

made with 0 testing, 0 refactoring, 0 best practices, and most importantly without some gay modal keyboard typing it on a gay floating anime themed terminal window on some sperg meme linux distro.
Yet im the unemployed one.

I fucking hate women for making the world like this.
>>
Now, can you invert a binary tree on a whiteboard?
>>
>>101219894
wtf do women have to do with this??
>>
>>101220001
they wont fucking sleep with me
>>
>>101219894
I think people do homo practices because they do make sense at massive software, but they never reach the level of working in massive software

I remember having to do a retarded assignment report with academic references for simple stuff, it was the most dumbass thing ever but it meant to prepare me in case I do something serious someday

I think the issue is that some people get a degree but never use so larp like this. Would be like doing a work safety course but never getting a job so you start to wear gloves and a helmet to cook your food
>>
>>101220004
maybe stop hating them in the first place
>>
while :; do for s in - \\ \| /; do echo -ne "$s\r"; sleep 0.5; done; done

10 seconds
0 code writen, 0 test
ty gpt
>>
>>101220039
no i tried that already
>>
>NOOO YOU CANT JUST MAKE A SPINNER WITHOUT TESTS!!!???"!#
>HOW DO YOU KNOW AFTER PRECICELY 68454354543.43MS THAT ITS DISPLAYING THE EXACT THE CORRECT FRAME IF YOU DONT TEST IT FIRST?????
>>
File: file.png (347 KB, 521x637)
347 KB
347 KB PNG
>>101220047
tried being an asshole to them, while deep down loving them.
women love mysterious men that act like lone wolfs
>>
>>101220045
What do you mean zero code?
>>
>>101220045
: is a shell builtin true in case anyone is curious.
The echo command itself isn't portable
>>
>>101220423
portable within posix systems, no?
which are the only systems that matter.
>>
>>101220483
NO. Why do you ask stupid shit when you could just run it with a posix shell or go to the spec and see that echo has no flags.
>>
>>101220528
its faster to ask you
>>
>>101219894
I'm sure one of the test he wrote would fail on your code, You probably still show the character when canceling the program or something
>>
>>101220483
behavior varies from shell to shell
printf is the more consistent echo because you handle the formatting yourself
prehistoric shells dont implicitly alias true to : because shell is retarded gorillaniggerware and it took until fish trannies to bring it to a usable state
>>
>>101219894
kek send it to blow.
But seriously the reason software is so bad right now is that we a newbie wants to learn how to do something fairly simple they are greeted with religious channels like this that mindlessly apply dogma to it. Then the newbie thinks that's what programming is, rather than it just being assembly and a high level language that lets you write assembly faster.
https://www.youtube.com/watch?v=1BVXQ64wI00
See uml tictactoe
>>
>>101220546
pretty sure his doesn't handle that either
unless he setup signal handling to run stop() before the program exits

but you can just as well do that with this spinner code
>>
>>101220587
if it works in posix it would be fine, but it doesn't. Nobody in their right mind should care about shells in the current year, but least of all cargonigger shells like fish
>>101220601
pretty sure his doesn't handle that either
https://youtu.be/LguOA6HS1es?t=890
>you can just as well
You didn't realize that until a test pointed it out to you. Tests should be part of your code, not live in your head.
>>
>>101220641
>You didn't realize that until a test pointed it out to you
nigger are you serious?
YES i was aware if you ctrl+c'd the program it wouldn't fucking clear the spinner without having to test it holy fuck lmao
>>
Watching hello world """"programmers"""
>>
>>101220655
>nigger are you serious?
No I was not serious, the information bandwidth between your head and your code is faster than the one from your tests to your head to your code.
tdd should only be done if you need 100% uptime on a website
>>
>>101219894
https://www.youtube.com/watch?v=sGjAe6y299g
>TDDtard has some of the most idiotic opinions imaginable
not surprised



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.