Make the code extra complicated so your pm gives up when trying to do some changes him/herself and thus your perceived value to the company is increased :/
Plus, in our code base we're talking about a mess that, thanks to the absence of any tests, would basically result in a rewrite if we'd try to fix even the most glaring design issues, such as the overreliance on global state.
Never mind heavily misunderstood notions of code reuse. A common pattern in our code base, is that the result of some cheap calculations are stored in a local variables in a huge function. Then after refactoring we have functions with 10+ parameters, most of which are under-documented, and effectively make the function extremely hard to actually reuse or maintain.
i do post operations in get calls bc I can't figure out how to make a second post in my current api. it works, but it's nasty. i really need a code review lmao
I donât see an excuse to not have a code review process.
Everyone submits a pull request, and at least one other person looks at the code. If you are not the only developer on the team, just start doing it. Donât make excuses because some one else is in charge, and they made poor decisions. Manage upwards, and get yourself into a more stable environment that is conducive to learning. If you canât make that happen at your current company, and you have the ability, start looking for another job.
Edit: If you want practical advice on how to make it happen, you start by finding 1 other person who is into the idea. Even just ask if they would be willing to review your code. Put yourself in the vulnerable position and let some one tell you that your code needs some work.
Take the criticism with grace and have an honest discussion if you disagree.
Then ask if they would be willing to start a code review process to improve standards on the team.
Get management involved when you have a process in mind and how it can reduce technical debt and improve team competency by allowing better developers to give feedback on other developers code, and the other way around as well.
It can be slow to enact standards, but you can start with yourself if thatâs what it takes.
Edit 2:
If you arenât familiar with feature branching and pull requests, please let me know.
(Almost) Anything is valid C with enough typedefs and #defines beforehand
Which is how you end up with Algol-flavoured C (Bourne shell) and Metalang99, an FP-orienteded dialect of C that (ab)uses the preprocessor to add algebraic data types, automatic currying, and more.
Not if false is defined already as some random value like ehh... -7.5f or "FALSE". Or bonus points if you express it as an uneven floating number that can only be expressed as an even number.
Now I want to hide this in my code somewhere 𤣠test if (something == True), and wait for someone to 'refactor' it into if (something) .....
For bonus points: declare it "correctly" as a global (boolean True = true; etc) in a somewhat obvious place, then flip them insidiously (using the code in the OP) inside an unrelated method... (Even better if the method doesn't always get executed but does in some situations, and/or if it sets the variable to the opposite of whatever it currently is.)
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/poldi1405, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
Obviously, you wouldn't do that, but having 0 (which would normally be logical false) represent true is a paradigm that is used everywhere as it allows you to return a reason why a function failed.
329
u/SpeckyYT sadistic Mar 25 '21
I have several questions
458
u/BernhardDiener Mar 25 '21
Boolshit!
2
u/NtrestedNU Apr 18 '21
Looks like you figured out quantum computing.
99
u/Shit_Fucker69 Mar 25 '21
why is this tagged as c
111
u/seventyeightist shameless Mar 25 '21 edited Mar 25 '21
Now I want to hide this in my code somewhere 𤣠test if (something == True), and wait for someone to 'refactor' it into if (something) .....
For bonus points: declare it "correctly" as a global (boolean True = true; etc) in a somewhat obvious place, then flip them insidiously (using the code in the OP) inside an unrelated method... (Even better if the method doesn't always get executed but does in some situations, and/or if it sets the variable to the opposite of whatever it currently is.)
26
u/Kimoror Mar 25 '21
When you were fired from your job
28
u/TreadmillOfFate Mar 25 '21
In what fucking universe would you ever want to do this
10
u/Notakas Mar 25 '21
I've seen this in some project before.
10
u/[deleted] Mar 25 '21
The antiBoolean
10
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Mar 25 '21
Image Transcription: Code
[A photograph of code on a computer screen, as follows:]
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
9
u/MyAntichrist Mar 25 '21
Totally lacking the comment "fix bug from <jira issue number>"
9
u/The_JSQuareD Mar 25 '21
It's not true, and it is false. So it's false!
Perfectly consistent. I don't see the problem.
6
u/[deleted] Mar 25 '21
this looks more like java though
5
u/[deleted] Mar 25 '21
How To Write Unmaintainable Code
4
u/abdomxou Mar 25 '21
Something I'm already expecting from YandereDev xDD
3
u/Dudecor3 Mar 25 '21 edited Mar 25 '21
Why not
boolean False = !True2
u/[deleted] Mar 25 '21
This is how Python implements boolean type /s
2
u/[deleted] Mar 25 '21
typedef bool boolean;
2
u/vasilescur Mar 25 '21
2
u/[deleted] Aug 23 '21
kinda like the liars paradox, but different
2
u/serieousbanana Jun 14 '22
Oh so funy and ceraetiv!!11!1!1
3
u/qqwy Mar 25 '21
You have defined what is known as the loobean.
2
u/nohacksjustretard Mar 25 '21
No, this isn't real.
2
u/VA0 Mar 25 '21
boolean is not a keyword in C.
1
u/LechintanTudor Mar 25 '21
Shell programmers would disagree
1
u/Pro_at_being_noob Mar 25 '21
When your teammate is the Satan himself
1
u/NobodyCares19946676 Mar 25 '21
This isn't bad code, its evil
1
u/cleverDonkey123 Mar 25 '21
Nice.
1
u/Mango-D wicked Mar 25 '21
Reminds me of the iconic
In global namespace
1
u/animenosekai_ Mar 25 '21
When you really want to use Pythonâs Boolean:
1
u/[deleted] Mar 25 '21
The devil fears him.
1
u/just_a_dude2727 Mar 25 '21
This is why your python code doesn't work !
1
u/Glori4n Mar 25 '21
Boolean True = !false; Boolean False = !true;
1
u/rpmerf Mar 25 '21
Boolean True = ((Math.random()%10)>1);
Can't be too consistent, makes debugging too easy.
1
u/CaJoKa04 Mar 25 '21
Yesn't
1
u/rhinetine Mar 25 '21
This makes me deeply uncomfortable.
1
u/the_hunger Mar 25 '21
what is the best kind of bear?
well thereâs several schools of thoughtâŚ
true. black bear.
1
u/LordDoomAndGloom Mar 25 '21
Oh god
1
u/[deleted] Mar 25 '21
W h a t
1
u/[deleted] Mar 25 '21
I know a guy who created constants for 1-1000 like this:
His reasoning: it's unintuitive for arrays to start at 0. Obviously the names were localized so he also defined the glorious
NEUNHUNDERTNEUNUNDNEUNZIG1
u/shrekthethird2 Mar 25 '21
That's OGOP.
Opposite-George-Oriented Programming.
1
u/[deleted] Mar 25 '21
Can I just ask WHY ? đ¤ˇ
1
u/SlightlyNotMad Mar 25 '21
You forgot about
boolean Maybe = FILE_NOT_FOUND;1
u/BS_BlackScout Mar 25 '21
typedef go brr
1
u/Fizzyade Mar 25 '21
Obviously, you wouldn't do that, but having 0 (which would normally be logical false) represent true is a paradigm that is used everywhere as it allows you to return a reason why a function failed.
It's not quite as crazy an idea as it sounds.
1
u/Gantzz25 Mar 26 '21
The statement
is a true statement.
1
u/[deleted] Mar 26 '21
When you hate your company and you're serving notice period.
1
u/Alvatrox4 Mar 26 '21
Actually this is next level smart
1
u/dave_thenerd Apr 15 '21
KILL IT WITH FIRE!
1
u/bearfuckerneedassist Dec 27 '21
Up is down
Left is right
Ints are string
1
u/[deleted] Dec 30 '21
But why?
0
u/pronuntiator Mar 25 '21 edited Mar 25 '21