Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "daily byte"
-
Manager: What the heck are you guys doing? Pair programming?! That would halve the team productivity!!!
We:
Manager: Alright, Let's do a "quick" four hours meeting. Everyone in the company MUST attend!
We:3 -
While we're talking about Microsoft and GitHub.
This is what people dealing with billions of dollars on daily basis look like. The awkward looking guy just fucked millions of developers all over the world so he's a byte uncomfortable about all this.11 -
React or Angular?
Vim or Emacs?
Tabs or Spaces?
.....
I'm fed up with these questions :(
Whatever is suitable for your job or whichever is comfortable for you, go with that...16 -
We don't like someone correcting our grammar...
But we would be so grateful if someone corrects our code :)3 -
I'm delirious so here's your daily dose of fuck:
```fasm
; --- * --- * ---
; 64-bit byte-by-byte mash
macro clamp_u8 {
mov cl,$08;
mov rdx,rax;
rept 8 \{
rol rdx,cl;
xor al,dl;
\};
};
; --- * --- * ---
; give 8-bit random seed
macro prng_u8 {
rdtsc;
shl rdx,32;
or rax,rdx;
clamp_u8;
};
; --- * --- * ---
; roll dice
d20: prng_u8;
; x%20, according to gcc ;>
mov edi,eax;
mov eax,-51;
mul dil;
shr ax,12;
lea eax,[rax+rax*4];
lea edx,[0+rax*4];
mov eax,edi;
sub eax,edx;
; discard high and give
and rax,$FF;
ret;
```
I guess `d20` could be inlined too but I thought it'd be too much.
Is it faster than straight C? Probably not. But it's way lighter, so it loads faster. Below five hundred bytes mother fucker.
Now if you'll excuse me, I'll go sit in the darkness repeteadly typing roll 1d20 on the terminal. For reasons.9 -
I really hate PHP frameworks.
I also often write my own frameworks but propriety. I have two decades experience doing without frameworks, writing frameworks and using frameworks.
Virtually every PHP framework I've ever used has causes more headaches than if I had simply written the code.
Let me give you an example. I want a tinyint in my database.
> Unknown column type "tinyint" requested.
Oh, doctrine doesn't support it and wont fix. Doctrine is a library that takes a perfectly good feature rich powerful enough database system and nerfs it to the capabilities of mysql 1.0.0 for portability and because the devs don't actually have the time to create a full ORM library. Sadly it's also the defacto for certain filthy disgusting frameworks whose name I shan't speak.
So I add my own type class. Annoying but what can you do.
I have to try to use it and to do so I have to register it in two places like this (pseudo)...
Types::add(Tinyint::class);
Doctrine::add(Tinyint::class);
Seems simply enough so I run it and see...
> Type tinyint already exists.
So I assume it's doing some magic loading it based on the directory and commend out the Type::add line to see.
> Type to be overwritten tinyint does not exist.
Are you fucking kidding me?
At this point I figure out it must be running twice. It's booting twice. Do I get a stack trace by default from a CLI command? Of course not because who would ever need that?
I take a quick look at parent::boot(). HttpKernel is the standard for Cli Commands?
I notice it has state, uses a protected booted property but I'm curious why it tries to boot so many times. I assume it's user error.
After some fiddling around I get a stack trace but only one boot. How is it possible?
It's not user error, the program flow of the framework is just sub par and it just calls boot all over the place.
I use the state variable and I have to do it in a weird way...
> $booted = $this->booted;parent::boot();if (!$booted) {doStuffOnceThatDependsOnParentBootage();}
A bit awkward but not life and death. I could probably just return but believe or not the parent is doing some crap if already booted. A common ugly practice but one that works is to usually call doSomething and have something only work around the state.
The thing is, doctrine does use TINYINT for bool and it gets all super confused now running commands like updates. It keeps trying to push changes when nothing changed. I'm building my own schema differential system for another project and it doesn't have these problems out of the box. It's not clever enough to handle ambiguous reverse mappings when single types are defined and it should be possible to match the right one or heck both are fine in this case. I'd expect ambiguity to be a problem with reverse engineer, not compare schema to an exact schema.
This is numpty country. Changing TINYINT UNSIGNED to TINYINT UNSIGNED. IT can't even compare two before and after strings.
There's a few other boots I could use but who cares. The internet seems to want to use that boot function. There's also init stages missing. Believe it or not there's a shutdown and reboot for the kernel. It might not be obvious but the Type::add line wants to go not in the boot method but in the top level scope along with the class definition. The top level scope is run only once.
I think people using OOP frameworks forget that there's a scope outside of the object in PHP. It's not ideal but does the trick given the functionality is confined to static only. The register command appears to have it's own check and noop or simply overwrite if the command is issued twice making things more confusing as it was working with register type before to merely alias a type to an existing type so that it could detect it from SQL when reverse engineering.
I start to wonder if I should just use columnDefinition.
It's this. Constantly on a daily basis using these pretentious stuck up frameworks and libraries.
It's not just the palava which in this case is relatively mild compared to some of the headaches that arise. It's that if you use a framework you expect basic things out of the box like oh I don't know support for the byte/char/tinyint/int8 type and a differential command that's able to compare two strings to see if they're different.
Some people might say you're using it wrong. There is such a thing as a learning curve and this one goes down, learning all the things it can't do. It's cripplesauce.12 -
Q: What's the relation between Java and Javascript?
Ans: What's the relation between Car and Carpet?!5 -
I bought a laptop with a 4GHz CPU, 32GB of RAM, 2TB fusion drive all to execute a hello world script in the terminal so that it can run fast :)4
-
What's the worst thing that happened to you today?! 🥲 😕
For me, it is, accidentally putting my node_modules folder into antivirus for scanning!! 😭 😩
I don't know whether I can use my antivirus ever again ... 🥺 😞9 -
My compiler tells me, "Hey, you have an error at line 389, resolve it!"
Me [In wonder]: What the heck are you talking Mr Compiler, my program is of 32 lines only!!!2 -
Q) What's the bravest action ever?
a) Sky diving
b) Rock climbing
c) Underwater diving
d) Doing fixes in Production
Correct Answer: Option (d)2 -
Me: I'm a developer and what're you?
Him: I'm a tester.
Me: We can be friends until the release...
Him: After that?!
Me: It gets difficult...1 -
Me: [Curiously] How many seconds are there in a year?!
AI: [Confidently] 24 of them! January 2nd, February 2nd, ..., December 2nd, January 22nd, February 22nd, ..., December 22nd.
Me:
----------------------------------------------------------
Is AI too dumb or too intelligent!!!2 -
What makes programmers different from other professions?
- We could feel worthy when our code compiles even after 458 failed attempts :)
-------------------------------------------------------------------------
What's your answer?!6 -
This is what motivates me to move forward in the field of tech:
"Any highly advanced technology is indistinguishable from magic!"9