Things that Dennis Ritchie got wrong.
-
Do not trust them!
is there any situation where nasal demons should be trusted?
anyone? hello? Bueller?
-
Not all men's pants are endowed with UberPockets of Holding™,
I can fit my nexus 7 in all of my trousers, including my skinny jeans
-
Not all men's pants are endowed with UberPockets of Holding™
I've never found a pair of pants that fitted me which didn't also have enough room for a 5.5"
phonefondleslab.
-
- Are you using your front or your back pocket for your phone?
- I suspect part of the problem is that I'm more-or-less a rail, as far as body builds go...
-
Yes, women always say stuff like this. But they want big pockets to carry stuff that also look just like pants that don't have big pockets. Especially when the pockets are full. And we all know which side of that wins the fashion argument.
It's like they never heard of belts and clipping things to them...
-
I've never found a pair of pants that fitted me which didn't also have enough room for a 5.5" phone fondleslab.
All of my pairs of jeans, which aren't particularly large, have big enough pockets to fit both of my phones in. Side by side.
-
I use my chest pocket.
-
@Kian: said:
++++++++++a is valid and well defined, which means ++(++(++(++(++a))))
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVIL!I do like pre-increment (and only use post-increment when absolutely needed), but if I ever review a line like that, it will be rejected with extreme prejudice.
-
Google returns http://www.quora.com/Why-does-the-pre-increment-operator-in-C++-gives-lvalue-instead-of-rvalue-as-in-C, which indicates pre-increment and decrement are lvalues in C++, but rvalues in C.
I'm more of a C++ person than a C person, so that would probably mostly explain why I was wrong.At the time, Pascal strings were hard-limited to being at most 255 characters long
Possibly I wandered into a self-set trap there by saying "Pascal string" instead of "counted string", but I see no reason that the count size would have to equal the character size.
-
Phablets need to DIE. Not all men's pants are endowed with UberPockets of Holding
Gibberish! Arrant nonsense!
A phablet will fit just fine in the kind of regular pockets you'd find in regular jeans.
-
Possibly I wandered into a self-set trap there by saying "Pascal string" instead of "counted string", but I see no reason that the count size would have to equal the character size.
It was an idiotic decision by the early Pascal implementations, as even in 1970 it would have been clear that strings would quite soon be used to deal with more than 255 characters at once. The C style of strings has proved to be far more future proof, an ostensibly better design (though with some bad downsides when used by people who don't know what they're doing).
We're at the point now where we know how to do strings of fixed-size characters perfectly. There literally won't be any major new innovations there. Strings of variable-size characters (a big shout out for UTF-8 there in the audience!) are not quite as thoroughly solved yet.
-
A phablet will fit just fine in the kind of regular pockets you'd find in regular jeans.
To which I say "front pockets or back?"
Back pockets are phablet-sized, more or less, considering they generally accommodate graphing calculators to a degree as well...but front pockets? I have a Nexus 5 and that thing + its case barely fits into my jeans front pockets...and they're 'regular jeans' by pretty much any definition of the word.
-
To which I say "front pockets or back?"
If you put your phone in your back pocket, you're an idiot who will eventually sit on it, therefore I meant front.
I carried my Note II (5.8" screen?) around for nearly two years in jeans front pockets, regular Docker-style pants pockets, and shirt pockets, with no trouble. My new G3 is only a few mm smaller in each dimension and it fits fine.
-
We're at the point now where we know how to do strings of fixed-size characters perfectly. There literally won't be any major new innovations there. Strings of variable-size characters (a big shout out for UTF-8 there in the audience!) are not quite as thoroughly solved yet.
Have you looked at the Python 3.3/3.4 variable-encoding string implementation lately?
-
If you put your phone in your back pocket, you're an idiot who will eventually sit on it, therefore I meant front.
I have no idea how women do that, I'd break it in 5 minutes.
-
The C style of strings has proved to be far more future proof, an ostensibly better design (though with some bad downsides when used by people who don't know what they're doing).
IMO, the main problem with C-style strings is that strcpy() and strncpy(), and probably a bunch of other functions I'm not thinking of righ tnow, do not accept target buffer size arguments.
strncpy illustrates a kind of problem too, as it does not maintain null-termination. In standard libc, it is too easy to accidentally get a string that is not null-terminated.
-
I have no idea how women do that, I'd break it in 5 minutes.
I don't think I've ever seen any women do that. One of my coworkers keeps her phone in her purse, though, guaranteeing it'll take a long time to answer.
-
IMO, the main problem with C-style strings is that strcpy() and strncpy(), and probably a bunch of other functions I'm not thinking of righ tnow, do not accept target buffer size arguments.
Well, technically that's more of a library issue.
FWIW Microsoft provides (proprietary) counted extensions, and I guess there's nothing stopping you from writing your own.
-
Hence the _s() versions, and compilers that yell at you if you use the old "unsafe" versions.
But yeah, I never did understand why those took so long.
That said, these days I'm either using a full Unicode string library, or fixed-length buffers on the embedded machines with no file system.
-
I don't think I've ever seen any women do that. One of my coworkers keeps her phone in her purse, though, guaranteeing it'll take a long time to answer.
Really? My wife does it all the time, and I rarely see any men do it.....it's usually women.
-
Really? My wife does it all the time, and I rarely see any men do it.....it's usually women.
I don't think my wife even owns any pants with pockets at all. She tends to carry it in her hand or coat pocket.
But she got a case with her new phone that has a belt clip so she might start wearing it that way.
-
I don't think my wife even owns any pants with pockets at all. She tends to carry it in her hand or coat pocket.
But she got a case with her new phone that has a belt clip so she might start wearing it that way.
My wife often wears jeans, so that might do it.
-
My wife often wears jeans, so that might do it.
Maybe women's jeans have smaller front pockets or something.
-
@tarunik might be wearing the wrong jeans then.
http://what.thedailywtf.com/t/things-that-dennis-ritchie-got-wrong/5639/112?u=loopback0
-
Maybe women's jeans have smaller front pockets or something.
That's my thinking, I'm just surprised that you see more men doing it than women.
-
Wasn't there a photo included in a post last time the size of pockets came up (or maybe time before last) that demonstrated this?
http://what.thedailywtf.com/t/the-official-thread-of-oh-oh-oh-status/1673/5618
Preview is not showing stuff so maybe I can grab the image directly
-
Are you using your front or your back pocket for your phone?
Front. I've never used a back pocket for anything.
It's like they never heard of belts and clipping things to them...
My build precludes that approach. It would even if I got around to losing weight (OK, not over Christmas for sure!)
-
WTF? I've never seen male jeans which have had pockets that shallow?!
-
That is the point. Was in response to a conversation about lack of proper pockets on women's pants from like two weeks ago. Just pointing out that @chubertdev and @FrostCat were talking about women's pants lacking proper pockets had been demonstrated a little bit ago.
-
@delfinom said:
There are plenty of instances where I have if (some error condition)goto error_cleanup;
You're the worst of the terrible people.
What's wrong with that, the goto or lack of braces?
-
Is this picture him, or his SO?
-
It's in a thread I don't have set to Tracked, so hadn't seen it before.
-
-
Is this picture him, or his SO?
<!-- -->
I'm on my way to a night out with a lady friend. I will attempt to get my enormous phone in her pants for science.
Oh, didn't notice the comment till I tried to include your quote.
-
IMO, the main problem with C-style strings is that strcpy() and strncpy(), and probably a bunch of other functions I'm not thinking of righ tnow, do not accept target buffer size arguments.
strncpy illustrates a kind of problem too, as it does not maintain null-termination. In standard libc, it is too easy to accidentally get a string that is not null-terminated.
The only
str*
functions I actually like arestrlen
,strcmp
andstrncmp
; they do exactly what they say on the tin. I supposestrchr
isn't too bad either, though I don't use it that often.The modifier functions? Don't like them at all. Much prefer
memcpy
, which requires the number of bytes to transfer as an argument. I admit that I really don't know if that really gives better habits or improved speed, but it hasn't steered me wrong.
-
Remember, every extra whitespace character means it takes the compiler so much longer to compile your code.
Premature optimisation something something.
-
What's wrong with that, the goto or lack of braces?
Yes, both of those things are pretty evil.
-
The only str* functions I actually like are strlen, strcmp and strncmp; they do exactly what they say on the tin.
They all do [incomprehensible abbreviation]?
-
They all do [incomprehensible abbreviation]?
Yes,
strincmprhnsblbbrv
is one of my favourites.
-
mysql_real_strncpy()
-
My top three haven't even been mentioned.
- Bitwise operator precedence. It's just a|l wrong & dumb.
- Bitwise and logical operators are swapped. & should be && and && should be &.
- No local macros. I have to #define and then #undef and hope I didn't stomp anything. Lame.
The broken-ass library functions don't help either. But at least modern libraries have several, different, often-also-still-broken, not-so-standard replacements. :/
-
Bitwise and logical operators are swapped. & should be && and && should be &.
Even emulated/copied in VB .NET unintentionally, when they didn't want to break/change how
And
works.
-
No local macros. I have to #define and then #undef and hope I didn't stomp anything. Lame.
That's only one aspect of the many that are wrong with C macros. The fact that doing anything complex with them is deeply tricky is another piece of evilness (and I hate how there's nothing like a Lisp
gensym
available).But at least macros are no longer expanded in strings or comments! That's got to count for something, right?
-
A gensym would be nice. I don't think I've ever encountered a language feature as devastatingly powerful as C macros. But I still wouldn't call them deeply tricky. How would you suggest making them less tricky? I really don't know what you mean.
-
@tarunik might be wearing the wrong jeans then.
They're an otherwise perfectly cromulent pair of Wranglers.
-
But at least macros are no longer expanded in strings or comments!
You mean if I did
printf("Value of DAYS_PER_WEEK is %d\n", DAYS_PER_WEEK);
it used to print "Value of 7 is 7"?
-
You mean if I did
printf("Value of DAYS_PER_WEEK is %d\n", DAYS_PER_WEEK);
it used to print "Value of 7 is 7"?Yes, in traditional K&R C it did that. This was one of the big changes in C89, and significantly defanged the worst of C macros; a big mistake of Dennis's that got fixed within his lifetime.
-
I don't think I've ever encountered a language feature as devastatingly powerful as C macros.
Check out Lisp or m4 sometime.
-
And we all know which side of that wins the fashion argument.
The back side, which is made look big by the pants, but heaven help you if you answer that question?
-
"Do these pants make my butt look big?"
"That's a skirt, darling. You're not wearing pants."