|
Totally correct. There is the Allman style and everything else.
I am so retentive about this, I surround single line indented lines like this.
if (foo)
{
single_line();
}
Sometimes real world function get longer than will fit on one or even two screens. Being able to clearly see and understand the organization of a complicated bit of logic makes it more likely the code is doing what you actually wanted it to do.
And don't get me started on Hungarian notation. I guess if you are coding on paper or a chalkboard it makes sense. Otherwise, what a ridiculous concept.
|
|
|
|
|
Allman makes the braces easy to match up. But more importantly, it makes conditions easy to read because the left brace is alone on the following line. Most styles squander horizontal space but are miserly when it comes to vertical space.
|
|
|
|
|
That is because readability becomes less important when publishing. Vertical space means $$$, so it trumps readability.
|
|
|
|
|
That's probably how K&R started, so people then thought it was the right way to do it.
|
|
|
|
|
|
Curiously, the actual header file itself use the Allman style. The curious part being it was changed for the documentation.
typedef struct addrinfoW
{
int ai_flags; int ai_family; int ai_socktype; int ai_protocol; size_t ai_addrlen; PWSTR ai_canonname; _Field_size_bytes_(ai_addrlen) struct sockaddr * ai_addr; struct addrinfoW * ai_next; }
ADDRINFOW, *PADDRINFOW;
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Well,
Historically the employees that write the MSDN documentation are not FTE (Blue) but V-dash or A-dash[^] employees. The contribution they make is very much appreciated but they usually have restricted access to resources and source code. The documentation reflects that.
Recently there has been an internal push for some dedicated FTE and resource allocations dedicated to documentation.
|
|
|
|
|
Allman style.
I only do K&R for java-script.
|
|
|
|
|
I've been doing a lot of Typescript lately and become so used to K&R style that when I switch back to C# I looks weird.
|
|
|
|
|
Seems to be language dependent.
C# is all Allman as far as I can see.
|
|
|
|
|
Well, everything else has been fixed already, so that was the next item they had to deal with...
|
|
|
|
|
Yeah, after fixing all the icons, what is there left to do?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I always preferred K&R when I worked on small screens, because I could see more code at once. now that I have huge screens, I like Allman better, because the braces line up. The guy with the fashionable little laptop must have won the battle.
|
|
|
|
|
My font rendering pretty much works.
Except GPOS positioning is broken because, get this:
my code returns different results if I read the file into a buffer, and then work against that, versus when i read the file by streaming it, but only in one place I've seen so far. - the 16-bit word at position 32416. Now, in order to even get there it had to read a ton of information from that same file, correctly. I've debugged this portion of the code ad nauseum. Everything appears to check out except the data I'm getting back - particularly fread ing the the 8 bits at byte offset 32417 in Shangar.ttf - the correct result is 26 but I'm getting 90 when I try to stream it. It's maddening.
I can't work it out for the life of me. Consequently, it works for the string "42" but not "jsc42" - this is your fault man!
I am completely stumped. Now I'm going through byte by byte to see if I can figure out why.
Real programmers use butterflies
|
|
|
|
|
I'm so sorry! If I had know that I was a software jinx, I wouldn't have asked for a favour from you. I'm sure you will work it out without me having to change my CP name.
|
|
|
|
|
In seriousness, I'm actually grateful for the ask, because I prefer to *know* about my bugs!
Real programmers use butterflies
|
|
|
|
|
You're near the "1K" mark. My device adventures included taking note of things like 256 and 512 (cause that's what someone was buffering with).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
90 is 64 + 26... would that help? (no idea if it does, just wanted to show the one extra faulty bit)
|
|
|
|
|
I had old code in my codebase! There was a stream class that was opening files "r" instead of "rb" (so it was text mode)
I had fixed that before, but somehow an old copy wound up in my code, throwing everything off.
Real programmers use butterflies
|
|
|
|
|
Good you found it!
|
|
|
|
|
I'd appreciate your feedback on this first draft for my first Tweet; I mean: does it come across as "not woke," or, "virtue signaling," or, could it "trigger" someone's ("vocabulary challenged" ?) delicate sensibilities ?Quote: In spite of Twitter raising the permissible Tweet length from one-hundred-forty to two-hundred-eighty characters, the most compelling reason to never create a Twitter account is the difficulty, if not impossibility, of saying anything intelligent in two-hundred-eighty characters. Does that sound more like a "cheep" than a "tweet" ?
thanks, in advance, for helping me come out of the gate ready to gallop !
p.s. do you think a post like this might get a following (stalking ?) from other OCD Tweeters; or, get me flamed by the "Remember140" collective; or, attacked for contributing to climate change by wasting pixels ?
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
BillWoodruff wrote: of saying anything intelligent in two-hundred-eighty characters.
Brevity is a sign of superior intelligence.
See?
|
|
|
|
|
Marc Clifton wrote: See?
C? FTFY
The less you need, the more you have.
Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?
JaxCoder.com
|
|
|
|
|
O
IC
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
!U2?
The less you need, the more you have.
Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?
JaxCoder.com
|
|
|
|