naming-conventions

What is the best practice for naming private and static private methods in C#?

荒凉一梦 提交于 2019-12-22 04:09:11
问题 I'm trying to figure out what is the smartest way to name private methods and private static methods in C#. Background: I know that the best practice for private members is underscore-prefix + camelcase. You could argue this with me, but trust me I've seen enough code from hardcore pros that follow this convention, it is the skilled industry standard. I also know that pascal case is the industry standard for public methods. But I have seen a combination of test style naming (ie. method_must

Should I keep bad naming conventions?

六月ゝ 毕业季﹏ 提交于 2019-12-22 04:07:52
问题 I'm currently working on a site which went through god knows how many developers' hands. One of the things I don't like about it is the way every table in the database has the prefix "tbl_" and every field "fld_". I've started work on a new feature and I'm faced with the following problem: should my new tables continue with the old convention, or not? I guess I should, but I feel stupid doing it :) 回答1: I would keep the same convention.. Regardless of if it's bad or not at least it would be

Naming a dictionary structure that stores keys in a predictable order?

寵の児 提交于 2019-12-22 04:06:46
问题 Note: Although my particular context is Objective-C, my question actually transcends programming language choice. Also, I tagged it as "subjective" since someone is bound to complain otherwise, but I personally think it's almost entirely objective. Also, I'm aware of this related SO question, but since this was a bigger issue, I thought it better to make this a separate question. Please don't criticize the question without reading and understanding it fully. Thanks! Most of us are familiar

Naming conventions for boolean attributes

前提是你 提交于 2019-12-22 03:07:13
问题 I want to write code that others easily can understand as well. Do boolean attributes like hide_email or email_hidden have a convention style? 回答1: I think of it like this: A boolean attribute should answer a simple yes/no question. Asking "is?" is a simple way to ask a yes/no question. So a boolean attribute name should complete the sentence is <attribute_name> Then just remove the is because Ruby prefers the ? suffix for "is"-style method names (see below for more), leaving you with just

Naming conventions for controls

浪子不回头ぞ 提交于 2019-12-21 20:58:04
问题 While working with VS by default the editor generates this: <asp:Button ID="Button1" runat="server" Text="Button" /> Now the ID generated is Button1 i.e First letter capital. My questions is what is the best way to name the controls ? SubmitButton btnSubmit or something else? Which naming convention is considered good ? 回答1: btnSubmit is Hungarian notation which I don't personally consider good for UI programming since the type of control is evident directly through its declaration or

What naming conventions do you use in C#? [closed]

时光怂恿深爱的人放手 提交于 2019-12-21 13:02:51
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . As a beginning programmer, I'm trying to settle on a standard naming convention for myself. I realize that it's personal preference,

What is this functional “pattern” called?

徘徊边缘 提交于 2019-12-21 12:37:33
问题 I was fooling around with some functional programming when I came across the need for this function, however I don't know what this sort of thing is called in standard nomenclature. Anyone recognizes it? function WhatAmIDoing(args...) return function() return args end end Edit: generalized the function, it takes a variable amount of arguments ( or perhaps an implicit list) and returns a function that when invoked returns all the args, something like a curry or pickle, but it doesn't seem to

What is this functional “pattern” called?

拟墨画扇 提交于 2019-12-21 12:35:24
问题 I was fooling around with some functional programming when I came across the need for this function, however I don't know what this sort of thing is called in standard nomenclature. Anyone recognizes it? function WhatAmIDoing(args...) return function() return args end end Edit: generalized the function, it takes a variable amount of arguments ( or perhaps an implicit list) and returns a function that when invoked returns all the args, something like a curry or pickle, but it doesn't seem to

HTML element for ad?

耗尽温柔 提交于 2019-12-21 07:56:39
问题 Is there any authoritative information on the web concerning which HTML element to chose for an advertisement banner? I considered <article> or <aside> , but I think more appropriate is simply: <div class="ad"> 回答1: In most cases I'd use the aside element: The element can be used for […] for advertising , […] and for other content that is considered separate from the main content of the page. As the aside element is a sectioning element, it creates an entry in the document outline, even if

C# Float vs. VB.net Single - Namin' complainin'

邮差的信 提交于 2019-12-21 07:06:58
问题 Why is it called a single in VB.net? I'm sure there is a good reason but it doesn't seem intuitive to a non formally trained programmer like me. 回答1: BPAndrew's question seems to be really "why float in C# and Single in VB.NET", which noone actually answered, so here's my 2p... The use of "float" in C# seems to be a throwback to its C/C++ heritage. "float" still maps to the System.Single type in C#, so the keyword just exists for convenience. You could just as well declare the variable as