Search Results

Search found 1759 results on 71 pages for 'naming conventions'.

Page 11/71 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Why are getters prefixed with the word "get"?

    - by Joey
    Generally speaking, creating a fluid API is something that makes all programmers happy; Both for the creators who write the interface, and the consumers who program against it. Looking beyond conventions, why is it that we prefix all our getters with the word "get". Omitting it usually results in a more fluid, easy to read set of instructions, which ultimately leads to happiness (however small or passive). Consider this very simple example. (pseudo code) Conventional: person = new Person("Joey") person.getName().toLower().print() Alternative: person = new Person("Joey") person.name().toLower().print() Of course this only applies to languages where getters/setters are the norm, but is not directed at any specific language. Were these conventions developed around technical limitations (disambiguation), or simply through the pursuit of a more explicit, intentional feeling type of interface, or perhaps this is just a case of trickle a down norm. What are your thoughts? And how would simple changes to these conventions impact your happiness / daily attitudes towards your craft (however minimal). Thanks.

    Read the article

  • Are there any widespread, modern Java coding conventions?

    - by brianegge
    Sun's "Code Conventions for the Java Programming Language" was last updated April 1999. Ten years later a lot has changed in the language, as well as general usage patterns. Are there more up to date, widely adopted standards? Most guidelines omit specifying file encoding and line endings. Sun recommends mixed tabs and spaces. The Eclipse IDE defaults to Eclipse's standard, which is tabs only. The Maven style guide is spaces only. Many style guides, such as JBoss, follow Sun's guidelines, but prefer K&R braces instead of OTBS. Each Apache project has it's own style guide, with slight differences between each one.

    Read the article

  • Silverlight error-handling conventions: There is no relationship between onSilverlightError and Repo

    - by rasx
    When I see the call System.Windows.Browser.HtmlPage.Window.Eval (which is evil) in ReportErrorToDOM (in App.xaml.cs) this shows me that it has no relationship to onSilverlightError. So what kind of JavaScript-based scenario calls onSilverlightError? When will onSilverlightError definitely be needed? What are Silverlight error-handling conventions in general? This is a very important comment by Erik Monk but needs more detail: There are 2 kinds of terminal errors in Silverlight. 1) Managed errors (hit the managed Application_UnhandledException method). Note that some errors may not even get to this point. If the managed infrastructure can't be loaded for some reason (out of memory error maybe...), you won't get this kind of error. Still, if you can get it, you can use a web service (or the CLOG project) to communicate it back to the server. 2) Javascript errors.

    Read the article

  • XAML-based applications - Event Naming Conventions for C#

    - by user118190
    For event handling, I am starting to see many coders doing this: XButton.Click += OnXButtonClicked() ... void OnXButtonClicked() { ... } Where did this On_ convention come from? It just doesn't feel right in terms of methods. I am starting to see this as well and am wondering what others thought: XButton.Click += HandleXButtonClick() ... void HandleXButtonClick() { ... } When using intellisense, Visual Studio handles these like so: XButton.Click += XButton_Click; ... void XButton_Click(object sender, RoutedEventArgs e) { ... } I am seeking some advice on these naming conventions and would greatly appreciate some advice.

    Read the article

  • naming conventions for buttons in user interface

    - by Samuel
    User interface for web applications in general contain various buttons for performing CRUD operations. What would be the suggested naming convention for button labels while performing the following actions.. User creation (Add User... or Add User or Add user) Event creation (Add Event... or Add Event or Add event) View users button (List All Users or List All users or List all users ) Most of the sites seem to contain the last option (e.g. Add user) where the first alphabet in the word is capitalized and rest all are lower case). What would be a better practice here?

    Read the article

  • MySQL Conventions?

    - by Moe
    Hi There, I just moved my website to a new server (Shared to VPS) I expected errors, and the only error that is really puzzling me is this SQL statement. echo mysql_query("SELECT COUNT(*) FROM users_online_now") This returns nothing! And if I try the mysql_num_rows, it returns mysql_num_rows(): supplied argument is not a valid MySQL result resource.. If I query another table though eg: echo mysql_query("SELECT COUNT(*) FROM users") It works fine. I'm guessing it's something to do with the naming of the table? It worked fine on my previous host, is there some setting I should modify?

    Read the article

  • Doctrine 1.2 Column Naming Conventions for Many To Many Relationships

    - by Alan Storm
    I'm working with an existing database schema, and trying to setup two Doctrine models with a Many to Many relationship, as described in this document When creating tables from scratch, I have no trouble getting this working. However, the existing join tables use a different naming convention that what's described in the Doctrine document. Specifically Table 1 -------------------------------------------------- table_1_id ....other columns.... Table 2 -------------------------------------------------- table_2_id ....other columns.... Join Table -------------------------------------------------- fktable1_id fktable_2_id Basically, the previous developers prefaced all forign keys with an fk. From the examples I've seen and some brief experimenting with code, it appears that Doctrine 1.2 requires that the join table use the same column names as the tables it's joining in Is my assumption correct? If so, has the situation changed in Doctrine 2? If the answers to either of the above are true, how do you configure the models so that all the columns "line up"

    Read the article

  • Naming lossless more appropriate

    - by LarsOn
    Starting just discussing the naming first ignoring tech details, lossless is a negative and double negative word for one good reason should get named more appropriate: Lossless also matches nothing. When naming like all intact or likewise matches something in a manner more physical like sounds are. Then more technically stated that a copy might contain more information than the original. Does method as such have a name, if so what do I refer to, can we name it if you please or just discuss related handling.

    Read the article

  • xmlns naming convention

    - by elmuerte
    Do you use a naming convention for your XML namespaces? And if so, what reasoning lies behind it. I was actually amazed that hardly anyone wrote about a naming convention for XML namespaces. Most namespaces I've seen have the format of http://example.org/<some identifier> or http://example.org/scheme/<some identifier>. But that really lacks structuring beyond the initial "company" identifier.

    Read the article

  • Identifier for the “completed” stage of a process: 0, 99, something else?

    - by Arnold Sakhnov
    Say, that you are handling a multi-step process (like a complex registration form, with a number of steps the user has go through in order). You need to be able to save the current state of the process (e.g. so the user can come back to that registration form later and continue form the step where they were left off). Obviously, you’ll probably want to give each “step” an identifier you can refer to: 1, 2, 3, 4, etc. You logic will check for this step_id (or whatever you call it) to render the appropriate data. The question: how would you identify the stage after the final step, like the completed registration state (say, that you have to give that last “step” its own id, that’s how your logic is structured). Would it be a 0, 999, a non-integer value, something else entirely?

    Read the article

  • Should we rename overloaded methods?

    - by Mik378
    Assume an interface containing these methods : Car find(long id); List<Car> find(String model); Is it better to rename them like this? Car findById(long id); List findByModel(String model); Indeed, any developer who use this API won't need to look at the interface for knowing possible arguments of initial find() methods. So my question is more general : What is the benefit of using overloaded methods in code since it reduce readability?

    Read the article

  • What should be done with class names that conflict (common) framework names

    - by Earlz
    What should be done exactly when the most obvious class name for a component is taken by a framework? In my case, I need to make a class that describes an HTTP request. Of course, the most common name is "taken" as System.Web.HttpRequest. What should I do? This project will be used in a web context, so I'd really rather not force people to not import the System.Web namespace, or type out all of my class names manually. What is the usual way of dealing with this? I can come up with this: Prefix class name with a project shortname Try to come up with a different name that means the same thing(I've tried and can't come up with anything) Force users to choose between namespaces

    Read the article

  • How to avoid general names for abstract classes?

    - by djechlin
    In general it's good to avoid words like "handle" or "process" as part of routine names and class names, unless you are dealing with (e.g.) file handles or (e.g.) unix processes. However abstract classes often don't really know what they're going to do with something besides, say, process it. In my current situation I have an "EmailProcessor" that logs into a user's inbox and processes messages from it. It's not really clear to me how to give this a more precise name, although I've noticed the following style matter arises: better to treat derived classes as clients and named the base class by the part of the functionality it implements? Gives it more meaning but will violate is-a. E.g. EmailAcquirer would be a reasonable name since it's acquiring for the derived class, but the derived class won't be acquiring for anyone. Or just really vague name since who knows what the derived classes will do. However "Processor" is still too general since it's doing many relevant operations, like logging in and using IMAP. Any way out of this dilemma? Problem is more evident for abstract methods, in which you can't really answer the question "what does this do?" because the answer is simply "whatever the client wants."

    Read the article

  • Is the term "web portal" obselete?

    - by John Hamelink
    Firstly, sorry if this is the wrong place: I've looked at all the programming-related boards and this one seems like the best fit - correct me if I'm wrong. My boss uses the term "portal" for the project I work on all the time. To me, the word makes me think of Yahoo in the late 90s. Does the word "portal" have old-school connotations, or is it just me? Do you think it's ok to use it, and not drag our client's perception of the product down into the middle-ages? Or again, am I just being weird?

    Read the article

  • Good abbreviations for XML ... things

    - by Peter Turner
    I've never been very good at maintaining a coherent bunch of variable names for interfacing with XML files because I never name the variables in my interfaces the same way across my source. There are Elements, Attributes, Documents, NodeLists, Nodes, DocumentFragments and other stuff. What's a good scheme for keeping track of this stuff as variables? Is there a standard in regard to Hungarian notation? Do you even put anything signifying that the data is actually XML, is this bad practice?

    Read the article

  • Why are PHP function signatures so inconsistent?

    - by Shamim Hafiz
    I was going through some PHP functions and I could not help notice the following: <?php function foo(&$var) { } foo($a); // $a is "created" and assigned to null $b = array(); foo($b['b']); var_dump(array_key_exists('b', $b)); // bool(true) $c = new StdClass; foo($c->d); var_dump(property_exists($c, 'd')); // bool(true) ?> Notice the array_key_exists() and property_exists() function. In the first one, the property name(key for an array) is the first parameter while in the second one it is the second parameter. By intuition, one would expect them to have similar signature. This can lead to confusion and the development time may be wasted by making corrections of this type. Shouldn't PHP, or any language for that matter, consider making the signatures of related functions consistent?

    Read the article

  • "My stuff" vs. "Your stuff" in UI texts

    - by JD Isaacks
    When refering to a users stuff should you use My or Your, for example: My Cart | My Account | My Wishlist Or Your Cart | Your Account | Your Wishlist I found this article that argues for the use of your. It says flikr does this. It also says MySpace and MyYahoo are wrong. I also noticed today that Amazon uses the term Your. However, I have heard they are the masters at testing variations and finding the best one, so what you see on their site might be the best variation, or simply something they are currently testing. I personally like the way my looks better, but thats just my opinion. What do you think? What will hever the better impact on customers? Does it really even matter?

    Read the article

  • Am I missing a pattern?

    - by Ryan Pedersen
    I have a class that is a singleton and off of the singleton are properties that hold the instances of all the performance counters in my application. public interface IPerformanceCounters { IPerformanceCounter AccountServiceCallRate { get; } IPerformanceCounter AccountServiceCallDuration { get; } Above is an incomplete snippet of the interface for the class "PerformanceCounters" that is the singleton. I really don't like the plural part of the name and thought about changing it to "PerformanceCounterCollection" but stopped because it really isn't a collection. I also thought about "PerformanceCounterFactory" but it is really a factory either. After failing with these two names and a couple more that aren't worth mentioning I thought that I might be missing a pattern. Is there a name that make sense or a change that I could make towards a standardized pattern that would help me put some polish on this object and get rid of the plural name? I understand that I might be splitting hairs here but that is why I thought that the "Programmers" exchange was the place for this kind of thing. If it is not... I am sorry and I will not make that mistake again. Thanks!

    Read the article

  • Software bug/defect classification

    - by Dustin K
    We're trying to come up with terms that better describe our bugs/defects. To us, the term 'bug' or 'defect' is too generic and doesn't accurately reflect what is happening. For example, instead of saying that there is a bug (in the general sense), we'd rather say what type of bug (an error, or enhancement, or improvement, etc.). What names do you use for describing 'bugs'? I found http://www.softwaredevelopment.ca/bugs.shtml which has some pretty good classifications. How do you classify them?

    Read the article

  • Etymology of software project names [closed]

    - by Benoit
    I would like to have a reference community wiki here in order to know what etymology software name have or why they are named that way. I was wondering why Imagemagick's mogrify was named this way. Today I wondered the same for Apache Lucene. It would be handy to have a list here. Could we extend such a list? Let me start and let you edit it please. I will ask for this to be community wiki. For each entry please link to an external reference. GNU Emacs: stand for “Editor MACroS”. Apache Lucene: Armenian name Imagemagick mogrify: from “transmogrify”. Thanks.

    Read the article

  • Should one always know what an API is doing just by looking at the code?

    - by markmnl
    Recently I have been developing my own API and with that invested interest in API design I have been keenly interested how I can improve my API design. One aspect that has come up a couple times is (not by users of my API but in my observing discussion about the topic): one should know just by looking at the code calling the API what it is doing. For example see this discussion on GitHub for the discourse repo, it goes something like: foo.update_pinned(true, true); Just by looking at the code (without knowing the parameter names, documentation etc.) one cannot guess what it is going to do - what does the 2nd argument mean? The suggested improvement is to have something like: foo.pin() foo.unpin() foo.pin_globally() And that clears things up (the 2nd arg was whether to pin foo globally, I am guessing), and I agree in this case the later would certainly be an improvement. However I believe there can be instances where methods to set different but logically related state would be better exposed as one method call rather than separate ones, even though you would not know what it is doing just by looking at the code. (So you would have to resort to looking at the parameter names and documentation to find out - which personally I would always do no matter what if I am unfamiliar with an API). For example I expose one method SetVisibility(bool, string, bool) on a FalconPeer and I acknowledge just looking at the line: falconPeer.SetVisibility(true, "aerw3", true); You would have no idea what it is doing. It is setting 3 different values that control the "visibility" of the falconPeer in the logical sense: accept join requests, only with password and reply to discovery requests. Splitting this out into 3 method calls could lead to a user of the API to set one aspect of "visibility" forgetting to set others that I force them to think about by only exposing the one method to set all aspects of "visibility". Furthermore when the user wants to change one aspect they almost always will want to change another aspect and can now do so in one call.

    Read the article

  • Why is Quicksort called "Quicksort"?

    - by Darrel Hoffman
    The point of this question is not to debate the merits of this over any other sorting algorithm - certainly there are many other questions that do this. This question is about the name. Why is Quicksort called "Quicksort"? Sure, it's "quick", most of the time, but not always. The possibility of degenerating to O(N^2) is well known. There are various modifications to Quicksort that mitigate this problem, but the ones which bring the worst case down to a guaranteed O(n log n) aren't generally called Quicksort anymore. (e.g. Introsort). I just wonder why of all the well-known sorting algorithms, this is the only one deserving of the name "quick", which describes not how the algorithm works, but how fast it (usually) is. Mergesort is called that because it merges the data. Heapsort is called that because it uses a heap. Introsort gets its name from "Introspective", since it monitors its own performance to decide when to switch from Quicksort to Heapsort. Similarly for all the slower ones - Bubblesort, Insertion sort, Selection sort, etc. They're all named for how they work. The only other exception I can think of is "Bogosort", which is really just a joke that nobody ever actually uses in practice. Why isn't Quicksort called something more descriptive, like "Partition sort" or "Pivot sort", which describe what it actually does? It's not even a case of "got here first". Mergesort was developed 15 years before Quicksort. (1945 and 1960 respectively according to Wikipedia) I guess this is really more of a history question than a programming one. I'm just curious how it got the name - was it just good marketing?

    Read the article

  • Project Codenames - Yea or Nay?

    - by rmx
    Where I work, most of our projects have (or at least attempt) descriptive, useful names. However we have a few with names that make no sense: I found that an assembly named WiFi which actually has nothing whatsoever to do with wi-fi, but is a codename. When I asked why, I was told that it's to protect company secrets incase some intern has few too many at the pub on Friday and starts chatting about the brand new 'WiFi' project he's been working on. Its clear that some people find enjoyment in finding silly / amusing codenames for their projects (like in this question). My question is: is it really a good idea to use codenames for your projects or are you better off spending the time to decide upon a descriptive name? My opinion is that in the long-run its better to give your projects relevant names. My reasoning is that if you can't think of a decent name, perhaps you don't really know the requirements well enough. I think there are better ways to 'protect company secrets' and I find it quite confusing when the name does not correlate at all with the content. It's just common sense, surely?! So do you use codenames and what the your reasons for or against this seemingly common, yet annoying (to me at least) practice?

    Read the article

  • What is a widely accepted term for a string variable that would probably contain a file path and file name?

    - by Peter Turner
    For functions that need to index files in a directory and rename them FileName0001, FileName0002, etc... I often need to write a function that splits the file name from the file path and rename the file. When I put the file name and file path back together, I don't have a very good name for the variable that contains both of them and I usually just wind up concatenating them every time I want to use them (usually using them as parameters for functions labeled either filename or filepath) so I never really know what I'm doing until I notice a lot of files being written in the same directory as my binaries. Anyway, what do I call a file name and a file path? I don't want to call it File, because that usually means the binary information behind the file. I don't want to call it URI because that usually means I've got some sort of protocol, which I don't. I just want a good way to denote "c:\somedir\somedir\somedir\somefile.txt" so as to deconfuse this mess I've just realized I'm in. Please don't just list your personal preference. I think an excellent answer should "'site its sources". (as in, provide a link to a repository with a good example of the code being used as I described)

    Read the article

  • What is a generic term for name/identifier? (as opposed to label)

    - by d3vid
    I need to refer to a number of things that have both an identifier value (used in code and configuration), and a human-readable label. These things include: database columns dropdown items subapplications objects stored in a dictionary I want two unambiguous terms. One to refer to the identifier/value/key. One to refer to the label. As you can see, I'm pretty settled on the latter :) For the former, identifier seems best (not everything is strictly a key, and value and name could refer to the label; although, identifier usually refers only to a variable name), but I would prefer to follow an established practice if there is one. Is there an established term for this? (Please provide a source.) If not, are there any examples of a choice from a significant source (Java APIs, MSDN, a big FLOSS project)? (I wasn't sure if this should be posted here or to English Language & Usage. I thought this was the more appropriate expert audience. Happy to migrate if not.)

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >