Hungarian Notation Flamewar
-
well hello there good reason for using the canonical variable i with for loops!
.... because i'm not going to hire you if your variables are single letters?
Yup, pretty good reason.
-
not unless there's a damn good reason for it.
quoting the rest of my post to provide context you seem to have missed. ;-)
-
-
... okay... you missed context, changing the meaning of my words, and then cleverly made use of hyperbole (which BTW overlong variable names are also a negative mark. i like the mamabear variable lenghts) to show that my words, when used out of context were wron g.
-
-
-
-
Just when I was on a roll with Jurassic Park quotes you had to pull a YOLO.
Eff-it. YOLO.
-
-
-
-
I never would have expected you of all people to post a screenshot with a mouse cursor visible!
-
It's a frame from a YouTube video. I am not willing to look up and play that terrible, terrible Newgrounds game myself.
-
or even
typedef byte* Image;
if you don't need anything other than the raw bytes.
Doesn't work, because it's equivalent to
typedef byte* Video
and in code you are then allowed to do
Video vid; Image im = vid;
-
func Foo() { type Video *byte type Image *byte var video Video var img Image = video // error! _ = img }
Not sure why you're using a pointer to a single byte as an image or a video, but whatever floats your boat...
-
I'm guessing you haven't done much C? That ends up being the same as an array of bytes.
-
Well, personally, for an image, I'd be more likely to use something like
typedef struct pixel { uint8_t r; uint8_t g; uint8_t b; } pixel; typedef struct image { uint16_t i_width; uint16_t i_height; pixel i_data[]; } image; image * image_new(uint16_t width, uint16_t height) { image *i; i = malloc((sizeof *i) + width * height * (sizeof i->i_data[0]) i.i_width = width; i.i_height = height; return i; }
Or probably different in all the details because I've never ever worked with images in C. Would probably depend on what libraries I'm using too.
And as @mott555 said, a
byte*
would likely be a pointer to an array of bytes in this case. As far as I knowbyte[]
wouldn't be a valid type in most contexts.
-
Creating a derivative strong type takes just one line of code in Ada.
There's should be a flag for mentioning Ada. Maybe "profanity."
-
byte
is a type in Go, but it's not a type in C, so I assumed it was strangely formatted Go code.
-
One of the complaints about Ada is that it's verbose on a level rivaling COBOL.
Not mention, the compiler, although in my experience it might just have been that it was on a Vax. Forget to instantiate the screen I/O package for every single derived type? Too bad, you're going to get 23 5- or 10-line errors, one for each potential instantiation that isn't correct. As a bonus, the compiler will truncate the error to 3 lines if output to screen (but not to a file) so you eventually learn that "this particular pile of errors means [whatever it actually means, because you're not going to guess from the actual error text unless you are already competent at Ada, which rules out most first-semester students]".
-
-
Everything is an array of bytes, you doofus.
I was going to make a metaphysical joke about this but I'm too lazy, so please accept this unfunny joke premise in place of a real joke with real humor.
-
What about the elements of an array of bytes?
-
cause compilation errors if you try to do:
Image a;
ZipFile b;
a = b;Obviously that's because you forgot to say a = (byte *) b;
-
because i'm not going to hire you if your variables are single letters?
Bigot!
But seriously, how is "ctr" or "counter" better than "i"? Answer: because some pedant said so.
-
well hello there good reason for using the canonical variable i with for loops!
So you were lying when you said you didn't like single-letter variable names? Or are you going to fire yourself?
-
-
func WriteString(w Writer, s string) (n int, err error)
Are there better names for the parameters of this function?
-
What about the elements of an array of bytes?
An array of single-item arrays. Next question?
-
What is the length of a single-item array of bytes?
-
Are there better names for the parameters of this function?
Shouldn't you be asking @accalia? She's the one with long-but-not-too-long-but-also-too-cold name fetish.
-
....
.... because i'm not going to hire you if your variables are single letters? not unless there's a damn good reason for it.
hmm..... context is important to understanding but a barrier to pedantry...
sorry. i've handed out two flags today for abusing this particular post in that particular way.... got anything better?
-
Beating everyone to the joke, it's arrays of bytes all the way down.
-
What is the length of a single-item array of bytes?
A single-byte array with value 1.
Before you ask, it's arrays all the way down.
-
-
got anything better?
Since I already earned a flag from you today, I'm ok with you not flagging that particular post. Unless you want to to spite me.
-
She's the one with long-but-not-too-long-but-also-too-cold name fetish.
among others.
for example, if you really want to get me going show me code that is well documented and the documentation matched the code both in function and intent. mmm.... i like that..
;-)
-
-
Yeah, I figured. Where do I go now?
-
an array of bytes
-
That'll teach ya to ask questions like that.
-
-
nioce try. pedantry quotient exceeded for today.
besides picking on my spelling errors.... not exactly original, y'know?
-
-
Everything is an array of bytes, you doofus.
Everything can be represented by an array of bytes. That's the entire premise of every Von Neumann computer.
However, an image isn't the same thing as an array of bytes. An image can be represented by an array of bytes. Pretty critical distinction.
-
Whooosh!
I was (pretending to) follow the "flamewar" in the title, not actually say something about representations, as you probably could tell by what you elided from what you quoted.
-
how do you store the length of an array of bytes?
-
have its uses where you just can't be arsed to create a derivative strong type for each and every variation of data.
Which obviously won't help in anything dynamically typed, is almost impossible in C and Java (and occasionally even C# as structs have somewhat limited features) and insane amount of typing in C++¹. Really the only language where it is reasonably easy seems to be Haskell… (and Rust)
Creating a derivative strong type takes just one line of code in Ada.
Hm, looks like I have gaps in my education. But then I am guessing there are other sentiments against that, right?
Yes, one of C's many WTFs.
C's almost useless typedefs (well, you needed them in C to avoid having to write
struct
all over the place) become immensely useful in C++ where they allow defining related types that make templates orders of magnitude more useful.
I've been meaning to try D for a while now.
D has missed it's day in those silly Phobos vs. Tango war and language development went on meanwhile and that cross between C++ and D is no longer novel. Instead proceed straight to Rust, which is a cross between C++ and Haskell instead.
Filed under: more profane words
-
D has missed it's day in those silly Phobos vs. Tango war and language development went on meanwhile and that cross between C++ and D is no longer novel. Instead proceed straight to Rust, which is a cross between C++ and Haskell instead.
Sad but true. Rust does seem to be the best candidate we have for chucking the C family out the window for systems programming...
-
how do you store the length of an array of bytes?
With another array, whose length is the number of elements in the array.
I told you it's arrays all the way down!