Hungarian Notation Flamewar
-
One problem: If we define a byte as a one-length array of bytes, that's an invalid recursive type.
-
OneNo problem: If we define a byte as a one-length array of bytes, that's aninvalidrecursive type.FTFY.
-
-
I can't help it if your favorite language is broken.
-
One of the complaints about Ada is that it's verbose on a level rivaling COBOL.
Still not verbose enough for my tastes*:
end case; --stage end if; --program stage := next_stage; end if; --RST end if; --clk end process; --core end architecture behavioral;
*based on my understanding that VHDL syntax is the same as Ada syntax (I'd love to code in Ada, but never hada good opportunity).
-
end Ada; -- for humanity
-
As for the original topic: I think the best argument in favor of Hungarian notation is dimensional analysis: people might want to just define Length and Time and all the rest as classes independent of the measurement system, and never have to deal with actual ints and floats, but in practice that becomes a leaky abstraction: it's not hard to come up with real world quantities so disparate that you end up with severe numerical errors in any naive approach, or end up using arbitrary precision in a lot of places that regular precision would have done just fine.
Sure the idea of strongly-typed everything sounds nice, but I think you'll find that botany is an intolerable hotbed of vicious politics, big egos, and parsimonious trees and imo a bit of loose typing here and there is an acceptable trade-off for never having to deal with that kind of thing.
-
Hm, looks like I have gaps in my education. But then I am guessing there are other sentiments against that, right?
It's never too late to learn something new:
type age is new Integer range 0..140;
-
>type age is new Integer range 0..140;
Don't forget about subtypes, which I mercifully can't remember the syntax for.And don't forget
type length is new integer range 0..140;
which is not compatible with age!
-
Are you saying that premature babies don't have valid ages and that nothing can be more than 140 years old?
-
Yeah, what others have said about Systems/Apps Hungarian being obsolete.
Ogre has Ogre::Degree and Ogre::Radian, which can be used to prevent mixing types, or (in this case) to correctly handle copy/assignment in the first place. Spolsky's method may have been somewhat relevant in the 80's, but it's brittle.
-
Apps Hungarian
…is a butt-ugly formalization of something every sane programmer does anyway.
-
Are you saying that premature babies don't have valid ages
Of course not. The moment of birth is age zero, duh. While they're negative from when they SHOULD have been born, people don't keep track of what their birthdate SHOULD have been except to note that developmental milestones track with the estimated birthdate, not the actual one. (Yes, I know someone who was born 4 months early. Her birthday is in June, not August, etc.
-
for( int helloThisIsTheFirstLoopVaribleFriends = 0; helloThisIsTheFirstLoopVaribleFriends < 100; helloThisIsTheFirstLoopVaribleFriends ++ ){}
-
All hail the newest Knight of the Most Honourable Order of the Bath!
-
Everything is an array of bytes, you <!-- this next word is a joke --> doofus.
And every expressible representation of an array of bytes, is an arrangement of atoms.
-
The completionist in me.... must have all badges....
Must learn to be a dick....
Must say something dickish....
"I HATE BABIES"...
-
i dealt with that connumndrum this way:
- the pedantry badges are a badge of shame
- i don't want badges of shame.
-
It's all perspective.
For example.
The scarlet letter is pretty popular these days.
Hell, if your current spouse has the dickweed badge, the scarlet letter badge is practically a trophy.
-
Still trying to figure out why the very mundane act of breathing demands to be rewarded with "happyness"
-
there you go. that's why.
-
All I see is "Ho Ho Hnh", which sounds like Santa got abducted with chloroform to the face.
Maybe if your Scrooge it would be rewarding. But all the kids would cry.
-
structural formula for Dopamine!
-
This post is deleted!
-
1: yes, by my definition
- yes
- currently single, so that is vacuoulsy yes.
1.... I WAS ANSWERING THOSE!
:-P
-
It got too serious.
I moved it to my facebook.
-
thus guaranteeing that i cannot reply. ;-)
i gots no facebook no more.
-
And every expressible representation of an array of bytes, is an arrangement of atoms.
It doesn't need to be, given that it could be encoded as a beam of light without too much trouble. Encoding as electrons would also be quite straightforward. Bits (from which bytes and arrays of bytes are assembled) are pure information, and so do not need atoms.
Atoms are just a handy way to keep those bits around.
-
?obj.GetType() == typeof(particle) true ?obj.GetType() == typeof(wave) true
hmmm...
-
-
?obj.GetType() == typeof(Particle)
true
?obj.GetType() == typeof(Wave)
truehmmm...
interface IParticle : IEnumerable<Behavior> { } interface IWave : IEnumerable<Behavior> { } class Particle : IParticle { ... } class Wave : IWave { ... } class ParticleAndWave : IParticle, IWave { private Particle _particle; private Wave _wave; public GetEnumerator<Behavior> { foreach(var behavior in _wave) { yield return behavior; } foreach(var behavior in _particle) { yield return behavior; } } }
-
The return of the _Dark _Underscore _Cult!
-
Well,
Photon
,Electron
andAtom
all inherit fromParticleAndWave
, but are not themselves subclasses of each other at all. However,Atom
is a container forElectron
s; you've gotta love those has-a relationships.
-
-
You're not missing much.
on the contrary! i'm missing all the annoyance of trying to sort through the baby pictures and the lunches, both before and after eating, and the inane griping and the emo vaguebooking and... well all the crap, for the posts of the couple of people from college that i actually wanted to keep in touch with.
it finally got to the point where i consider that a win.
-
on the contrary! i'm missing all the annoyance of trying to sort through the baby pictures and the lunches, both before and after eating, and the inane griping and the emo vaguebooking and... well all the crap, for the posts of the couple of people from college that i actually wanted to keep in touch with.
Now, on the other hand, you'll be with an even larger group of People Who Deleted Their Facebook And Won't Shut Up About It Ever.
Still better than baby pics, though. Those things are nasty.
-
eeeh. i only mention it when someone mentions facebook.
at that point i figure it's fair game.
-
-
What about babies eating lunch?
-
-
Well,
Photon
,Electron
andAtom
all inherit fromParticleAndWave
, but are not themselves subclasses of each other at all. However,Atom
is a container forElectron
s; you've gotta love those has-a relationships.class Photon : ParticleAndWave { } class Electron : ParticleAndWave { } class Atom : ParticleAndWave { Enumerator<Electron> _electrons; }
That works for me.
Photon, Electron, and Atom may not be subclasses of each other, but they are subclasses of ParticleAndWave.
I'm my cousin's cousin, not my cousin's son.And besides, inheritance should be based on commonality of behavior and traits, not is-a relationships.
The model-the-world is an anti-pattern. It should be, model the behavior.
-
i'm missing all the annoyance of trying to sort through the baby pictures
So lucky... I added one of my former coworkers on G+, and get a constant flow of short videos of his children on my page. Is there a way to not get things from someone without blocking them? If so, Google does not make it easy.
-
Meh, I like it.
It's an easy way to allow me to name the exposed property, and it's underlying data the same. And the _names aren't exposed, so it doesn't matter to the interface anyway.
-
there's a way you can do it via circles... but i forget how you do it. something about putting them into a certain circle and then saying you don't want that circle on your main page
-
What about having babies for lunch?
-
Well, then you should use the time-honored
m_c_im_thing
. After all, the more information your compiler already knows that you can put in the name, the better. I mean, it isn't like camelCase things are already supposed to be non-public.
-
-
New feature.
Friend level.
0 - You've been blocked. They no longer like you, but don't want to be fooled by an invite after you change your handle.
1 - You won't show up on main page at all. This is your warning. You are teetering on the cliff of "not evil" and about to fall in. Maybe you should have liked their pumpkin pie recipe.
2 - You won't show up on main page with exceptions. If you mention something in their "really really likes" category, it will show up. Don't abuse this, or you might drop a level. They like you, but you're getting annoying.
3 - Your most upvoted items of the day show up, along with anything in their "likes" categories. You're cool, but way too talkative.
4 - You show up. Apparently you know how to wait until you have awesome to show. Good job, dear friend. Or maybe you're a celebrity or personality and this user is a creepy stalker. If that's the case, you should reciprocate with a fat 0, so they don't fool you again.
-
And besides, inheritance should be based on commonality of behavior and traits, not is-a relationships.
No.
Really, I mean this.
-
Ok, my language interpreter broke.
this is?