|
- I was born in 1971
- I always have Visual Studio update to the last update to the last minute before anyone else!
- it was NOT 10GB for me. Seriously I wonder how it's 10 Gb for him.
- BTW there was a Git extension update 10 minute ago, keep up guys!
|
|
|
|
|
Quote: I always have Visual Studio update to the last update to the last minute before anyone else!
Back in Pakistan, due to slow internet speed, I could not afford to update my Visual Studio each time there was an update. Now, I am in Turkey so I try to do this as well. You know, why not.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Couple of minutes, was all. (50+Mb Fibre-to-cabinet connection)
If you want to include someone, use the at-code system: and at-sign followed by the Username (not necessarily the same as the "Display name", your Display name is "Afzaal Ahmad Zeeshan", but your user name is "afzaal_ahmad_zeeshan"). If you do that, they get an email alert that you are talking to them.
You can find the Username on the user homepage, top left corner, just below the DisplayName
@afzaal_ahmad_zeeshan
Just like that!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Found this nugget in the constructor of a class that’s supposed to represent a structure in a binary file:
var isNamed = reader.ReadBoolean();
if (isNamed)
{
var nameLength = reader.ReadByte();
this.Name = new string(reader.ReadChars(nameLength));
}
The property setter for Name checks the length of the string—and it forbids zero-length strings. Wouldn’t a name length value of 0 suffice to indicate the absence of a name?
|
|
|
|
|
But, if nameLength is zero, this means that isNamed is true .
A man has no name. That's why.
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
Valar Morghulis!
|
|
|
|
|
The only reason i can think of for this is that Name can be specified but empty, which seems silly. I wonder if there was a design issue further downstream that required support for empty names?
Real programmers use butterflies
|
|
|
|
|
Or ReadBoolean masks a bit and they put the other 7 bits to good use.
|
|
|
|
|
If that were the case I would be skinning someone come code review time.
Real programmers use butterflies
|
|
|
|
|
But but but...it's a binary file.
|
|
|
|
|
Database people have been discussing variants of non-existing, empty and zero-length strings for at least 30-40 years.
There is a difference between not knowing whether a value for the attribute exists, knowing positively that it is void, and knowing that there is a defined value, but it is of zero length.
The strangest passport I ever saw was for the son of friends of mine: It stated birthdate as unknown, sex unknown, name unknown, no photo or fingerprint available. When the mother, US citizen living in Norway, is pregnant with a baby, and plans a trip abroad with the baby a few weeks after the delivery, you must start the process of applying for a passport before those details are known.
So for this baby's middle name, before his birth, nothing was known, not even if he would have a middle name at all. If he has one, I do not know it, so I could treat it as a defined name attribute with unknown value. If I learn that he certainly does not have a middle name, it would be a known value of zero length.
There may be better examples to illustrate various null/empty/… values; this is just the first one dropping into my mind. There may be cases where there is no semantic difference between optional omitted, included but unknown, included with a known length of zero and included with a positive length value. Yet there are other cases where the semantic difference may be very significant.
|
|
|
|
|
Empty is not the same as "unknown". If it is unknown, then that is what it should state.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
mmmm... while you are arguing for 1 wasted byte at offset 0, did you noticed the wasted 1MB at offset 43512?!
|
|
|
|
|
I’m sure the serialization inefficiencies could be waved away with a layer of arithmetic coding compression using a specialized model trained on the wasted bits of this format, but I worry that this is just basically sweeping technical dust under the rug …and overengineering for such a trivial problem.
|
|
|
|
|
I guess you may already know this but still, it's pretty annoying for me.
Dudes just introduced breaking change in the order of startup methods in a framework used by really lots of people because of... um... oh... whatever reason.
|
|
|
|
|
I had to create a template ASP.NET Core 3 project just to figure out why things were breaking in the whole startup process. Geez, they changed a lot.
And then I also discovered that they switch to their own JSON deserializer -- apparently they had been using Newtson, and that broke things.
Then I discovered that the way I was coding a SQL where clause with EF "linq-ish" syntax no longer was supported.
I hate open source.
|
|
|
|
|
Quote: And then I also discovered that they switch to their own JSON deserializer
This thing "wow, this new JSON serializer is so fast" really annoys me. Of course, it's fast, it lacks features Newtonsoft has. There are lots of other fast serializers with a lack of features i.e. Utf8Json, why not compare with them.
It's worth noting that one can use Messagepack to serialize things fast.
Quote: I hate open source.
I wonder whether this is open source or just sloppiness.
|
|
|
|
|
I've been debugging my first Windows shell extension, and just realized the problem with the following:
_TCHAR *buffer = new _TCHAR(buffer_size); No compiler warnings or errors either.
Software Zen: delete this;
|
|
|
|
|
C++ is too often like that. You write something that compiles, but it doesn't do what you think. Recently I was answering a question where a newbie had written
if(a && b < n) believing that it meant
if((a < n) && (b < n))
|
|
|
|
|
It is probably possible that some UML somewhere will cater for that...
Do what I mean, not what I say.
My plan is to live forever ... so far so good
|
|
|
|
|
UML is good for documenting something complicated after it has stabilized.
|
|
|
|
|
Yeah, I've seen that. Wasn't that the same posting which tried to express a pair using the syntax (a,b) ?
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Yes, you contributed an answer to that one[^], where (a, b) was the syntax for a function definition's unnamed arguments!
|
|
|
|
|
C++ tried it's best to be compatible with C at the beginning, including it's idiosyncrasies. What's the point in the compiler guessing what the programmer's intention might be?
|
|
|
|
|
I do not think a compiler should be guessing at what a programmer's intention should be. It should give them a warning (or error) that what they are asking makes no since. The compilers job is to turn your text into a program that runs on the given platform.
There are two major issues with the compiler making dissensions for you:
1) You are not learning how to tell it what to do.
2) Your are learning that even if you do not understand how it works, that someone (way smarter than you) has figured out how to make it work - even if you don't.
The main problem is that their solution to the problem (#2) may result in a solution that breaks what you intended. You'll never become an expert in the language of your choice if the compiler is deciding what you intended to do, as apposed to what you actually told it to do.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone
|
|
|
|