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 - "no zeros"
-
Yesterday: Senior dev messages out a screenshot of someone using an extension method I wrote (he didn’t know I wrote it)..
SeniorDev: “OMG…that has to be the stupidest thing I ever saw.”
Me: “Stupid? Why?”
SeniorDev: “Why are they having to check the value from the database to see if it’s DBNull and if it is, return null. The database value is already null. So stupid.”
Me: “DBNull is not null, it has a value. When you call the .ToString, it returns an empty string.”
SeniorDev: ”No it doesn’t, it returns null.”
<oh no he didn’t….the smack down begins>
Me: “Really? Are you sure?”
SeniorDev: “Yes! And if the developer bothered to write any unit tests, he would have known.”
Me: “Unit tests? Why do you assume there aren’t any unit tests? Did you look?”
<at this moment, couple other devs take off their head phones and turn around>
SeniorDev:”Well…uh…I just assumed there aren’t because this is an obvious use case. If there was a test, it would have failed.”
Me: “Well, let’s take a look..”
<open up the test project…navigate to the specific use case>
Me: “Yep, there it is. DBNull.Value.ToString does not return a Null value.”
SeniorDev: “Huh? Must be a new feature of C#. Anyway, if the developers wrote their code correctly, they wouldn’t have to use those extension methods. It’s a mess.”
<trying really hard not drop the F-Bomb or two>
Me: “Couple of years ago the DBAs changed the data access standard so any nullable values would always default to null. So no empty strings, zeros, negative values to indicate a non-value. Downside was now the developers couldn’t assume the value returned the expected data type. What they ended up writing was a lot of code to check the value if it was DBNull. Lots of variations of ‘if …’ , ternary operators, some creative lamda expressions, which led to unexpected behavior in the user interface. Developers blamed the DBAs, DBAs blamed the developers. Remember, Tom and DBA-Sam almost got into a fist fight over it.”
SeniorDev: “Oh…yea…but that’s a management problem, not a programming problem.”
Me: “Probably, but since the developers starting using the extension methods, bug tickets related to mis-matched data has nearly disappeared. When was the last time you saw DBA-Sam complain about the developers?”
SeniorDev: “I guess not for a while, but it’s still no excuse.”
Me: “Excuse? Excuse for what?”
<couple of awkward seconds of silence>
SeniorDev: “Hey, did you guys see the video of the guy punching the kangaroo? It’s hilarious…here, check this out.. ”
Pin shoulders the mat…1 2 3….I win.6 -
Friend: I wiped this drive, and then I open it in my Hex viewer app, and it's all zeros!
Me: yeah?
Friend: Why isn't it empty?
Me: uh well a drive must have its bits set to some value and can't just nothingness so zeros is just a default meaningless value that resolves to nothing..
Friend: No, but why is it full of zeros? why it isn't empty?
...
I attempted several times and then exploded. rip self14 -
!!depression
I used to measure my performance in features per day (or week, depending on their scope), or tasks/day or loc/day for huge projects. My usual was two to three small features a day, and some progress on a larger one.
Now I’m so burned out and depressed that i measure my progress in the amount of days per week that aren’t “zeros” — as in days where i get literally nothing done. Now any day where i get _anything_ done, no matter how little, is a “good day.” I partially refactored about fifty lines of json builder spaghetti on Tuesday. That was a great day.
This week I’ve had two zeros, and it’s Thursday morning. I think it’s going to be a three zero week.
Worse: performance reviews were due weeks ago. I still haven’t written mine, and have no idea what i would even write. How can i make myself sound good when i can barely even force myself to eat or take a shower?50 -
Putty, you son of a bitch. Why do you call the logging option "All session output" if you don't include binary zeros in the output? Zeros don't count as "all" or what?
Then call the option "All session output without zeros", that would have saved me some time and prevented handing out false data.6 -
At work we have to split a potentially large ID into 2 10-digit long parts that will be passed to an outside system that will later return them with some more data to us.
A colleague had implemented it using regular expression, it passed code review, everything was ok, until he noticed a potential problem. For some cases, because the outside system stores them as int and therefore will remove any leading zeros, there will be no way to reconstruct the number.
So we brainstorm and I propose ether a modified regex, or to just use math like part1 = id % 10^10 and part2 = floor(id % 10^10) and then we can reconstruct it simply by: part2 * 10000000000 + part1
Colleague: - Well, the regex will be faster, there won't be any calculations
Me: - :| I disagree but ok..
We do some more brainstorming and testing and find a case where the proposed new regex fails as well
So I bring up my previous proposal, I explain what exactly it does.
Colleague: - I don't like the math, it has calculations, which won't be needed before we reach the 11th digit
Have I missed some major development in computer hardware? When did they become bad/slow at doing math? :|8 -
So... I have 5 Raspberry Pi Zeros (no Wifi), one RPI Zero with wifi and one RPI 2 b+. I want to do home automation stuff with them. Any ideas?
I was thinking openhab, my only problem is that the rpi zeros dont have wireless connections.5