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 - "boolean"
-
Well here's how I see things going:
Intel and AMD ditch their assembly architectures for Scratch, because drag and drop is very popular lately.
The Boolean is renamed to the biggot by SJW leaders for only supporting binary views.
You must first ask consent to add an item to a linked list, because forcing two items together promotes rape culture.
Apple removes the "h" and "7" keys on all laptop models and gives no reason for their actions.
Linus Torvalds grows an extra middle finger, and it still isn't enough.
Nintendo makes Mario gay and Luigi black to be more inclusive.
LG makes a curved monitor that curves away from you rather than towards you. People buy it in confusion.
Everyone makes the same ad revenue on YouTube, and it is rebranded to OurTube. Luckily, they were able to keep the color scheme.
People finally realize that machine learning is just math, and stop using it everywhere. (Just kidding lol)
AMD and Gucci merge. Nobody understands why.22 -
Me: "can we go to the cinema this weekend?"
gf: "uhm, maybe if blablabla..."
Me: "boolean!"
gf: "true"
...9 -
Woke up last night after a dream and shouted to My girlfriend:
"this has to be a f**kin Boolean !!!!"
I think I am a fulltime 24/7 Programmer :D6 -
Found this 2 years old beauty today:
public boolean hasPermission(User user, Permission permission){
// TODO
return true;
}
The author quit last year.7 -
To be or not to be.
Whenever you are stuck with something in life, ask that question to yourself.
Because
2b || !2b
Is a Boolean expression which will always be true. So asking that question will lead you to true self.
Peace ☮️9 -
*Me trying to flirt with her*
Me: "Programming turns me 1."
She: "JavaScript turns me true."
Guess who spent whole day searching some good js tutorials on web today ??6 -
There are two kinds of people:
those who write
if foo.isBar() {
foo.setBar(false)
}
else {
foo.setBar(true)
}
Vs
those who write
foo.setBar(!foo.isBar())
Only good programmers will understand😢😊31 -
Me trying to find a good risotto recipe.
Sister-in-law, PhD: What about pumpkin or courgette and salmon?
Me: ...
SIL: ...
Me: Could you add some parentheses?
SIL: (Pumpkin) or (courgette and salmon)?
Me: Much clearer, thanks! Go for courgette and salmon.6 -
public boolean even( int num ) {
if ( num < 0 )
num = -1 * num;
while ( num > 1 )
num = num - 2;
if ( num == 0 )
return true;
else
return false;
}19 -
Code: if(customer.primaryContract)
Boss: "just using a variable as a boolean isn't very readable"
Me:
if(!(!customer.primaryContract != !true).toString() == 'false')13 -
This is not a joke. This is not something I wrote to be funny. This is not found randomly off the internet. This is a real part of the project I inherited: a function that not only is more cumbersome to use than the simple <Array>.contains that it wraps, but rather than returning the boolean result from the function, sends it through an if statement and returns hardcoded true and false values for... Good luck? I guess?47
-
What the flying fuck is happening on the EU with the fucking GDPR corsairs!!
I made two - TWO - entirely static websites, hand-made, 100% cookie-free!! I didn't even need to store a goddam boolean cookie! No third-party content is EVER invoked, called or summoned! I hosted a small video to avoid Youtube! Facebook and twitter share buttons are links!! I DID ALL OF THIS ON PURPOSE AND INFORMED THE FUCKING CLIENT.
And THEN (and, of course, unsolicited), the fucking lawyers of an asshole GDPR corsair office came and scared the shit out of my clients and convinced BOTH of them to put the goddam GDPR cookie consent popup on the fucking websites!! And they took their bribe, of course...
In order to avoid billionaire fines because of the NON EXISTENT cookies of the SMALLEST, SIMPLEST, 2KB MINIFIED HTML page on the Internet.
Anybody else is suffering from this kind of behavior??9 -
One of the morons said today that we should use C because you don't need to "apply logic" in Python. Everything is automated in python. Fucking morons............
It doesn't ends here. One of the "9 pointers gang" student raised an objection. I was happy untill he said that there is no boolean datatype in C. I literally shouted "Shut up, morons. There is a whole fucking library dedicated to it." in a class of 60 students.
Don't know how I survived 3 years here. And more importantly, don't know how will I survive my next year.
P.S.: the 9 pointer guy who raised the objection, once asked me whether chrome is developed and maintained by Google?15 -
Me in the digital circuits class: "Bro I just got a pick up line in mind!"
Friend: "Go on.."
Me: "Girl, are you a boolean signal 1? 'Cause you turn me on 😏"
Friend: "I can't believe I'm your friend."6 -
There are in fact three unique Boolean values.
Their names are "true", "false", and
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...12 -
I always use brackets for clarity even if there is only one statement inside them
if (boolean){
function ();
}
Cus it's so much easier to read, and if I need to add statements after the if I don't need to remember to add brackets. Plus the else may need brackets and an if with no brackets but an else with brackets looks awful.14 -
I had to open the desktop app to write this because I could never write a rant this long on the app.
This will be a well-informed rebuttal to the "arrays start at 1 in Lua" complaint. If you have ever said or thought that, I guarantee you will learn a lot from this rant and probably enjoy it quite a bit as well.
Just a tiny bit of background information on me: I have a very intimate understanding of Lua and its c API. I have used this language for years and love it dearly.
[START RANT]
"arrays start at 1 in Lua" is factually incorrect because Lua does not have arrays. From their documentation, section 11.1 ("Arrays"), "We implement arrays in Lua simply by indexing tables with integers."
From chapter 2 of the Lua docs, we know there are only 8 types of data in Lua: nil, boolean, number, string, userdata, function, thread, and table
The only unfamiliar thing here might be userdata. "A userdatum offers a raw memory area with no predefined operations in Lua" (section 26.1). Essentially, it's for the API to interact with Lua scripts. The point is, this isn't a fancy term for array.
The misinformation comes from the table type. Let's first explore, at a low level, what an array is. An array, in programming, is a collection of data items all in a line in memory (The OS may not actually put them in a line, but they act as if they are). In most syntaxes, you access an array element similar to:
array[index]
Let's look at c, so we have some solid reference. "array" would be the name of the array, but what it really does is keep track of the starting location in memory of the array. Memory in computers acts like a number. In a very basic sense, the first sector of your RAM is memory location (referred to as an address) 0. "array" would be, for example, address 543745. This is where your data starts. Arrays can only be made up of one type, this is so that each element in that array is EXACTLY the same size. So, this is how indexing an array works. If you know where your array starts, and you know how large each element is, you can find the 6th element by starting at the start of they array and adding 6 times the size of the data in that array.
Tables are incredibly different. The elements of a table are NOT in a line in memory; they're all over the place depending on when you created them (and a lot of other things). Therefore, an array-style index is useless, because you cannot apply the above formula. In the case of a table, you need to perform a lookup: search through all of the elements in the table to find the right one. In Lua, you can do:
a = {1, 5, 9};
a["hello_world"] = "whatever";
a is a table with the length of 4 (the 4th element is "hello_world" with value "whatever"), but a[4] is nil because even though there are 4 items in the table, it looks for something "named" 4, not the 4th element of the table.
This is the difference between indexing and lookups. But you may say,
"Algo! If I do this:
a = {"first", "second", "third"};
print(a[1]);
...then "first" appears in my console!"
Yes, that's correct, in terms of computer science. Lua, because it is a nice language, makes keys in tables optional by automatically giving them an integer value key. This starts at 1. Why? Lets look at that formula for arrays again:
Given array "arr", size of data type "sz", and index "i", find the desired element ("el"):
el = arr + (sz * i)
This NEEDS to start at 0 and not 1 because otherwise, "sz" would always be added to the start address of the array and the first element would ALWAYS be skipped. But in tables, this is not the case, because tables do not have a defined data type size, and this formula is never used. This is why actual arrays are incredibly performant no matter the size, and the larger a table gets, the slower it is.
That felt good to get off my chest. Yes, Lua could start the auto-key at 0, but that might confuse people into thinking tables are arrays... well, I guess there's no avoiding that either way.13 -
When i started learning CSS I thought `!important` will put the property's precedence to the lowest possible level, because, you know, I thought it means "not important".3
-
Co-worker: "We would appreciate it if your future commits weren't so ignorant and bigoted"
Me: "Excuse me?"
Co-worker: "You made the gender variable a boolean"
I... But... Okay...13 -
An application based on a single MySQL stored procedure that contained all the application business logic inside of it (plus a poor webapp that simply called it). The stored procedure had 97 (yes, NINETY SEVEN) parameters... and about half of them were boolean flag used for enabling/disabling another parameter. I think that Uncle Bob could follow you holding an AK-47 if he saw that. The saddest part is that the shit was written by a guy having a PhD in computer science, and he knew that was bad, but the boss asked him to do it in that way. The guy left the company before I joined it and I had to maintain that crap. Guys, the first time I saw it I thought that should be a joke. Code generated by decompilers was easier to read, maybe even Brainfuck. I tried complaining with the boss but she said that the system was wonderful and very efficient. This was one of the reasons I moved to another company after some months.3
-
How i used to toggle a boolean:
foo ? false : true;
How i decided to toggle a boolean last night:
foo = !foo
I wondered why i only just thought of that.18 -
Saw a company's database storing gender in a boolean. I got so mad...at the very least, store gender in a float, 0 to 1. How dare they classify my gender as a boolean, forcing me into the binary societal patriarchal bullcrap?39
-
I'm freelancing and there was a guy who needed help with JavaFX. He gave me code only to his view class so I don't steal the rest... It was around 5k lines and it was full of compilation errors because of missing classes. While checking the code I realised something is really wrong with his model classes. So I asked maybe he could send me this one model class that was suspicious. So he did and it was around 10k lines long and had around 200 fields... ALL OF THEM FUCKING STRINGS except 3. You know what the rest of 3 were? 2 Lists of strings and a boolean... It was his "main" model class, he was using it for everything. It had setters for all fields and empty default constructor, so he would just instantiate the object and would set the fields that he wanted to use. Need new functionality? Just add 5more String fields and set them!2
-
Me in a test:
if(boolean)
return value;
return something_else;
I then lost 2 marks for not having an else statement -.-30 -
Working on a database priorly designed and maintained by some private agency.
The fuck I'm dealing with!
Boolean values stored as 'TRUE'/'FALSE'. It's varchar, my dudes.
There are no FK relations. Just the values of IDs in a column.
There are no indexes, all on just the PKs, nothing else. Nothing.
Null, what's that? I'm dealing with 'N/A', my dudes.
Unique key, what's that? The table which stores users has all the fields nullable. Email is not unique ( even though that's the required behaviour).
ALL the numeric values are stored as varchar. Varchar, my dudes. Varchar. '1', '1.1'
And finally, the good ole, 1 table to rule them all. Normalisation, fuck that.
And what's the root cause of all this? My PM used to hand them Excel sheets she maintains on her local system. FTW. I don't have a enough explanations.7 -
So I once had a job as a C# developer at a company that rewrote its legacy software in .Net after years of running VB3 code - the project had originally started in 1994 and ran on Windows 3.11.
As one of the only two guys in the team that actually knew VB I was eventually put in charge of bug for bug compatibility. Since our software did some financial estimations that were impossible to do without it (because they were not well defined), our clients didn't much care if the results were slightly wrong, as long as they were exactly compatible with the previous version - compatibility proved the results were correct.
This job mostly consisted of finding rounding errors caused by the old VB3 code, but that's not what I'm here to talk about today.
One day, after dealing with many smaller functions, I felt I was ready to finally tackle the most complicated function in our code. This was a beast of a function, called Calc, which was called from everywhere in the code, did a whole bunch of calculations, and returned a single number. It consisted of 500 or so lines of spaghetti.
This function had a very peculiar structure:
Function Calc(...)
...
If SomeVariable Then
...
If Not SomeVariable Then
...
(the most important bit of calculation happened here)
...
End If
...
End If
...
End Function
But for some reason it actually worked. For days I tried to find out what's going on, where the SomeVariable was being changed or how the nesting indentation was actually wrong and didn't match the source, but to no avail. Eventually, though, after many days, I did find the answer.
SomeVariable = 1
Somehow, the makers of VB3 though it would be a good idea for Not X to be calculated as (-1 - X). So if a variable was not a boolean (-1 for True, 0 for False), both X and Not X could be truthy, non-zero values.
And kids these days complain about JavaScript's handling of ==...7 -
SOME GUY IN MY TEAM, PROBABLY: I don't want to get political, but what the actual FUCK is boolean?12
-
I was checking an Arduino sketch I wrote in a hurry 2 years ago. I want to cry for the number of shit I've found there 😓
Picture + I had put as int variables that should have been boolean. I needed them for 0 and 1. As well as with no comments and no explicative names.13 -
Someone gave me a web method that return a boolean.
The Boolean tells me if the operation went well.
True means everything went well
False means something went wrong
But
It throws exception when something went wrong.
Basically they implemented a Boolean system to check if everything is alright but I also have to add a try/catch if something is not right.9 -
A day in the life of BoyBiscuit.
PM: Please zip up any local changes and push them to a temp folder on the repo and I will manually check to see what you have changed.
Me: *glaring at the download as zip button*
PM: Who broke the repo?
Me: *checks commit history*
Commit History: *last commit PM*
Me: Could you add the files to your commit before pushing because you've only pushed changes on tracked files.
PM: No not possible, I did 'commit -a'.
Me: ....
PM: Could you all delete your forks so that It isn't anywhere on the web
US: but it's private with only us as collaborators
PM: No because I can see it
Me: srysly?
PM: Could everyone try to write more effective code?
Me: Looks at his code
Code: Boolean b = getbooleanVal ? True : False;
Tl;Dr: PM doesn't know anything about git or working as a team.
See you tomorrow!1 -
When the last dev wrote code and you dared to read it....switch on a Boolean, what even is your life legacy dev?2
-
Well... I found the bug...
Thanks Sun/Oracle for the clever API design. ;)
Also... I feel like a noob now :D3 -
When your prof gives you 9/10 on your CS assignment because, instead of returning an int and doing a comparison, you do the comparison and return a boolean.
🤔😑 u serious man15 -
condition == true
is for boys,
public static boolean isTrue(boolean condition) {
try {
return new Boolean(condition).equals(Boolean.parseBoolean(new String(Boolean.toString((boolean) Boolean.class.getField(String.valueOf(true != false).toUpperCase()).get(null)).toString().toCharArray())));
} catch(Throwable t) {
return condition;
}
}
is for men.6 -
Cat schroedingers = Cats.getFromScientist("Schrödinger");
boolean lives = schroedingers.isLiving();
*runs code*
Kernel panic4 -
This guy who earns 20% more than me wrote a method to check which string of 2 is lexicographically smaller.
public boolean isSmaller(String s1, String s2) {
String [] temp = new String[2];
temp[0] = s1;
temp[1] = s2;
Collections.sort(temp);
if (temp[0].equalsIgnoreCase(s1)) {
return true;
}
else {
return false;
}
}5 -
My Javascript professor explained Boolean to me using an allegory about pizza: "If I give you pizza, under what condition do you eat it? Your hunger must be true or false. Boolean does the same thing, but with things less exciting than pizza."
It didn't even begin to make sense to me until it became about pizza.
I vote for ALL future computer classes to be taught in terms of pizza.12 -
bool True = false;
bool False = true;
if (True == true)
{
False = True;
}
else
{
True = true;
False = !true;
}
if (!False == !!true && True == !false)
{
False = True;
True = (!!False)true;
}
Console.WriteLine("Banana");5 -
You will know your 2 year old dev team is messed up when the 'best programmer of the bunch' does a line like:
boolean check = ...some logic...;
if(check == true) {...
:/ and I'm going to be leading this team..10 -
Java: Cannot convert int to Boolean.
Me: Wait what?.. Ohhh *cries*
I've had too much Vitamin C / C++..
Not used to computer liking me and not letting me shot my head of.. I love you too, Java ..3 -
Person: "What is bool?"
Me: "Boolean, true or false."
Person: "But why is it called that?"
Me: ...
Brother: "Because it's based on boolean algebra. Made by George Boole."
https://en.m.wikipedia.org/wiki/...7 -
I work in a contract position and reviewed the code of a senior engineer recently. Regretfully I can't provide context to preserve anonymity.
He wrote awful JavaScript;
- handled a single DOM element with 2 different frontend libraries
- used the logical operator && to 'chain' two methods (it didn't work) instead of returning a boolean value,
- broke everything down into minute detail (a comment box had 7 components!),
- API calls were made for every component update instead of maintaining local component state where it made sense, which meant UI updates were slow,
- animated EVERYTHING, which made my Firefox on Xubuntu i7 64bit with 16GB RAM beg for mercy.
I had a rough couple of months with interviews, with 2nd stage technical interviewers throwing impossible tasks at me.
Example:
1. Create an online Python code editor with Javascript which can compile Python bytecode,
2. Use Mesos and Kafka to create real time architecture for Tensorflow with a Javascript frontend in 1 day. (I asked, and wasn't allowed to use Kubernetes or serverless architecture),
3. Hack a website from the browser's address bar using parameters ( what?!! ),
Obviously, the next time I meet a 'senior', I'm going to tell him talk is cheap;
'SHOW ME YOUR CODE.'3 -
From NAND to Tetris..
This book is IMO the best book for those who want to venture to the lower level programming.
This books retrains you’re thinking, teaches you from the bottom up! Not the typical top down approach.
You begin with the idea of Boolean algebra. And the move on to logic gates.. from there you build in VHDL everything you will use later.
Essentially building your own “virtual machine”.. you design the instruction set. Of which you will then write assembly using the instruction set to control the gate you built in VDHL.
THEN you will continue up the abstraction layer and will learn how a compiler works, and then begin written c code that is then compiled down to your assembly of your instructions set to be linked and ran on your virtual machine you built.
All the compiler and other tools are available on the books website. The book is not a book where you copy and paste, run and done.... you kinda have to take the concepts and apply them with this book.
Then once you master this book, take it the extra step and learn more about compilers and write your own compiler with the dragon book or something.
Fantastic book, great philosophy on teaching software.. ground up rather than top down. Love it! It’s Unique book.21 -
Anyone else developed a habit to structure verbal allday Argumentations in your head in Code syntax? Helps me alot to follow ones logic. Except when I'm arguing with my girlfriend. Sometimes setMood(angry) gets randomly called (bug?) and then every if statement seems to be valid, eventhough it should return false. An inputstream that contains my outputstream is initialized but .readLine() is never being called. Instead, the outputstream to my inputstream is being overly abused. Once we get dive deeper into our if-statement we will find a while loop with a mysterious flag. Noone knows it's origin. The while loop keeps printing out random concatenated strings until it overflows your own capacity. I would have said its while(true) but in fact there must be a timer in another very hidden thread or something that sets our flag to false. The other and only way I know to exit that loop is to call apology() 100 times (maybe a variable sets the boolean that could be deeply buried in her projectstructure like this CONST.VALUES.getMood().getRealMood().getTrueMood().TRUTHCONTAINER.angryMode=true)..
I wish I could get a stressball so I can continue theorycrafting and debugging. Its 4.30 am now, my better side is snoozing next to me. I bet making this a pseudocode would be fun.
Ps: I love my lady but I had to rent3 -
Using circuit simulator (can find it on itch.io) and recently built an 8bit adder as you can see below.
Pins on left are IN and pins on right are OUT.
Just wanted to run it by some of you because 1. circuit simulator is fucking cool, 2. I'm not sure if I got the basics correct.
I attached an imagine of the 8bit adder along with the subcircuits if that interests you.7 -
You think HTML isn't a programming language? Tell that to the guy wrote js to check if a hidden div contained the word True inside its tag before it fired.12
-
Two actual lines of code I stumbled upon...
static ArchiveAbstract ARCHIVE_TRUE = new ArchiveTrue();
static ArchiveAbstract ARCHIVE_FALSE = new ArchiveFalse();
Ok you might think, what is going on? Searching for it's usage yields exactly a single case:
if(someVar instanceof ArchiveTrue ? true : false)
So someone managed to introduce 3 new classes... instead of using a simple boolean.
(╯°□°)╯︵ ┻━┻2 -
TFW you’ve been trying to debug an issue for over an hour and you find out you typed:
variable1 == variable2
Instead of
variable1 = variable2
AARRGGHHHHJJHHHHHRIFNRIDKEJXJDJ!!!!!!!9 -
If you are programming in C++ please always return a type from a function as the function prototype return type.
I had to debug some old code that failed to return a boolean on one of its flow paths. It would work on linux in release and debug, would work on windows in debug, and fail on windows in release.
The failure was NOT straightforward at ALL. It would return exit code 3. Then if I added a debug print to the function it would segfault.
Why the hell would popping something extra off the return/call stack not crash more readily? Wth is the point of debug compile if it won't catch shit like this?8 -
String nullabity check duel...
null, isEmpty(), "", " ", '', ' ', " null", boolean, NaN, undefined, isNullOrEmpty and finally try-catch -
Oh god, I was like 13 and just found out about RPG Maker 2000. I got a pirated copy from a friend because ive got no internet at that time. I remember, my first project was with a friend of mine and dayum, we were so dumb and unknowing.
Once we wanted to implement a counter of how many fights a player had.
The problem was, we only knew about switches (boolean variables) and so we started to implement boolean variables like these:
hadOneFight
hadTwoFights
hadThreeFight
and so on, as something like a counter.
We took this to 50 before I asked my friend if this is the right way of doing this.
He answered: "thats probably the reason, why games are so big nowadays" (he just installed morrowind at home...)
Then at one day, I reached the point I didnt knew what I should do next in this project, so I looked around at all the other functions we never even tried and I found something called "variables".
Those where the "real" variables like string and int and wow, suddenly the possibilities where endless. I told him about variables at telephone and what we could do now, but that just got him somehow frustrated so he told me, that he wants to leave this programming thing4 -
Pet peeve of the week: code with "== true" at the end of boolean expressions.
if (coin.isSilver() == true) ...
which is just as sensible as
if ((coin.isSilver() == true) == true) ...
or
if (((coin.isSilver() == true) == true) == true) ...6 -
I got this function skeleton to implement, who the fuck return a Boolean value using a int64?!?
Why are C programmers so damn insistent of never using the _Bool type that is in the damn language since C99? Have they been living under a rock since 1999?
// An irritated C++ programmer12 -
So we had a class that should have 2 states 0 or 1, you think my coworker would be smart enough to represent it with a Boolean? NO!
Represent the state inside the object as an int then when using the object in a function creates a Boolean that determines the state of the object and after the function done it's job THEN call another function that takes the object and the Boolean and change the int state inside the object depending on the Boolean.
Wouldn't it have been whole lot easier to just you know..... Make the state a Boolean from the start.
When I saw this I knew I was witnessing a miracle of the human mind. God bless!
Ps: it wasn't connected to any kind of API nor server and there are never more than 2 states. It's just some local sequential code so don't assume it had a logical reason it's just a fuck up.5 -
Shit Developers say:
Fuck you Jasmine and your camelCase
I’ve been wrestling cucumbers all day
Oh no all the cucumbers are broken
In a fit of refactoring madness I have gone and changed a lot
Did you seriously just give ME nil?... No!
If the shit sticks, then we put nice paint on it
Fucking red dot motherfucker (Ben and his failing specs)
You know what we don’t do often..kill each others builds. Kill them and reschedule for later. Mwahaha ha ha.
This build is going to be so rad...(5mins later)...Ok this is not going to pass..I can feel it in my waters!
Can i do that in a digital way or do i have to move my meaty body downstairs to find him?
All the donkeys have be out the gate by sundown
God, imagine if you could patent mathematical solutions
actually, I wouldn't be surprised if you can in the states "no, you can't use a laplace transform, you haven't got the rights, you have to use a less accurate transform on your matrices"
ooooo a boolean that's phrased in the negative, my favourite for code review destruction!
Fuck the police i'll call the object here
Web RTC - its super easy, all you have to do is..probably some hard stuff
I want to go to that conference so I can start arguments with dickheads about semicolons. Just for fun.
This this is not the same as that this.
Can’t come to work I can’t find any clothes. It’s best for everyone if I just don’t come in. ...2 hours later... Yeah my clothes were just in the other room and i couldn’t be fucked moving
(OH about bad bug reports) - you know when they are all like oh joogly joogly doesn’t doodle doodle and it should wobbly doodle you know? and im all like fuck i don’t know any of that shit you are talking about.
Him: "I don’t like it, it’s against REST convention its so 2006 that my eyes are bleeding. As a privileged white male i feel entitled to complain about this." Me: "you. were. eleven in 2006
Source: Kellective Github2 -
try {
boolean isOk = meetTheGirl("Anna");
if (isOk) {
kiss();
goHomeAndProgram();
}
else {
cry();
goHomeAndProgram();
nextDay();
pickUpAGirl();
}
} catch (Exception e) {
//I don't know. My life is so empty
}7 -
Class DonaldTrump extends Shit implements Asshole {
public final boolean PRESIDENT = false;
public final String THINKING = "bullshit";
public void talk () {
System.out.println(THINKING);
}
}1 -
OSC, or open sound protocol, does not have a Boolean type. instead, the Boolean true has type true and the Boolean false has type false.
what.
well.
at least the problem wasn't in my code? -
!rant, TL;DR at the bottom
Holy fuck, Yesterday, I got absolutely schooled by a literal newbie.
And I mean, NEWBIE newbie, the dude just started a Computer Science degree, and has been learning Java only for a MONTH. He has 0 prior experience with code or anything of the like, and he's somewhat of an Ars(Israel's version of a Gopnik).
So I was helping him with some stuff he didn't understand, and lo and behold his code was probably the most aesthetically pleasing and organized code I have seen in my 8 years of programming(I know 8 is not much, but It's at least above beginner level). The dude's a perfectionist, so I was like, "Okay, very impressive, but makes sense for perfectionism"(I straight up told him: "Damn, I've seen people with years of programming experience who can't learn to write this well, and you do this by default? I envy whoever's going to work with you"), and then I saw the way he writes checks(as in, methods that return a boolean) and I think I came.
The code was:
[First method in the picture]
And I know, it doesn't look as ✨ WOW✨ as I make it sound, but in my personal opinion this both looks much better and is much more readable than what I normally write:
[Second method in the picture]
and whenever there are longer or more complicated checks it makes it look like a simple puzzle that just fits in all the pieces nicely, for example in a rectangle class we had to write an 'isIn' method, this is how I wrote it:
[Third method in the picture]
His way of writing the same thing was:
[Fourth method in the picture]
Which I think is soooooo much better and readable and organized,
It's enough just looking at the short return statement to immediately understand everything that's going on.
"Oh, so it just checks if the SW(South West, i.e. Bottom Left) corner is above and to the right, and if the NE(North East, i.e. Top Right) corner is bellow and to the left"
Point of the story? Some people are just fucking awesome. And sometimes the youngest/most inexperienced people can teach you new tricks.
And to all of you dinosaurs here with like, 20+ years of experience, y'all can still learn even from us stupid ones. If 8 years can get schooled by a 1 month, 20 years can get schooled by a 1 year.
Listen to everyone everybody, never know where you might learn something new.
TL;DR: Got schooled by a local "Gopnik" who only started learning programming a month ago with 0 prior experience with his insane level of organization and readability.30 -
After hours of debugging my js script, I finally found out that all my trouble came from a variable that contained the string “true“ instead of a boolean value. I kinda hate javascript now...6
-
!rant
Does anyone know what the Boolean Pythagorean Triples problem or the Ramsey Theory? I read about it while reading an article on brute reason, a kind of compliment to brute force...8 -
You can always tell if someone is a programmer by asking them:
Is zero equal to zero or equal to 1?
Non devs say 0, devs say 115 -
I saw a self called "senior developer" store a boolean as a "t" or "f" in a character varying with a max of one character in our postgres database. wtf13
-
! ! ! WARNING: BAD PUNS ! ! !
Float: Bool, you're so basic.
Bool: Why are you boolean me?
...
I'll see myself out6 -
In a programming exam, we had to write a program in 60 minutes, part of which was sorting some strings by length (strings the same length had to be in the same line)... I had like 3 minutes left, so i wrote this beauty:
boolean b = false;
for(int i = 0; i <= 999999; i++){
for(int j = 0; j <= strings.length; j++){
if(i == strings[j].length()){
System.out.print(s + " ");
b = true;
}
}
if(b){
System.out.println();
b = false;
}
}6 -
I've been a programmer for almost 19 years but I actually think the best code I've ever written is something that while it provides value to other people I'm the only one who actually uses it. In the company where I work we have major events that have to be supported by a number of different teams across about 5 time zones and each engineer has a limited set of roles that they can perform during the event. Anyway it was painful just watching people trying to create a schedule so I wrote something with Linear Programming to automatically generate the schedule. It ensures that people don't work for longer than 4 hours in a row, don't work from more than 8 hours from the first hour to the last hour on call, get 12 hours rest between engagements and the work load is evenly distributed across the team. Creating conditions in Linear Programming is weird, imagine trying to turn a series of linear equations into boolean logic, it can be done and once you can wrap your head around it it's really fun. It was my first time writing anything in it and I don't see it coming up a lot in my career. My favourite part of this project is that the end result was that engineers were less exhausted. I really hope that doesn't remain the best code I ever wrote, I don't think it will but it will require a conscious intention.2
-
I am of the firm belief that a function should always return just one type.
I think it's the most convoluted thing that a function should be allowed to return any kind of type.
I've seen shit like return a string when something is valid and then a boolean if it's not valid.
To me, that kind of flexibility has some funky code smell.
I'm looking at you WordPress 🤨11 -
The legacy codebase, episode 4584985948:
- outdated comment
- die parentheses space string no-space parentheses
- die AND exit, just to be on the safe side
- won't comment about the screaming boolean
- at least they used triple equals (and yep, that's a font ligature)4 -
I’m all for writing boolean statements that are readable, quick to grasp the real life case they’re representing and align with the spec rather than being ultra-reduced, but sometimes the spec is written by someone who clearly can’t reduce logic. So when the spec says “if it’s not the case that any of them are false” and you write:
!(!a || !b || !c || !d)
then I think you should try harder. At least put a note against the spec to say “i.e. if they’re all true” and then write the sensible code. Just think of the poor developer that might have to augment your code at a later date and has to follow and intercept that shite. -
Fuck everything about Microsoft Dynamics. I'm supposed to use the REST API to make a web front-end. I notice all of the data comes back codified.
null == 0.
boolean true == 100000000
boolean false == 100000001
except sometimes when
boolean false == 100000000
boolean true == 100000001
or other times
string "Yes" == 100000000
string "No" == 100000001
string "Maybe" == 100000003
Hang on. Is the system representing a 1 bit value with base 10 numbers? Did the client set this up like this? Holy crap every number corresponds to a unique record in a table somewhere. That means it only returns numeric values instead of strings and I have to figure out what the number means in the context of the table.
A "key" is user typed? So every time someone starts to make a new record it saves a new "key" without a record? So I can pull a bunch of "0" records if I pull sequentially? So basically I need to see all of the data in Dynamics to have any context at all for what is returned from the Dynamics API? Fuuuuuuuuuu10 -
My man said "What should I return if the True/False field is left blank?"
WHY WOULD A BOOLEAN BE ANYTHING OTHER THAN TRUE OR FALSE???!!!
I'm gonna have an aneurysm. I shouldn't be educating people on best practices for something that's already been written about time and time again. RESTful philosophy has been documented so much, and all it takes is a quick google search, but noooo! I have to take time out of my day as if I'm a regular old stakeholder to explain that I want the exact thing that I sent in an email two weeks ago. Amazing.20 -
Going to make a new programming language, positive# .
Where the default value of a Boolean is true instead of false. -
Just learned the previous dev team thought a db column with a value of NULL or "Y" was a great way to handle boolean values.5
-
Used a String as a Boolean
First sin of the year
😂😂😂
Ps:Android studio wont let me use int or boolean,it was suggesting to use respective arrays as it was inside a loop2 -
//run every weekday afternoon
public void workIsOver(int hoursOvertime){
int beerCount = 1;
if (hoursOvertime > 1){
beerCount++;
}
startCar();
int timeHomeMinutes = 20 + Traffic.getTimeLostStuckInTrafficToday();
if (timeHomeMinutes > 40) {
beerCount++;
}
Boolean finallyAtHome = true;
if (goToFridge.checkStock("beer") < beerCount){
Log.e("Dude","WTF?");
}
drink("beer");
while (!girlfriendAtHome){
if (stash != 0){
Joint joint = new Joint(stash);
joint.blaze();
} else {
Log.e("Dude","Seriously?");
}
startAndroidStudio();
workOnSideProject(getCurrentSideProject());
}
girlfriend.communicate();
new AsyncTask<>(thinkAboutCodingInBackground()).execute();
if (bedTime){
try {
doSomeBedroomPartying();
} catch (NullPointerException e) {
Log.w("Sorry","not today");
}
activity.finish();
}
}1 -
Historically I've done Java but have recently moved to C# and got the book to do a cert.
Who thought it would be a good idea to start chapter 1 with threads, concurrency, asynchronous calls and PLINQ, then covering boolean expressions, if statements and loops in the section after??6 -
Pulled into an 'emergency' meeting with a group of web designers deeply concerned a particular service wasn't going to meet all their requirements.
DevA: "For each page, Its going to be A LOT of work to retrieve all the data and store it's state. Every page load will require a round trip to the service."
DevB: "Yes, we aren't sure how the service should be changed to do what we need."
Mgr: "What is it not doing now? Doesn't the service already returns all the necessary data?"
DevA: "Well...um...its all the boolean fields. Some may be defaulted from the database or false because the user unchecked the box. We have to know which is which"
Me: "Why? Are you doing anything different in the UI? Checkbox will be true or false. What or who set that value is irrelevant"
DevC: "Well, it matters if the user didn't fill out all other other values."
Me: "How so?"
DevA: "Its matters because the values in the other fields. Its going to be A TON of work to figure out."
<mgr goes to the white board>
Mgr: "Lets map this out...what fields are you needing to trigger the state on?"
DevA: "Um...uh...the 'Approved' field...and um...'OK to Contact' field"
Mgr: "Just those two?"
DevA: "Yea..um...there are other fields, but whether or not to show the edit box depends on those two."
Me: "The service already returns data, you only have two fields to check? I don't see a need to change the service at all."
DevA: "Returning all that data, we are going have a serious scaling problem. We'll be hitting the service A LOT. All that javascript could cause performance problems too"
Me: "How much data are we talking about? Name, address, couple of booleans?"
DevA: "I have to serialize the data. All that logic is going to be reeeaaallly complicated. It might be better if the service returned only the data I need."
Me: "$64,000 question, how often is this feature going to be used on the web site? Maybe once? Few hundred a week?"
Mgr: "We have no idea. A lot of the data will be pre-populated and we're only sending out a few thousand invitations. More around the holidays...but honestly, not very many."
Me: "Changing that service only for this particular area of the web site isn't going to happen. Changing the UI is the only course of action."
DevA: "Oh frack I can't wait until this project is over."
DevA...how the funck do still have a job here? You wasted about half-hour of my time with your cry-baby crap. Where is my hammer...no...no..don't go there...ahhh...thanks devrant. Prison sentence diverted.2 -
Should I be excited or concerned?
Newbie dev(babydev) who just learned string vs int and the word "boolean", is SUPER into data parsing, extrapolation and recursion... without knowing what any of those terms.
2 ½ hrs later. still nothing... assuming he was confused, I set up a 'quick' call...near 3 hrs later I think he got that it was only meant so I could see if/where he didnt understand... not dive into building extensive data arch... hopefully.
So, we need some basic af PHP forms for some public-provided input into a mySQL db. I figured I'd have him look up mySQL variables/fields, teach him a bit about proper db/field setup and give him something to practice on his currently untouched linux container I just set up so he could have a static ipv4 and cli on our new block (yea... he's spoiled, but has no clue).
I asked him to list some traits of X that he thinks could be relevant. Then to essentially briefly explain the logic to deciding/returning the values/how to store in the db... essentially basic conditionals and for loops... which is also quite new to him.
I love databases; I know I'm not in the majority... I assumed he'd get a couple traits in his mind and exhaust himself breaking them down. I was wrong. He was/likely is in his sleep now, over complicating something that was just meant as a basic af.
Fyi, the company is currently weighted towards more autistics (him and myself included) than neurotypicals.
I know I was(still am) extremely abnormal, especially when it comes to things like data.
So, should I be concerned/have him focus elsewhere for a bit?... I dont want to have him burnout before he even gets to installing mySQL44 -
Just started a new job three weeks ago. I was doing pair programming with another developer that has been there two years; I was assigned an issue and wanted his opinion on it. He implemented a fix that involved multiple complex if statements.
He was surprised after I went ahead and showed him that the variable in question could be used (it was either 0, null, or > 0) like a boolean. I brought it down to 3 lines; a single if statement. Felt like a boss. -
Came across a method in the code base that returns a boolean.
It uses a ternary operator which returns true if the result is true and false.. you guessed it... if the result is false.
WHY NOT JUST RETURN THE FUCKING RESULT!!!
What. The. F#%#....2 -
I started with C#at the age of 12, it was way too complicated and I learned Lua for Computer craft instead. Next I learned Ruby for RPG Maker and finally Javascript for web Dev stuff.
Now comfortable enought with Javascript but put off by its quirks I learned Java for compiling faulty minecraft mods, but I only fully learned it in school.
At the same time I learned python and quite liked it for scripting, but ultimately it was not a good match for my projects.
Disapointed with Java I returned to C# and liked it quite a lot, but started learning C++. After touching my first Microcontroller I learned C and I've stuck with it as my favorite language.
Along the way I picked up Kotlin, in case I need to do some Java shit. Much better.
But how did I come to an understanding of programming. Well I got better after each time I got a layer deeper until I hit silicon.
I had tinkered with electronics since I was 15 so I just had to study some boolean mathematics in school and some vintage computers architecture and instruction sets and...
Then I finally understood how that shit I wrote in Lua way back when was actually executed by my hardware.
Allways dig deeper and you'll find enlightenment eventually. -
I found this weird line in a library while debugging, though I really don't know php that well but wouldn't this condition return a boolean anyway?9
-
Forgot headphones, noticed coworkers conversation...
If null coalescing operator (??) returns right on null, why doesn't !! Do the opposite?
- boolean beat ya to it.1 -
Today I learned that for boolean HTML attributes, they are considered true if they're present on the element at all, regardless of their value. And that as a rule, you should specify the empty string("") in value.
This wounds me on a logic level since everywhere else in JS, "" is false.
What.
The.
Fuck.
Seriously. Why?14 -
I had rough week last week. Accidentally deployed dev code to production, soon found out there was no production version of code to do a redeploy. Deployed another app to production, it was working fine then another Dev changed a data type in the database from bool to nullable Boolean which broke some Linq queries. Looked like I deployed crap code. 3rd week with company.
-
After I read clean code I talked to a fellow developer about some concepts. Later I reviewed some code of him and he clearly got the concept (not)
Java
...
If (isTrue(someValue))...
public boolean isTrue(boolean value){
if(value == true)
return true;
else
return false;
}9 -
Can we all just agree to stop actively imagining progressively harder to parse CSV formatting options? For fucks sake I’ve had to build in tolerance for quoted and unquoted data, combined data and split data, ways to split the data and recombine it, compare every data point, filter some data, only add data, only remove data, base data updates on non Boolean fields in the file, set end point matching based on arbitrary fields, column number matching, header matching, manipulate malformed urls and reassemble the file with proper ones, it goes the fuck on. CSV’s should just be simple and not hard to format. Why does everyone want to try so fucking hard to do bizarro shit?!
-
Logging into my school website when... WHY DO YOU USE 🤬 FRNCH FOR BOOLEAN IN THE URL M🤬F
Ok, I know this is a francophone college, but come on!4 -
Working on an Android app for a client who has a dev team that is developing a web app in with ember js / rails. These folks are "in charge" of the endpoints our app needs to function. Now as a native developer, I'm not a hater of a web apps way of doing things but with this particular app their dev teams seems to think that all programming languages can parse json as dynamically as javascript...
Exhibit A:
- Sample Endpoint Documentation
* GetImportantInfo
* Params: $id // id of info to get details of
* Endpoint: get-info/$id
* Method: GET
* Entity Return {SampleInfoModel}
- Example API calls in desktop REST client
* get-info/1
- response
{
"a" : 0,
"b" : false,
"c" : null
}
* get-info/2
- response
{
"a" : [null, "random date stamp"],
"b" : 3.14,
"c" : {
"z" : false,
"y" : 0.5
}
}
* get-info/3
- response
{
"a" : "false" // yes as a string
"b" : "yellow"
"c" : 1.75
}
Look, I get that js and ruby have dynamic types and a string can become a float can become a Boolean can become a cat can become an anvil. But that mess is very difficult to parse and make sense of in a stack that relies on static types.
After writing a million switch statements with cases like "is Float" or "is String" from kotlin's Any type // alias for java.Object, I throw my hands in the air and tell my boss we need to get on the phone with these folks. He agrees and we schedules a day that their main developer can come to our shop to "show us the ropes".
So the day comes and this guy shows up with his mac book pro and skinny jeans. We begin showing him the different data types coming back and explain how its bad for performance and can lead to bugs in the future if the model structure changes between different call params. He matter of factually has an epiphany and exclaims "OHHHHHH! I got you covered dawg!" and begins click clacking on his laptop to make sense of it all. We decide not to disturb him any more so he can keep working.
3 hours goes by...
He burst out of our conference room shouting "I am the greatest coder in the world! There's no problem I can't solve! Test it now!"
Weary, we begin testing the endpoints in our REST clients....
His magic fix, every single response is a quoted string of json:
example:
- old response
{
"foo" : "bar"
}
- new "improved" response
"{ \"foo\" : \"bar\" }"
smh....8 -
Hey everyone!
Today I learned that true is not boolean and my functions typed for bool can actually return bool OR true!3 -
python machine learning tutorials:
- import preprocessed dataset in perfect format specially crafted to match the model instead of reading from file like an actual real life would work
- use images data for recurrent neural network and see no problem
- use Conv1D for 2d input data like images
- use two letter variable names that only tutorial creator knows what they mean.
- do 10 data transformation in 1 line with no explanation of what is going on
- just enter these magic words
- okey guys thanks for watching make sure to hit that subscribe button
ehh, the machine learning ecosystem is burning pile of shit let me give you some examples:
- thanks to years of object oriented programming research and most wonderful abstractions we have "loss.backward()" which have no apparent connection to model but it affects the model, good to know
- cannot install the python packages because python must be >= 3.9 and at the same time < 3.9
- runtime error with bullshit cryptic message
- python having no data types but pytorch forces you to specify float32
- lets throw away the module name of a function with these simple tricks:
"import torch.nn.functional as F"
"import torch_geometric.transforms as T"
- tensor.detach().cpu().numpy() ???
- class NeuralNetwork(torch.nn.Module):
def __init__(self):
super(NeuralNetwork, self).__init__() ????
- lets call a function that switches on the tracking of math operations on tensors "model.train()" instead of something more indicative of the function actual effect like "model.set_mode_to_train()"
- what the fuck is ".iloc" ?
- solving environment -/- brings back memories when you could make a breakfast while the computer was turning on
- hey lets choose the slowest, most sloppy and inconsistent language ever created for high performance computing task called "data sCieNcE". but.. but. you can use numpy! I DONT GIVE A SHIT about numpy why don't you motherfuckers create a language that is inherently performant instead of calling some convoluted c++ library that requires 10s of dependencies? Why don't you create a package management system that works without me having to try random bullshit for 3 hours???
- lets set as industry standard a jupyter notebook which is not git compatible and have either 2 second latency of tab completion, no tab completion, no documentation on hover or useless documentation on hover, no way to easily redo the changes, no autosave, no error highlighting and possibility to use variable defined in a cell below in the cell above it
- lets use inconsistent variable names like "read_csv" and "isfile"
- lets pass a boolean variable as a string "true"
- lets contribute to tech enabled authoritarianism and create a face recognition and object detection models that china uses to destroy uyghur minority
- lets create a license plate computer vision system that will help government surveillance everyone, guys what a great idea
I don't want to deal with this bullshit language, bullshit ecosystem and bullshit unethical tech anymore.11 -
// Stupid JSON
// Tale of back-end ember api from hell
// Background: I'm an android dev attempting to integrate // with an emberjs / rails back-end
slack conversation:
me 3:51pm: @backend-dev: Is there something of in the documentation for the update call on model x? I formed the payload per the docs like so
{
"valueA": true,
"valueB": false
}
and the call returns success 200 but the data isn't being updated when fetching again.
----------------------------------------------------------------------------------------
backend-dev 4:00pm: the model doesn't look updated for the user are you sure you made the call?
----------------------------------------------------------------------------------------
me 4:01pm: Pretty sure here's my payload and a screen grab of the successful request in postman <screenshot attached>
----------------------------------------------------------------------------------------
backend-dev 4:05pm: well i just created a new user on the website and it worked perfectly your code must be wrong
----------------------------------------------------------------------------------------
me 4:07pm: i can test some more to see if i get any different responses
----------------------------------------------------------------------------------------
backend-dev 4:15pm: ahhhhhh... I think it's expecting the string "true", not true
----------------------------------------------------------------------------------------
me 4:16: but the fetch call returns the json value as a boolean true/false
----------------------------------------------------------------------------------------
backend-dev 4:18pm: thats a feature, the flexible type system allows us to handle all sorts of data transformations. android must be limited and wonky.
----------------------------------------------------------------------------------------
me 4:19pm: java is a statically typed language....
// crickets for ten minutes
me 4:30pm: i'll just write a transform on the model when i send an update call to perform toString() on the boolean values
----------------------------------------------------------------------------------------
backend-dev 4:35: great! told you it wasn't my documentation!
// face palm forever4 -
Usual python code problems coming from someone who has been coding in Javascript and PHP (<--no pitchforks please). It's been months already but old habits still keep on coming back
- adding a semi-colon
- mixing spaces with tabs
- using a lowercase boolean
- adding an open brace when declaring a function
- forgetting the colon ( ;'s brother) -
There should be a new boolean called "Not sure". I wonder how much it can change the logic of every language.15
-
This is gonna get someone illogically upset, but idc about that.
I know it's ignorance of semantics but I'm tired of propagated ignorance changing the meaning of things.
Non-binary is NOT a legitimate term for whatever 'gender' you are!
I get what *whoever-started-it* was going for, but it's NOT valid. If you want to say that youre not male or female, fine... just don't abuse binary systems to do it. Just say youre non-bool/anti-boolean or identify with one of the, apparently 50, shades of gray.
I keep getting into logical loops to nowhere about this nonsense. No one is even defining what's supposed to be the 1 vs the 0. Which then makes me think '1 must be male... genitalia=1 in many ways...' which then sources back to the historic validity of males vs undervalued/less than human interpretations of females...
Then <brake>.
Ofc these people aren't going into the historical significance... they don't even realise how binary works! Ofc they'd have no clue that all 0s= no data... and 0s only have significance when viewed in placement to the 1s.
Let's all start using proper terminologies, like non-boolean. Maybe i can start a trend by paying people pennies to learn/teach wtf a boolean value is, and that binary can represent anything. With proper encoding the array is limitless... so being binary is actually a giant spectrum... therefore makes no sense to be "non-binary".
Ok... im done. It had to be said.
Who wants to start identifying as non, or educating wtf is, boolean with me???42 -
Found this in production code.
For those who doesn’t understand Delphi:
switch (some boolean) {
case false:
// some code
default:
// some code
}7 -
Hello all,
I am an apprentice, 19. I joined this software developer apprenticeship to leave college as it was not particularly great for my mental health, and programming is the only thing I can do reasonably well.
The company that I find myself in is a strange one. It has about twenty or so employees, but we all instructed to operate as if we are a giant company—our sales person, for example, will tell our clients that we have hundreds.
The development team is a collection of software developers. There is no database administrator, network administrator, software engineer (not in name only), test engineer, requirements engineer, etc. There are just several software developers. Of these developers, one has left by now. When he joined, he was promised to be working on a new system: he left after spending seven years on an old system. A new developer has just arrived to replace him: he was told he would be working with Raspberry Pis; it was interesting to see his face after we informed him that we do not use Raspberry Pis.
The codebase is fourty-years-old and written in Delphi, which is some kind of cousin of pascal, from what I understand. Code is not peer-reviewed. Instead, it is self-reviewed, and you just push whatever changes you make. The code is very much spaghetti, and there is a whole array of bugs that, at least to me, look impossible to track down and fix. I have a bug assigned to me at the moment were someone appears somewhere when they are not supposed to. After asking seniors about this, I learn of this huge checking mechanism and all of its flaws: a huge, flawed checking mechanism... for toggling a single boolean value. This isn't a complicated boolean value, by the way, this is just a value to say whether someone has clocked in or clocked out of a building, via a button.
In terms of versioning, we have several releases, and we often do development work in older releases (or new releases and then write them into older releases) because our clients are larger than us and often refuse to upgrade, and the boss does not want to lose any contracts. We also essentially have multiple master branches.
With the lack of testers, bizarre version control, what appears to be unfiffled promises to staff, etc. I must ask that, since this is my first gig as a software developer, is any of this normal?2 -
I hate complex boolean logic.
(true||false) && true || false || (true && false) ... etc (continue for at least ten clauses four times as long)10 -
Ive been working on pseudo-Java (ie some 3rd company's UNDOCUMENTED programming language) that they parse into Java in their backend
It doesnt even support if-else (only ifs and elses) or a boolean combination of False and OR together lmao
mainly a GRPC middleware-language
Given its lack of features (arrays/collections) or documentation, I just had to implement a flag-array using a 0-1 string
Im throwing exceptions unless combined strings equal Lengths and is only 1s
living like in 80s-90s 💀7 -
Let’s make statistics about from where are the most people out here.
boolean added = false
for (Comment comment: rant.comments) {
if (comment.text.contains(yourHomeland)){
comment.upvote();
added = true;
break;
}
}
if (!added){
rant.writeComment(myHomeland);
}16 -
I know recursion is everywhere but I recently noticed it in very unusual place('unusual' in the way we see), I hail from India, we studied in our childhood about road less taken, the way I see, everyone has to take so important decisions in yheir life, one such decission is about career, in India road less taken in career paths is everything other than orthodox education, I too the dreaded road "Education", next decission is to choose stream and there the road less taken is anything other that "Engineering (or medicne) " and I took (*as expected) engineering, after taking computers (which is the dreaded road now) next decision is what next? Dreaded road is job, but this time I chose take a road little less traveled in CS. Then I next decission was to choose the research stream the road less taken here (NOW) is systems as AI is in its prime and everyone whants to ride the wave, but I chose Systems in research, after all these my point how how boolean function is called recursively (in the sense of construct) and as a systems programmer I realize the importance of optimizing how I answer these functions quick and accurate. This is one such boolean function but I am sure you can find many in our path till here so It is better to realize what these functions are optimize then as a good Programmer of your own Life.
-
48 boolean variables.
For real?
It's clear why the class name is "GameHardActivity", this certainly is hard to maintain, understand, edit, and believe.
I can understand people learning, but with 2 years of experience in programming??? And there's a matrix right in the middle!!!! USE ARRAYS, PLEASE!!!!9 -
boolean experience = false;
boolean get_a_job;
while(!experience){
get_a_job = false;
while(!get_a_job){
experience = false;
while(!experience){
get_a_job = false;
.....
«To infinity and beyond!»8 -
Look, a nice puzzle. Solve it and win great prizes!
1. _________ (7 letters) - A C++ output stream class commonly used to send output to the console.
2. _________ (3 letters) - A past tense verb, often used in logging or indicating a completed task.
3. _________ (3 letters) - A negation commonly used in boolean logic or programming conditions.
4. _________ (6 letters) - A command or function that removes an object, file, or memory allocation in programming.
5. _________ (7 letters) - In object-oriented programming, a term referring to an instance acting upon itself.17 -
Here’s a snippet of code that I found in our production codebase. I found this while fixing a bug. This is not part of the bug though but I see this a problem. Should I say this to my senior that his logic is off here?
First he doesnt have to do explicitly strict comparison since the return type is boolean and it could be true or false. Also the returnUrl will alway be undefined because redirectIfUserLoggedIn is called first before it was set.
He dosent like me. Hell get mad for sure. I think ill let this go.37 -
For the first time in 20 years I used and xor operator.
I wrote in line of code instead of two.
How uses the xor operator?7 -
Snartsheet requires checkbox values of "true" or "false"
Microsoft Flow only passes booleans as "True" and "False" so the API rejects the data.3 -
Benefits of using Strings for Boolean intended logic?
I'll go first
easily implement cases before finally checking if true
generateUsername: { type: String }
if(generateUsername == 'humanReadable'){
// generate a username in a human readable format AKA yoDudeImRainbow
} else if(generateUsername == 'hash'){
// generate a username by using a random hash
} else if(generateUsername){
// generate a username by using a random hash
}21 -
"not boolean" statement can be written as "(boolean+(-1))**2". Pls comment a better alternative lmao17
-
Since becoming an "Architect", I've come to learn "Architect" simply means siphoning your will by eliminating all opportunities to actually write code ...
public class Architect {
static final boolean inMeeting = true;
private int will;
public static void main(String args[]){
Architect me = new Architect();
if(me.inMeeting){
while(meeting.active){
me.reactToEvents();
}
}else{
me.writeCode();
}
}
public void reactToEvents(){
if(new Random().nextInt() % 3 == 0)
will -= this.hit(this.face, this.palm, Force.CONSIDERABLE);
else
will -= this.hit(Office.desk, this.head, Force.MODERATE);
}
public int hit(Object object, Object with, Force force){
object.useForce(force);
object.moveTo(with);
return new Random().nextInt();
}
}1 -
!rant
Going through my graduate program I have come to realize that there is more to A.I than just machine learning algorithms. As if ML was not complicated enough, we add more to it such as KRR and other topics that border on the areas of Cognitive Science, Boolean Algebra, Logic and even Philosophy and you know what? I dig it. I dig it because finding some of the information in the course that I am getting is damn near impossible to see in other items. Such is the case as a method for fucking signature unit propagation which afuckingparently was developed by one of my instructors(not complaining, just really fucking impressed)
The thing is, most of these items would normally have a parallel in software development that we use on our day to day basis, all of us, no matter if you do web, systems development, database development whatever, the general concepts are the same: you represent real world concepts, such as that of logic and knowledge in programatic/mathematical representations.
I am really amazed at the content of these items, I really am. I just wish for some clarification on ambiguity, seems like most things are left better if it where explained in a programmer's point of view. Most of the items that I have seen could have easily been summarized in a programmers logic if only they would have preferred to take the time to do it, and I get that there needs to be mathematical intuition formulated before anything, it is better sometimes to learn concepts from an outside point of view, a mathematical point of view, but shit is just strange sometimes.1 -
A TypeScript boolean/undefined Flag variable kept fucking up
true == true didnt hold true
checked the "typeof" in console and it's GOODDAMN STRING.
What's the point of TypeScript's "type safety" if a Boolean variable is holding a String type for whatever reason. URGHH I HATE JAVASCRIPT.23 -
This lack of real human contact is getting on my nerves. Most of the text messages, discussions, especially in PR or design roads to follow develop into pissing contests. Always proving how much one is right and the others are wrong. -
I get so pissed off with little details, e.g. useless, wrongly handled boolean return values. Cannot understand how they don't see it my way. Or how they can feel superior by offering platitudes like "One should never use singletons". As if following some stupid rules and patterns from a book made you a better programmer instead of looking closely what each problem really needs. Or how they don't measure properly/scientifically or can't interpret the numbers.
My blood pressure already rising just from writing about it. Maybe I need to get some time off. But at the same time I feel like, they are doing it all wrong or not the way it should be done, so it's hard to let go. To obsessed with all that shit...1 -
I have been trying to come up with some funny oil jokes. My wife said they were all crude.
I am feeling a bit boolean. I am either on or off.
I shouldn't try to make up jokes. I have to face it that they are a shade unfunny.2 -
Whoever uses "status" as boolean in responses to indicate whether error happened (true) or not (false)??????!!4
-
So... IT was fucking horrific. Just the sight of red and white makes my heart race. (It was a great movie though; if you're into horror I highly recommend watching it)
However, I'm afraid to go to sleep tonight so I'll probably just stay up all night coding and studying for my CSIII exam on Monday.
SERIOUS QUESTION: as developers, do you ever use base conversions or boolean algebra? I'm trying to figure out how what we're learning will actually apply to the real world.4 -
After a few months of working in an actually well coded project, I'm back in the one where I find abominations like this every day:
boolean result=false;
<do stuff>
if(<condition>){
<do stuff>
return true;
}
<do stuff>
return result;
Do they even read their code before submitting? -
What's up guys! Welcome to your first android tutorial for The New Boston, my name is Travis (aka Bucky). If you're watching this video and you don't know what a "Boolean" is... You're an idiot!
Inspiring? This dude!5 -
Few years ago I was looking at legacy code that was developed by offshore team (what could go wrong,right) and I see small utility method that looks like this:
public boolean isEmptyNotEmpty(String s) {
boolean empty=false;
If(s==null) {
empty =true;
}
If(s.equals("")) {
empty = true;
}
return empty;
}
Thinking in myself: was he/she paid per line the line of code??!?!
Up to this date that was the worst part of the code that I encountered....2 -
one boolean can change your Life 😂😂
Ever think a life without booleans? Share your views on same.
A true developer better knows it!! 👀7 -
How do you deal with relatively complex Boolean logic requirements?
Here's a simple example, of which I missed 50% of the cases because it was non-intuitive to me:
A year is a leap year if:
- it is divisible by 4
- except it is also divisible by 100
- unless it is also divisible by 400
To my intuition, the logic tree is as follows:
if (year % 4 == 0) -> true
if (year % 100 == 0) -> false
if (year % 400 == 0) -> true
so I ended up with 3 cases and I initially missed all the others until I started coding.
The full solution is:
if(year % 4 === 0) {
if(year % 100 === 0) {
if(year % 400 === 0) {
true
} else {
false
}
false
} else {
true
}
true
} else {
false
}
}
I don't like it when I don't immediately see all logic paths.19 -
What's your favourite non-alphanumeric piece of code?
Mine is "!!+" (JS, numeric string to boolean), second place is "+ ++" (many languages, plus the next variable increased by one).
They just remind me of the crazy world we live in.8 -
I have just been made aware that not everyone in this community knows the legendary tri-state boolean.
It is impermissible for anyone in this community to not know of the legendary tri-state boolean.
https://thedailywtf.com/articles/..._6 -
Working on a new release. This release was tested locally and pronounced good. The release went to the QA environment. QA responds that a new feature is doing nothing. There are no errors reported, and work is being done on the UI, but is not get getting persisted to the database so all changes are lost when the session is lost. Do some investigating. I find that a web service had the code in two of its methods commented out. Why? No idea. No response yet from the developer who just had the two methods return a boolean denoting success while all other operations were commented out.
I need an appropriate punishment for this...3 -
That moment you setup 17 domains on sparkpost as a email delivery system
make your account secure with 2 factor authentication like a good infoSec enthusiast
Go on with your life
Having a Phone crash but nothing to worry because you made them backupz
Restore backupz
once again go on with your happy life.
Having to setup a different bounce action on sparkpost
logging in to sparkpost to make the adjustments
opening google authenticator
realising the backup you restored was before you added the sparkpost entry
mailing sparkpost asking to deactivate 2factor authentication
Having them tell me that they have no access to Google authenticator so they can't help me and all they can do for me is delete my account if i answer their 7569357 questions that i entered a year ago ..
--
You have access to your database yes ? You can delete my account but you can't adjust a fcking Boolean column from true to false? #@?#&!
Why even offer a feature where you have apparently no control over. Stuff like this happens all the time and almost no one saves that fcking authenticator secret.
Make people use authenticators to keep the hackers out, forces them out instead.4 -
Not sure if other programming languages class a Boolean as an integer value buuuuuuut...
The amount of times I've seen people do code such as...
if(value == true) {
variable = "blah blah";
} else if(value == false) {
variable = "blah";
}
Instead of doing a simple 1D array and going...
variable = strings[value];
It drives me crazy, such a small thing that has no real benefit but... Ugh... Whyyyyyyy3 -
Yeah, I have experience qith qorst CS teacher.
Considering that teacher as function (object) no matter what we pass never give results... It was anti boolean function can't even decide true or false because lack of info and throws any exception even on success..
It was like getting tons of errors when code is 100% perfect -
Fuck I hate when my brain remembers the wrong keyword! Just spent way too long trying to figure out why my regex wasn’t working! I remember RegEx.check(str) tests for a match and returns a Boolean. The docs say RegEx.test(str) checks for a match and returns a Boolean! Dammed cinnamons! English is my native language I swear.2
-
archaic jsp (java servlet pages) making life hard to do some fucking widget you gotta populate with some dynamic data
upgrading to a modern front end framework is not something the company is interested in doing (react, angular, whatever the hell's popular these days)
we can hack around it on the backend but we'd have to shuffle a boolean down to get used in one place at the bottom only (straightforward but ugly solution)
i hate my job and i don't know what im doing, fuck front end2 -
Boo-Leen or Boo-Li-An ?
You can say the answer is obvious but i know of people who pronounce either of both.15 -
Just when I thought I understood boolean expressions in JavaScript.. this pops up... I've heard JavaScript's boolean's expressions was messed up -- but these should be equal.. surely?11
-
I think since this is a platform for coders, the number of healthy tips is restricted to boolean values, otherwise it wouldn't be healthy.
If you know what I meant.
#whoops -
Looking through Java tests, cause I need to pass one for job. And every one of them has a question like:
What's the result of:
boolean b = 42 >= 1024;
if (b = true) System.out.print(1);
else System.out.print(2);
And each time I answer like there is (b == true) and not (b = true).
Cause no one in real life would write = in if statement. Why do they put such question in each and every test.1 -
Storing ToS in Database.
So, all my life I've built custom software for businesses that do no intent to be used by public.
Now I am developing an online store and the user has to agree to ToS before signing up. I was wondering, if the users agrees to ToS should I store it in database that he accepted? If yes, will it be just a boolean or a text.
P.S. Living in U.S.A.7 -
When elements of an union are distinguished by a boolean, VSCode's Typescript plugin can only do type elimination if I branch by "== true" and not if I just branch by the boolean.
This is because Typescript treats booleans as an union of the constants "true" and "false", and compile-time elimination can only be done if I use syntax that makes sense with unions. Logical evaluation, for some reason, doesn't.
The fact that this issue can even appear is deeply concerning.1 -
I just wrote my exam in IT class. I'm really happy with the fact that we use a computer for a few tasks. That's how the average IT expert works. Think-code-debug. It's practically impossible to write a Java program on paper without mistakes.
Other than that I named my variables like
boolean iCanWriteNowWoohoooo = false;
etc.
It didn't work 100% in the end but I hope to still get a decent grade.1 -
"stacktrace"
Universe.SolarSystem.Earth.Microsoft.Dynamics.Platform.Integration.Services.OData.Query.DataAccessor.GetQueryableCollection(Type instanceType, Boolean isCrossCompany)1 -
Wasted a full day on creating complex code which handles manually timing and updating tokens, since the android GoogleSignInClient seemed not to allow the google server to respond with a refreshtoken. Turns out the only thing i would need to change is adding a true-boolean parameter in one of the GoogleSignIn(for android) functions
-
Get nice idea to code game.
Done it in 3 hours with unity.
Feel shitty myself now :C
If someone want to take a look:
com.Erxelio.Boolean in android market -
Reunions!
I'm a research fellow, so I have 2 teachers that are orientors.
We never have good reunions. They asks me every week to send a report of work done, but they never give me feedback. I ask what I can do next, sometimes they answer, sometimes they don't. So, some weeks I don't know what to do.
Almost everytime, they go to my room with somebody and ask to show the application. And with that,I need to interrupt my workflow, change one boolean variable (because we have a machine learning that is very slow, I have a if to throw the result I pre-calculated). After all this trouble, I need to speak (as he asked), but he starts interrupt while I'm speaking. -
Okay I always found these js weirdnesses that you see in memes more or less logical if you think about it, but so far I could not find any logic behind this:
true&&undefined
>undefined
false&&undefined
>false
can anyone explain wtf they thought about there? undefined is falsy so why not just convert it to boolean implicitly!4 -
Doesn't the existence of NULL in a language mean, that there cannot be a boolean type? Because a bool is defined by the fact, that it can have two possible values. Having NULL changes that.
Without NULL a variable of the type bool could be True or False, two possible values. With NULL is can be True, False or NULL, three possible values.
I hate NULL.18 -
`if (boolean)`
Would you tell a colleague that their PR needed to be refactored because they used parenthesis around an if block that didn't need it? I'm all about explicit order of operations and often add brackets and parentheses around things that don't need them. It's cool if you don't want to put them in, but does the PR need to be held up over this?1 -
At work we use a custom python library to parse XML responses from an internal API to objects. I literally spent half an hour pondering why an if statement was misbehaving. Turns out it parsed <tag>false<\tag> as obj.tag = 'false' instead of the boolean False which obviously made "if obj.tag:" misbehave 😒
-
Looking at code from previous devs...which I now support...
Oh hey there is a function to retry connecting to the database if it fails to open...ok...
It doesn't return anything e.g. a boolean. Not a big deal I'll catch the exception...
It catches the exception and silently ignores it? WTF how do I know if it fails??
It keeps trying for 20 seconds...sounds reasonable...wonder how long it waits between failed attempts...0. No sleep, no back off, literally spams the open call as quick as it can throw the exception...
I'm glad I personally dont know them. They are fucking idiots. -
One of the worst practices in programming is misusing exceptions to send messages.
This from the node manual for example:
> fsPromises.access(path[, mode])
> fsPromises.access('/etc/passwd', fs.constants.R_OK | fs.constants.W_OK)
> .then(() => console.log('can access'))
> .catch(() => console.error('cannot access'));
I keep seeing people doing this and it's exceptionally bad API design, excusing the pun.
This spec makes assumptions that not being able to access something is an error condition.
This is a mistaken assumption. It should return either true or false unless a genuine IO exception occurred.
It's using an exception to return a result. This is commonly seen with booleans and things that may or may not exist (using an exception instead of null or undefined).
If it returned a boolean then it would be up to me whether or not to throw an exception. They could also add a wrapper such as requireAccess for consistent error exceptions.
If I want to check that a file isn't accessible, for example for security then I need to wrap what would be a simple if statement with try catch all over the place. If I turn on my debugger and try to track any throw exception then they are false positives everywhere.
If I want to check ten files and only fail if none of them are accessible then again this function isn't suited.
I see this everywhere although it coming from a major library is a bit sad.
This may be because the underlying libraries are C which is a bit funky with error handling, there's at least a reason to sometimes squash errors and results together (IE, optimisation). I suspect the exception is being used because under the hood error codes are also used and it's trying to use throwing an exception to give the different codes but doesn't exist and bad permissions might not be an error condition or one requiring an exception.
Yet this is still the bane of my existence. Bad error handling everywhere including the other way around (things that should always be errors being warnings), in legacy code it's horrendous.6 -
{
while(time_to_exams > 0){
me.shouldBeLearning(true);
time_to_exams--;
}
public void shouldBeLearning(boolean bool){
if(bool){
should_be_learning = false;
waste_time_on_DevRant = true;
} else {
waste_time_on_DevRant = true;
}
}
} -
Got really happy that I could use the new Boolean work item templates fields in TFS 2017 after upgrading from 2015....Turned into bludgeoning my head against the keyboard when I realised Microsoft decided it was a great idea to not including any way of validating said Boolean field. Time to go back to using Yes/No drop downs, or resort to dirty hacks....
-
I'm developing an app for a client, but they are responsible for the APIs.
Which turns out is the biggest mistake of my life...
I don't know whether data types are unknown to them or they are just playing a sick game with my emotions.
They have a different data type depending on how they feel, e.g.
- a boolean can be true, false, 0,1 or 2...
- an array can be an array or just a single item...
Who in their right mind can do this?4 -
String s = "Rant";
boolean b = true;
if (s != b) {
System.out.println ("Sometimes i hate LinkedIn, so many recruiters or companies have meaningless descriptions.. why should i even apply for a job, if they don't describe their offers, specs and so on"
}4 -
I'm wondering when all the super amazing cloud apps will finally be able to sync notifications between devices. I mean this "problem" is solved for decades with unread emails etc., but somehow companies that get billions of dollars shoved into their arse can't seem to figure out that I don't want to receive all 57 notifications of the past week a second time whenever I turn on my tablet's wifi.
One might think that setting a fucking boolean flag in some database is not that hard when your service can stream 4k video to millions of people, but apparently I was mistaken. -
Sweet Zombie NullFuckingPointerException...
New Rule: When creating an API (I'm looking at you, Java), designers must include a boolean flag in the parameter list of any method which throws a NullPointerException.
If TRUE, this means that a NULL result is non-trivial and the method should therefore THROW an NPE.
If set to FALSE, this means that NULL is completely f*cking trivial so whenever there's a NULL result, just instantiate a new instance of the return type and return that, 'cause that's what was gonna happen in the catch block of the NPE anyways.2 -
Top 12 C# Programming Tips & Tricks
Programming can be described as the process which leads a computing problem from its original formulation, to an executable computer program. This process involves activities such as developing understanding, analysis, generating algorithms, verification of essentials of algorithms - including their accuracy and resources utilization - and coding of algorithms in the proposed programming language. The source code can be written in one or more programming languages. The purpose of programming is to find a series of instructions that can automate solving of specific problems, or performing a particular task. Programming needs competence in various subjects including formal logic, understanding the application, and specialized algorithms.
1. Write Unit Test for Non-Public Methods
Many developers do not write unit test methods for non-public assemblies. This is because they are invisible to the test project. C# enables one to enhance visibility between the assembly internals and other assemblies. The trick is to include //Make the internals visible to the test assembly [assembly: InternalsVisibleTo("MyTestAssembly")] in the AssemblyInfo.cs file.
2. Tuples
Many developers build a POCO class in order to return multiple values from a method. Tuples are initiated in .NET Framework 4.0.
3. Do not bother with Temporary Collections, Use Yield instead
A temporary list that holds salvaged and returned items may be created when developers want to pick items from a collection.
In order to prevent the temporary collection from being used, developers can use yield. Yield gives out results according to the result set enumeration.
Developers also have the option of using LINQ.
4. Making a retirement announcement
Developers who own re-distributable components and probably want to detract a method in the near future, can embellish it with the outdated feature to connect it with the clients
[Obsolete("This method will be deprecated soon. You could use XYZ alternatively.")]
Upon compilation, a client gets a warning upon with the message. To fail a client build that is using the detracted method, pass the additional Boolean parameter as True.
[Obsolete("This method is deprecated. You could use XYZ alternatively.", true)]
5. Deferred Execution While Writing LINQ Queries
When a LINQ query is written in .NET, it can only perform the query when the LINQ result is approached. The occurrence of LINQ is known as deferred execution. Developers should understand that in every result set approach, the query gets executed over and over. In order to prevent a repetition of the execution, change the LINQ result to List after execution. Below is an example
public void MyComponentLegacyMethod(List<int> masterCollection)
6. Explicit keyword conversions for business entities
Utilize the explicit keyword to describe the alteration of one business entity to another. The alteration method is conjured once the alteration is applied in code
7. Absorbing the Exact Stack Trace
In the catch block of a C# program, if an exception is thrown as shown below and probably a fault has occurred in the method ConnectDatabase, the thrown exception stack trace only indicates the fault has happened in the method RunDataOperation
8. Enum Flags Attribute
Using flags attribute to decorate the enum in C# enables it as bit fields. This enables developers to collect the enum values. One can use the following C# code.
he output for this code will be “BlackMamba, CottonMouth, Wiper”. When the flags attribute is removed, the output will remain 14.
9. Implementing the Base Type for a Generic Type
When developers want to enforce the generic type provided in a generic class such that it will be able to inherit from a particular interface
10. Using Property as IEnumerable doesn’t make it Read-only
When an IEnumerable property gets exposed in a created class
This code modifies the list and gives it a new name. In order to avoid this, add AsReadOnly as opposed to AsEnumerable.
11. Data Type Conversion
More often than not, developers have to alter data types for different reasons. For example, converting a set value decimal variable to an int or Integer
Source: https://freelancer.com/community/...2 -
Does anyone work with EditorConfig files in VS?
dotnet_naming_rule.Variable_bool.symbols = Variable_bool
dotnet_naming_symbols.Variable_bool.applicable_kinds = field
dotnet_naming_style.Variable_bool.required_prefix = b
dotnet_naming_style.Variable_bool.capitalization = camel_case
dotnet_naming_rule.Variable_bool.severity = suggestion
this is part of one i'm currently working on. My intention is to let it detect every boolean variable that is not named correctly. Am i doing this right? Am I missing something? (Because at the moment it doesn't work).9 -
Why do you fucking retards make the tinyint column nullable AGAIN and use 'null' as false instead of setting fucking false!
-
Pretty niche tool, but Sencha Architect!
It is a wanna be GUI-Builder/IDE for ExtJS, but neither works properly.
This rant is not about ExtJS, just about Sencha Architect, which my coworkers and I were forced to use.
If you want to join the ride, here an excerpt of just some of the issues:
- installation: already the setup is more of a gamble than an actual setup, either it works on your machine or it doesn't, plain and simple
- GUI Builder: just drag and dropping components is actually nice, but the editing capabilities are frustrating, you can't edit the UI code by hand at all, just through pre defined properties. If there was the need to really mix things up it wasn't possible, I couldn't even rebuild shown examples of their ExtJS documentation. Furthermore the property editor was data type locked, which means if you want to enter a string which ExtJS already supports, but architect locks the value as a boolean, you can't edit it at all, while still using Architect
- code editing: well it is a colored texteditor, which is fine, and I could live with that, but Architect let's you just edit areas where it allows you to - want to change something else? Nope not allowed
- autocompletion: there is none at all, same goes for refactoring, multi highlighting, string replacement, and others
- code storing: well now some may think edit it somewhere else, well no, also not possible... Architect not just only saves simple js, there is also a Json formatted file for everything you have created, which is needed so the tool can actually load it for further editing. They possibly never heard of DRY. But the worst of this code storing was actually using git along with it - have a merge conflict? Merge both files! Every single time, it was so damn tedious
There are a few more, but these were the worst I can remember.
Luckily I don't have to use it anymore!
Maybe they have fixed or changed a lot of it, because the developers were aware of the issues and eager to resolve them, as far as I was told on a roadmap presentation. And some of the tools they had released in the end of my time using ExtJS were actually really good, like an IDE plugin for the framework, and I liked using it. -
Legacy code in java :
boolean recursiveMethod(args){
Int i= 0;
Boolean doublon = false;
For(--whatever the loop--){
If(condition1 && condition2){
If(i++ > 0){
doublon=true;
Return doublon;
}
}
}
[...]
}5 -
I've just joined a new company out of despair after several month out of jobs without being able to even get interviews.
I've been warned about the code being a bit behind with modern Android stack, they needed to migrate from rx to coroutine and compose is not a priority at the moment.
Fine with it, I like handling and planning migration, that's a nice challenge.
But if only that were the only problems !! Far from it, the code is a formidable mess, I've never seen so much amateurism... Most of it was written from the previous Lead Dev who stayed there for years and touched everything with their very bad practices.
I don't even know where to start honestly...
While the code is in Kotlin, it stink Java. Nothing wrong about Java, but if you code in kotlin, you need to understand what kotlin try to achieve. And that's not the case here. There is freaking nullable everywhere, for no reason at all, the data classes contains lot of var in their constructors, equals are override to compare only one or 2 params and no hashcode override with it.
Sealed class, what for ?! Let me just write a List<Pair<Enum, Any>> and cast your any depending on the enum !
Oh and you know what, let's cast everywhere, no check, and for once no null safe, there is enough nullable in the code !
What about the reactive part ? well let's recreate a kind of broken eventbus with rx ! Cause why not ?!
The viewmodel observable don't contain data, they just contain enum for the progress of the states we're checking.
In the viewmodel function we update that enum states and emit it to be observed and make the data available as a var for the view to pick it up when needed.
But why put the business logic in the viewmodel, let's put in the views, and grab and check the variable contain in the viewmodel whenever it fits.
Testing the business logic ? uh let me just test my variable initialisation in the viewmodel instead.
The vm, the views, make about 2000 lines, the test over 3000, and not a single test really test the business logic in it ! I've made big refactoring we're all the tests stayed green, while the function are full of side effects ! WTF ?!
Oh and what about that migration from rx to coroutine ? well better not break the existing code and continue writting like rx, everything is cold flow ! We just need to store a boolean saying if we already did our call to the data layer then we decide to start our flow or not.
As for the RecyclerView, having too many viewHolder is just so annoying, let's put all our different views in one, and hide what we don't need.
Keystore has been push on the repo, but it's private no ? So who cares ?!
And wait i'm not done ! Some of the main brick of the apps depends on library that hasn't been updated for years, and you know what... yes they were hosted on Jcenter and it's only now that they decide to do something about it, we we're warned about the sunset of jcenter 2 years ago !!!!
So what about compose ? What do you want with compose ?! there is no design system in that app obviously, so don't even think about it !
And there... among all of that mess, I'm supposed to do code review... how the fuck do you do a code review when all the code that is around stink ?!
And there is so much more but by now I'm afraid you're thinking i'm just pissing on the old code like everyone... but damn I guarantee, that's the worst code I've ever seen, and i've work on more than 15 app from small to big on different contract with a lot of legacy code, but nothing that bad !1 -
Why did I go broke?
Because every time I tried to cash in my promises, I’d end up nullifying my income with undefined deductions! I thought I could get by on short functions and quick closures, but in the end, I found myself callbacked into a corner with no scope for improvement.
I tried to debug my financial situation, but my stack overflowed with deferred payments, and I couldn’t even parse where all my money was going. The compiler of my life just kept throwing unexpected "expenses" errors.
In a final attempt, I refactored my entire approach, renaming myself Async to buy some time, but it was too late. My funds were hoisted to the global scope, and before I knew it, I was reduced to Boolean poverty.
Now, I live my life in strict mode, always awaiting the day I’ll finally get a return on my investment... but deep down, I know I’m just an object in a mutable state.
P.S : I'm a JS DEV1 -
Just what is life
1st I love developing Web Apps
2nd I hate when it has bugs (Always does Everyone does)
3rd More hate for Security related bugs
So I started bug hunting so that even I can make developers hurt I thought I might find peace here
But here we fucking have SQL Injections which are not really that bad easy peasy
But we also have special kind of SQL Injections the Boolean Based ones (Medium Level Demons) and also The Time Based SQL Injections (Medium Level Demon with lots of health consumes too much time has a repetitive process and we have to wait a lot also if you have network lag you are doomed)
No its nice story till here but here it fucking ends the happiness I mean my luck is worst kind of fucking thing anybody ever can have.
I got a mix of both Demons;_;
A Time-Based Boolean SQL Injections yess fuckety amounts of fucking time wasted and redundant fucking process also to make matters worst the fucking famous tool #SQLMAP doesn't work in my case -
If I ever work with people who use Python professionally I will go postal in under a day they are some of the most unprofessional snarky little fucking bastards on the internet !
Apparently a question with a million hits who's cure all answer DOESN'T WORK, is me being stupid.
So question, how many of you when looking at a third party client that doesn't have great documentation, export class data into a file to look it over at your leisure by using a serializer that just dumps the shit into said file so you can look at it ?
I mean fire and forget. Just works. Just descends into the data structure and starts dumping field values. Done. One line of code.
Json.PUTMYSHITINASTRING(FUCKINGCLASS) ???????
DON'T SAY MY METHOD OF WORKING IS BAD ! ESPECIALLY WHEN THERE FUCKING EXPORT CODE AS A CHECK_CIRCULAR BOOLEAN PARAMETER INDICATING IT SHOULD WORK BETTER THAN IT FUCKING DOES AND THE FUCKING DEBUGGER CAN REFLECT THE OBJECT !!!!4 -
Does anyone know of a site or something, where i can write boolean equation in their proper notations , like
(A+B)bar + Abar + (B + A.Bbar)bar+...
I dont even want it to solve for me, i just want to write equations without writing the word 'bar' or symbols like ~ for negation, just the actual bar or top , so that it look more understandable and beautiful16 -
Last nite, one of my projects started crashing with a ClassCastException because it couldn't cast a string to a boolean, inside an if. This is Java. You can't even run a project if you evaluate a string inside an if. Has anyone seen such a thing before? I'm running BBQLinux which at least for me it has a lot of permissions issues and somehow things got so f'd up that it even messed up the Android image to a point that the compiler couldn't find a method to set a string into a TextView. I'm not kidding.1
-
A && (B || C)
Is there any way to get rid of the parenthesis?
I know how to remove the OR but the parenthesis are still there:
A && !(!B && !C)18 -
In an already verbose, strongly types Java codebase and you see
private String m_strDisplayName;
private boolean m_bIsResolved;
...
I can understand the itch of another teams decided to rename it with correct Java convention. All nice and good, except that these changes were not merged back to master.
Five years, few re-orgs and product restructuring later, I'm staring at 500+ files merging mess trying to bring back these product codebase together.4 -
How should you override Equals in Java?
We have model classes with lots of fields and the we override the details equals to compare all the fields. I guess like doing a deep comparison.
And in all these classes SONAR is complaining about lots of ifs, complexity, etc.
And it's killing the analysis time... Old issue never fixed because whoever setup sonar was too incompetent to bother asking, researching, or fixing...
Is there a better way to override the equals to get the same result but without triggering SONAR issues?
Pretty sure this is a solved problem. And well if the top of my head, is just create a Util method that uses reflection like
Boolean equals( Object a, b, Class class)
foreach (String f: class, getFields()) {if !compare(class.getField(f,a),class.getField(f,b)) return false; }
return true5 -
Guys, is any one worked with d3.js ?
I need a graph and my data source is a 2d array, A Boolean array I mean.
bool[,] matrix;3 -
What the Fun Javascript Part 2
With reference to my old rant : https://devrant.com/rants/1445754/...
An explanation to this...
In JS whenever it sees '==' it has a set of rules that it follows before comparing quantities...
One such rule is...
When we compare a number with a boolean using '==' it first converts boolean into number then compares the two quantities...
So in this case..
When we convert true to number we get 1 and when we compare 1 and 2 they are obviously unequal hence we get false...1 -
Recently had trouble with some SQL. My tests would not pass, so I had to manually run it to debug it.
SELECT * FROM a JOIN b ON [...] WHERE b.foo NOTNULL
Yielded 0 of 3 rows. Expected 1
Tried querying WHERE b.foo ISNULL instead. Would have expected 2 of 3 rows, but got 1.
After googling i discovered that comparing with NULL does not return a true/false binary description, but may also return unknown if the type is not a NULL type, e.g. 42 ISNULL =" UNKNOWN
😳 -
Why the hell does mysql not have boolean fields? why do I have to use a whole integer for a bit? REEEEEEEEEEEEE10
-
Javascript is my main tool at work right now, Typescript to be precise. It never ceases to amaze me, I guess as most of you.
What I've encountered recently still doesn't make sense to me but it seemingly works:
function a(){
someString && someFunction()
// other stuff ...
}
someString can be a string or undefined, someFunction can be a function or undefined.
How is that valid Javascript, without an assignment? Haven't found any explanation yet.22 -
private boolean didWakeUpForNothing() {
if (mathTutoring.isClosed()) {
return true;
} else {
studyForExams();
}
}
private void studyForExams() {
feelEmptyInside = cryInShower = true;
}1 -
Why did the pirate learn boolean logic?
So he could "arr" and "arr" without getting confused between true and false :)2 -
I declared a boolean variable to be public static in my android activity and assigned a false value to it outside the onCreate.
only one method can change its value to true, so once its executed
the value of the boolean variable was set to true even on a new launch after finishing the activity.
didn't know why but it happened.
solved it by assigning a false value in the onCreate method. -
Save method returns true. No validations errors. Everything looks good, except that a boolean field that controls the record has been set to false from true...even though it wasn't in the objects changeset!
-
How do I extend ASP Identity on .NET Core to check the database on every page load for an IsAdmin Boolean on the extended IdentityUser class? I need to do this to ensure rights haven’t been revoked and the user is still allowed to access restricted pages.10
-
What do you think, is this bad practise?
boolean isNumber = true;
try {
Integer.parseInt(somestring);
} catch (NumberFormattingException e) {
isNumber = false;
}
Or is it better to create a method to check, even though I only use it at one place in 700 lines of code?6 -
Was working as the only frontend developer ona project having 4 "senior" developers. They use Laravel to make an API feeding the angular app.
Why the documentation sucked?
Half the API call params where missing, and not one time did I come across an example stating that the API expects a boolean only to find out 20 minutes later that they mean int 1 or 0 not true or false. Best part however was sending arrays in POST by sending the elements as comma separated values (e1,e2,e3...). Oh and not documentation but while at it a rant... There are other response codes except 200 for fucks sake -
So I started Software Engineering university and we started learning java. Before uni I was a c# developer and after two months I decided to work on my own project again in unity. When I was writing the code for this small game I realised that I get a lot of errors. Turns out that I just initialized boolean instead of bool. Thanks java
-
public class LearningJava{
public static void main(String[] args){
boolean isprogrammingEasy = true;
if(isprogrammingEasy){
System.out.println("your on the right track!");
}else{
System.err.println("Try again!");
}
}
}
i know i know pls dont get triggered cuz dev rant is not a code editor but im starting to understand java and javascript also found this youtuber im learning off of i think you guys helped and yes i have skidded a few times but i know its okay sometimes not cool to steal someone source code Thanks everyone
youtuber im learning from: https://youtube.com/watch/...
i think i can understand dex. jadx and more i wont post anymore cringe posts before some devs mght get tired of me just development :)2 -
Hey database experts. MySql question:
I have a table with houses, there is the location, color, etc. Shall I make a column for the owner or make a separate table HouseToOwner - where I connect the id's? I have no idea why is it good practice but saw it in few cases. I have the same with the things inside like I would just make a boolean column for a TV-like haveTV - true/false. Tell me why to not fill everything in one table. thx17