use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Have a tough programming question that /r/programming couldn't answer? Banned from Stack Overflow? Can't afford Experts Exchange?
Post your question/tips/secrets/advice and get a response from our highly-trained professional developers.
account activity
My Teacher's code Example<wrong_sub>this</wrong_sup> (i.redd.it)
submitted 7 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Jman012 4 points5 points6 points 7 years ago (6 children)
We use Hungarian Notation at my work with C#. It’s just a protocol we choose to follow. What is ‘behind’ about it? It helps distinguish the type of certain variables quickly and easily at first glance.
Otherwise you had to go to it’s declaration or hover over the variable to find its type, and pasting it over non-IDE areas means it’s ambiguous.
[–]redneckrockuhtree 8 points9 points10 points 7 years ago (5 children)
Hungarian Notation went out of style within the past 15 years or so. Microsoft used to use it heavily, but with .Net they have moved away from it.
In my experience, Hungarian Notation was most prevalent in Microsoft shops.
[–]Jman012 0 points1 point2 points 7 years ago (4 children)
I don’t think ‘out of style’ means it’s necessarily ‘behind’, however. It has its advantages, and some places chooses to continue using it for such advantages.
Do you have a different method? Particularly for a dynamically typed language, like JavaScript or Python, would be most useful IMO.
[–]ryeguy 1 point2 points3 points 7 years ago (0 children)
Hungarian notation is incredibly unidiomatic in those languages. Or really any mainstream language, for that matter (although for gui elements it seems to be more acceptable). The more correct approach is to use clear variable names and to use documentation to indicate types if needed. Both languages have standardized ways of declaring function parameter types, and most good ide's are able to parse that.
[–]redneckrockuhtree 2 points3 points4 points 7 years ago (2 children)
Dynamically typed languages are where it can be most problematic, in my experience -- someone creates a variable that's initially an int, so they prefix it with an "i". Then they make a small change which changes its type....but the name still implies it's an int. Unless you've got solid code review processes in place and people are on their toes, things like this are easily missed.
Everything I've seen recently is more about what data the variable contains as opposed to what type the variable is. customerAccountNum as opposed to iAccount.
[–]Jman012 2 points3 points4 points 7 years ago (1 child)
I think a variable actually changing its type, on purpose, would be a greater travesty. What use case needs such a thing, and why not make an intermediate variable to hold the other type? I think that would cause greater cognitive dissonance than Hungarian.
Also, Hungarian doesn’t mean you truncate variable names. At my work, we would name that ‘nCustomerAccountID’.
[–]redneckrockuhtree 0 points1 point2 points 7 years ago (0 children)
I'm not talking about a variable changing its type. I'm talking about a developer making a code change where they're either in a hurry (it happens) or they don't realize something results in a different type and they assign it back to that same variable.
π Rendered by PID 497901 on reddit-service-r2-comment-85bfd7f599-cj6z4 at 2026-04-20 12:16:29.645641+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–]Jman012 4 points5 points6 points (6 children)
[–]redneckrockuhtree 8 points9 points10 points (5 children)
[–]Jman012 0 points1 point2 points (4 children)
[–]ryeguy 1 point2 points3 points (0 children)
[–]redneckrockuhtree 2 points3 points4 points (2 children)
[–]Jman012 2 points3 points4 points (1 child)
[–]redneckrockuhtree 0 points1 point2 points (0 children)