I'm creating this:
# models.py
class Item(models.Model):
sku = models.CharField(max_length=20)
class Attribute(models.Model):
item = models.ForeignKey(Item, related_name='items')
Is that going to cause naming collisions in Python? Like:
# views.py
some_object.items.create(sku='123abc')
# Is there a place / way that this c...
I'm finding I have lots of conflicts with class names when developing for CodeIgniter. For example, I recently had the situation where I had a Checkout controller:
class Checkout extends Controller
{
// Contents
}
And then went on to create a new custom library:
class Checkout
{
// Contents
}
Which would obviously throw a...
I was wondering how people name variables, objects, and function names with all the combination's out there; camel-case, pascal, using underscores, all caps for statics etc....
A good naming convention that is uniform could create a quicker understanding of what the item is, leading to much faster interpretations...e.g. 'oh its all in c...
Hi.Is there a way to tell JAXB to not remove underscores when creating getter/setter names from XML Schema?
Reason: this causes loss of information and it is harder to trip between XML and Java; e.g. in written communications where one participant might be confused about "different names".
Example: NR_ROR should not become getNRROR but...
Hi,
One thing that constantly causing me headache in programming is when I don't have any naming-convention in a domain where I have to deal with a lot elements. It is clearly what is happening to me when using UI designers such as Windows Forms designer.
Everytime I start a new project I am trying to reinvent a "seem-strong" naming co...
I'm struggling with a terminological conflict and can't figure out a good resolution. Maybe someone else has had this problem.
I'm rebuilding an existing WinForms application to use WPF. I'll be using the MVVM pattern in my new application. My old application makes extensive use of ADO; specifically, I have Row objects that wrap Data...
Which casing looks better to you for a jQuery plugin:
$("#foo").runMyPlugin();
or
$("#foo").runmyplugin();
Is there a naming convention for jQuery that prefers on over the other?
Thanks in advance!
...
I don't remember exactly is it a common pattern but I have a class (Factory Method pattern) which has method for creating other classes (Abstract Factory pattern) depending on enum parameter:
public class FooFactoryFactory {
public FooFactory createFactory (FooFactoryType type) {
switch (type) {
case AFoo:
...
Assuming you have a namespace that is useful to more than one project in your company, in the format of "MyCompany.Core", would you have an assembly named exactly the same way or just "Core". Why or why not?
...
It would hold a string and have characters (numeric, or decimal point) added and removed from the right end. Ignore the case of negative numbers for simplicity.
Does this kind of data structure have an agreed-upon name? Register? Buffer? Display? Something else?
UPDATE: This is an internal representation and may not be the final form o...
I'm trying to determine if a local variable in C# should be named "corpID" or "corpId".
See the difference? Should the "d" to be upper case or lower case?
Consider this one also:
customerPK vs. customerPk
It matters more if another word is added the end. Like this:
customerPKField vs. customerPkField
See my delima? Is there a wi...
My website deals with pictures that users upload. I'm kind of conflicted on what my picture filename should consist of. I'm worried about scalability simply and possibly security? Maybe someone out there deals with the same thing and can tell me what their use on their site?
Currently, my filename convention is
{pictureId}_{userId}_{sa...
How can I train myself to give better variable and function names (any user-defined name in a program).
...
Is it common to name an assembly one name, name a folder inside of the assembly another and then
start to carry those names into the classes inside of those folders? For example:
Project.Presenter
Carriers
CarriersFindPreferedCarriersPresenter.cs
CarriersPreferencesPresenter.cs
PreferredTargetLocationPresent...
In Java you can access variables in a class by using the keyword this, so you don't have to figure out a new name for the parameters in a function.
Java snippet:
private int x;
public int setX(int x) {
this.x = x;
}
Is there something similar in C++? If not, what the best practice is for naming function parameters?
...
It seems that it would be wise to use def, fn, or fun for function definitions similar to Ruby or other succinct languages.
Now that it's too late to change things due to potential compatibility issues, the whole world is forced to suffer using that wasteful long name 'function' everywhere in JavaScript code.
...
What is the correct name for the following Java class:
DVDPlayer or DvdPlayer?
...
Being that they must be unique, what should I name FK's in a MySQL DB?
...
Microsoft says fields and properties must differ by more than just case. So, if they truly represent the same idea how should they be different?
Here's Microsoft's example of what not to do:
using System;
namespace NamingLibrary
{
public class Foo // IdentifiersShouldDifferByMoreThanCase
{
protected...
In an objective-c class that can be initialized through different init... methods, it is common sense to collect initialization code that is common to all initializers into one common method that is called from the other init* methods (or also sometimes from awakeFromNib).
Is there a convention for how this method should be named? initi...