naming-conventions

Objective C naming convention for method performs an action and returns a value

女生的网名这么多〃 提交于 2020-01-26 03:14:07
问题 I have a method that performs an action and returns a value. For example from the input number it will update class's input history, then generate and return an input record. So how do I name this method? I think even C has this problem, e.g. fopen function does open a file and return a handler. But with Objective C convention it seems difficult to name the method. From apple document for cocoa name convention and also from this article cocoa with love They both said " If a method performs an

Naming convention for property [closed]

本小妞迷上赌 提交于 2020-01-24 10:58:00
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . Which one is preferable or more clear? public int FrozenRegionWidth { get; set; } Or... public int WidthOfFrozenRegion { get; set; } 回答1: I'd say FrozenRegionWidth, otherwise you'll end up with a whole bunch of properties starting with 'WidthOf..'. Having said that, shouldn't

Naming convention for property [closed]

╄→尐↘猪︶ㄣ 提交于 2020-01-24 10:57:15
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . Which one is preferable or more clear? public int FrozenRegionWidth { get; set; } Or... public int WidthOfFrozenRegion { get; set; } 回答1: I'd say FrozenRegionWidth, otherwise you'll end up with a whole bunch of properties starting with 'WidthOf..'. Having said that, shouldn't

Would you call it level or depth?

和自甴很熟 提交于 2020-01-24 02:59:06
问题 Which word would you pick to label the absolute stack level of an element—in other words its degree of nesting relative to the root/document element? Between level and depth which one would you choose and why? What is commonly used or preferred? Which one would you find less confusing in the absence of a meaningful context? I tried checking the XML specification without much success. 回答1: I call it Depth . As we know, XML is a Node based structure . We all know that in Data Structures we use

Naming Classes - How to avoid calling everything a “<WhatEver>Manager”? [closed]

倾然丶 夕夏残阳落幕 提交于 2020-01-18 04:31:07
问题 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 . A long time ago I have read an article (I believe a blog entry) which put me on the "right" track on naming objects: Be very very

What are drawbacks of naming controllers in singular form is Rails?

喜夏-厌秋 提交于 2020-01-15 05:27:07
问题 I know in Rails we follow conventions. And we should name controllers in plural form. Recently I hired a freelancer to help me with one part of my application in Rails as I'm really new to this framework and ruby. I had a PortfolioController - this is just feels right because portfolio is a container for entries (who says "I have portfolios"?). The freelancer said it's not right and I will have troubles not following the convention and renamed it to PortfoliosController . I asked several

Python sequence naming convention

拟墨画扇 提交于 2020-01-14 13:49:32
问题 Since there is no explicit typing in python, I want to be able to make the difference between sequences and non-sequences using a naming convention. I have been programming with python for a little while now, and I still haven't found any logical/practical way to name sequences. Of course, I went through the famous PEP8, and made some research on google, and it seems that the accepted convention is to add the letter "s" at the end of the variable name. Let's assume we have a sequence of

Interface naming convention for method returning Task [closed]

戏子无情 提交于 2020-01-14 10:19:20
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Consider the following interface and implementations. interface IService { Task<string> GetAnswer(string question); } class SomeService : IService { async Task<string> IService.GetAnswer(string question) { ... code using awaits ... } } class AnotherService : IService { Task

Spring service and repository layer convention

霸气de小男生 提交于 2020-01-14 09:38:07
问题 I start working with Spring and have some confusions about its conventions. Is it fine to put Repositories in Controller? In a Service class, If I want to reuse code could I inject other Services and other Reposities ? is it the best practice to name Service And Repository class is based on Entity name i.e: User -> UserRepository -> UserService ? 回答1: No, don't use Repositories in the Controller. Only in the Services. And don't use Entities in your Controller. Create Dto (Data Transfer

serialVersionUID naming convention

坚强是说给别人听的谎言 提交于 2020-01-14 09:15:47
问题 Is there any viable reason why serialVersionUID field is not named SERIAL_VERSION_UID? According to the docs for java.io.Serializable: A serializable class can declare its own serialVersionUID explicitly by declaring a field named "serialVersionUID" that must be static, final , and of type long: ANY-ACCESS-MODIFIER static final long serialVersionUID = 42L; While referring Java Naming Conventions all static final (constants) fields should be capitilized having its fragments separated with an