|
k5054 wrote: Everyone knows that identifiers starting with an underscore are reserved for the implementation. Let me just check that I get this right now: Identifiers not starting with an underscore is for those modules that are not yet implemented. ... Did I get it right this time=?
|
|
|
|
|
The way I understood it is that identifiers that begin with _ are private or supposedly private (for languages that don't enforce such thing) those that don't are public
I might very well be wrong
|
|
|
|
|
Nelek wrote: gin with water What's wrong with that? A dash of Angostura and you have a delicious pink gin. Which reminds me ...
|
|
|
|
|
I suppose you know the three ways of drinking whisky? With water, without water and like water.
|
|
|
|
|
To be honest... no, I didn't know it. But I will remember it Is a good one
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Do not drink pure water! You absolutely have to dilute water with alcohol. 100% water will cause rust!
Get me coffee and no one gets hurt!
modified 4-May-20 18:28pm.
|
|
|
|
|
Marc Clifton wrote: Look, either use underscores or don't. Don't!
|
|
|
|
|
|
Interesting. I wouldn't have even cared.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Either, you have to re-invent every wheel yourself ...
Or you'll just have to be prepared for mixed styles. If you use libraries, type/class definitions, ... whatever developed by others than yourself, you better be prepared for accepting mixed styles with regard to casing, use of underscores, indentation rules (e.g. in header files - you will see them even if you don't see the source code of that library), commenting style (/* */ comment blocks, end-of-line comments, no comments, ...), use of abbreviations in identifiers, ...
Sometimes you see conflicting styles even in a single product. The Win32 functions has a subset of functions taking all essential parameters as a single struct, headed by the struct size, so new extensions to the interface can add is parameter to the end of the struct; the size field indicates which version the caller wants to run. But most functions come in version Func, FuncEx, FuncExEx, ... FuncExExExExEx (yes, five times "Ex" has occurred!), each with its own parameter format/sequence. When your personal preference is strongly with the one style that is used the least, you end up bitching a lot "Why couldn't they always use..." when you type those Ex Ex Ex...
In Norwegian culture, "Aunt Sophie" is a well known figure. Anyone who grew up in Norway since the 1950 knows Torbjørn Egner's "Cardamom Town"[^] story (it has been translated into many languages, so you might know it from your own childhood!). In this story, aunt Sophie is constantly complaining "If just people were like me, the world would be a much better place!" "Aunt Sophie's angry song"[^] is well know to every Norwegian child. Too bad I didn't find an English version!
If you are accused of being an "Aunt Sophie", it means that you are unconditionally requiring everybody to follow your rules, your ideas of what people should think, how they should behave, and everything else, disregaring any counter argument. Being called an Aunt Sophie is certainly not meant as any sort of flattery! I would certainly not like such an accusation!
So I accept reality. There are various established styles out there. You may, in the name of "consistency" cling to your own style, come sun or come rain. Or you may go for the "When in Rome, do as the Romans" (although I know that is a very un-American approach...), adapting your own style to that of the library / subsystem / whatever your are interacting with.
But basing your entire private, political, professional or other life on the premise that everbody will think like you, behave like your, is doomed to failure.
|
|
|
|
|
From Aunt Sophie's own dictionary:
selfish adj. Defines someone who does not think of me.
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
You also don't know how to use the apostrophe. APIs 🤦♀️
|
|
|
|
|
I agree completely.
Consistency eases the mind and the eye, clearing your head to think about important matters instead of how this particular variable is cased.
Consistency in code can reduce errors and so create consistent quality as well (or maybe it's the other way around).
If I find inconsistent code I immediately assume it's written by some bungler who was so occupied understanding basic programming that there was simply no mental space left for consistency.
And usually I'm right.
If you can't even get consistency right, the rest of the code probably sucks as well.
When I look at that library I also see variables such as "username_val", where I presume "val" is short for "value".
What else than a value are you going to enter anyway?
It seems like an API created by a government, 'nuff said
|
|
|
|
|
Sander Rossel wrote: If I find inconsistent code I immediately assume it's written by some bungler who was so occupied understanding basic programming that there was simply no mental space left for consistency.
Slight disagreement there. The bunglers with which I work not only don't understand basic programming, they have no interest in learning.
|
|
|
|
|
Consistent standards would be nice. I haven't seen any code that included a style guideline, though it might be helpful if the naming convention is complicated.
|
|
|
|
|
Hey, you must be trying to use our API!
Don't worry, the inconsistent names will be the least of your problems.
|
|
|
|
|
Parsers are really easy to write code generators for. The hard part is generating the parse tables - the data used to generate the code, not the generation itself. I decided I wanted something a little more challenging in terms of codegen itself.
I'm writing a generator to implement a GoF visitor pattern over arbitrary .NET types. I tend to use them for searching object trees. It's easier than LINQ for really complicated queries, or queries where there's a lot of nests, /w undetermined paths.
How many of you actually employ such a pattern? Or do you all stick to LINQ now?
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Or do you all stick to LINQ now? Is it not already discontinued?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
really? how out of date am I? what functional programming constructs in C# are we using now?
Real programmers use butterflies
|
|
|
|
|
Isn't functional programming outdated?
|
|
|
|
|
I think a lot of people would disagree. Why do you say so? What about languages like F#, Haskell, Scheme, and technically when you think about it - SQL?
Real programmers use butterflies
|
|
|
|
|
Oh no, the Witch uses Serious, it's super effective.
|
|
|
|
|
was there a joke i missed?
/slow
Real programmers use butterflies
|
|
|
|
|
Not 100% sure... It was supported in all .Net 4.xx but I am not sure if it is being included in .Net 5
Still don't get the big overview.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: Still don't get the big overview.
I don't know if I get your meaning. Let me see if this clarifies. If I misunderstood you, I apologize in advance:
A visitor basically traverses an object tree for you, calling a Visit method or raising a Visit event for each object in the tree. This can allow you to examine each object and determine if it's what you're looking for, at that point allowing you to return it or even possibly modify it
Basically, primarily a visitor is an object tree querying device.
Real programmers use butterflies
|
|
|
|