Search Results

Search found 5915 results on 237 pages for 'practices'.

Page 119/237 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • Should I create a new extension for an xml file?

    - by macleojw
    I'm working with a data model stored in XML files. I want to create some metadata for the model and store it alongside, but would like to be able to distinguish between the two. The data model is imported into some software from time to time and we don't want it to try to import the meta data files. To get round this, I've been thinking of creating a new extension for the metadata xml files (say .mdml). Is this good practice?

    Read the article

  • moving a website built on struts to a CMS

    - by fabiobeta
    Hi. Imagine having developed a classical website with java&struts. Now you customer is learning that redeploying the application to change an image or a text is a significant cost. And it asks to add a function to the site: cms-like handling of the contents (editing, versioning, approved publishing). How would you handle this request? Would you develop it in the webapp? Would you merge the webapp with a CMS? Would tou MOVE the webapp into a cms? Would you run away?

    Read the article

  • new Integer vs valueOf

    - by LB
    Hi, I was using Sonar to make my code cleaner, and it pointed that I'm using new Integer(1) instead of Integer.valueOf(1). Because it seems that valueOf does not instantiate a new object so is more memory-friendly. How can valueOf not instantiate a new object ? How does it work ? Is this true for all integers ? thanks.

    Read the article

  • Tests that are 2-3 times bigger than the testable code

    - by HeavyWave
    Is it normal to have tests that are way bigger than the actual code being tested? For every line of code I am testing I usually have 2-3 lines in the unit test. Which ultimately leads to tons of time being spent just typing the tests in (mock, mock and mock more). Where are the time savings? Do you ever avoid tests for code that is along the lines of being trivial? Most of my methods are less than 10 lines long and testing each one of them takes a lot of time, to the point where, as you see, I start questioning writing most of the tests in the first place. I am not advocating not unit testing, I like it. Just want to see what factors people consider before writing tests. They come at a cost (in terms of time, hence money), so this cost must be evaluated somehow. How do you estimate the savings created by your unit tests, if ever?

    Read the article

  • Fastest way to check for value existance.

    - by Itay Moav
    I have a list of values I have to check my input against it for existence. What is the faster way? This is really out of curiosity on how the internals work, not any stuff about premature optimization etc... 1. $x=array('v'=>'','c'=>'','w'=>); .. .. array_key_exists($input,$x); 2. $x=array('v','c','w'); .. .. in_array($input,$x);

    Read the article

  • AS3: Performance question calling an event function with null param

    - by adehaas
    Lately I needed to call a listener function without an actual listener like so: foo(null); private function foo(event:Event):void { //do something } So I was wondering if there is a significant difference regarding performance between this and using the following, in which I can prevent the null in calling the function without the listener, but am still able to call it with a listener as well: foo(); private function foo(event:Event = null):void { } I am not sure wether it is just a question of style, or actually bad practice and I should write two similar functions, one with and one without the event param (which seems cumbersome to me). Looking forward to your opinions, thx.

    Read the article

  • Handling missing data

    - by soppotare
    Say I have a simple helpdesk application which logs calls made by users. I would typically have such fields in a table relating to the call e.g. CallID, Description, CustomerID etc. I Would also have a table of customers including CustomerID, Username, Password, FullName etc. Now when a user is deleted from the customers table then the inner join between the calls table and the users table to find out historically which user logged a call would produce no results. How do people usually deal with this? Have seperate customer and useraccount tables Just disable the accounts so the data is still available Record the customers name in the calls table as a seperate field. or any other methods / suggestions?

    Read the article

  • What's the best practice in case something goes wrong in Perl code?

    - by Geo
    I saw code which works like this: do_something($param) || warn "something went wrong\n"; and I also saw code like this: eval { do_something_else($param); }; if($@) { warn "something went wrong\n"; } Should I use eval/die in all my subroutines? Should I write all my code based on stuff returned from subroutines? Isn't eval'ing the code ( over and over ) gonna slow me down?

    Read the article

  • Where to put SVN repository directory in Linux?

    - by alexloh
    I am setting up a new SVN server on Ubuntu Linux. Where is a good place (best practice) to put the repositories? Should I create a new user? The server will be accessed via http:// so no need to create user accounts etc (as was the case for svn://). Many thanks in advance

    Read the article

  • What are your suggestions for best practises for regular data updates in a website database?

    - by bboyle1234
    My shared-hosting asp.net website must automatically run data update routines at regular times of day. Once it has finished running certain update routines, it can run update routines that are dependent on the previous updates. I have done this type of work before, using quite complicated setups. Some features of the framework I created are: A cron job from another server makes a request which starts a data update routine on the main server Each updater is loaded from web.config Each updater overrides a "canRunUpdate" method that determines whether its dependencies have finished updating Each updater overrides a "hasFinishedUpdate" method Each updater overrides a "runUpdate" method Updaters start and run in parallel threads The initial request from the cron job server started each updater in its own thread and then ended. As a result, the threads containing the updaters would be terminated before the updaters were finished. Therefore I had to give the updaters the ability to save partial results and continue the update job next time they are started up. As a result, the cron server had to call the updater many times to ensure the job is done. Sometimes the cron server would continue making update requests long after all the updates were completed. Sometimes the cron server would finish calling the update requests and leave some updates uncompleted. It's not the best system. I'm looking for inspiration. Any ideas please? Thank you :)

    Read the article

  • What is a good balance for having developers learn at work

    - by Mel
    So now I am the manager. One of the things I always promised myself I would do is have the other developers focus on learning new stuff. In fact I even want to force them to read a couple books that really helped me learn to program. However now I am also accountable for the product getting finished. I have this vision of everyone reading books instead of working and me getting fired. What is the best way to work learning into the developers schedules, especially for the ones that just don't care to learn. How much time should be spent on learning in a work week?

    Read the article

  • Flexible array members in C - bad?

    - by Lionel
    I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not backed by any argument. Is this an accepted fact? (Flexible array members are a C feature introduced in C99 whereby one can declare the last element to be an array of unspecified size. For example: ) struct header { size_t len; unsigned char data[]; };

    Read the article

  • Is it always bad idea to use inline css for used-once property?

    - by user93422
    I have a table, with 10 columns. I want to control the width of each column. Each column is unique, right now I create an external CSS style for each column: div#my-page table#members th.name-col { width: 40px; } I know there is a best practice to avoid inline style. I do approve using external CSS for anything look'n'feel related: fonts, colors, images. But is it really better to use external CSS in this case? It does not incur extra maintenance cost. It is easier to produce. Cons I can think of: If you have separate designers and development team - using inline styles will force designers to modify content-file (aspx in my case). It might use more bandwidth. Anything else I've missed?

    Read the article

  • int i vs int index etc. Which one is better?

    - by Earlz
    Coming from a C background I've always used int i for generic loop variables. Of course in big nested loops or other complex things I may use a descriptive name but which one had you rather see? int i; for(i=0;i<Controls.Count;i++){ DoStuff(Controls[i]); } or int index; for(index=0;index<Controls.Count;index++){ DoStuff(Controls[index]); } In the current project I am working on there are both of these styles and index being replaced by ndx. Which one is better? Is the i variable too generic? Also what about the other C style names? i, j, k Should all of these be replaced by actual descriptive variables?

    Read the article

  • UI to allow 700+ multiple choices

    - by Refracted Paladin
    In my desktop .NET application I have written(for internal use) where I need to allow my users to apply diagnosis's to a Member Plan. There are currently 700 in the system and growing. I need to allow them to add multiple diapnosis's at once. I currently am allowing this through a combo check list box. This works but is INSANELY unweildly for both myself and the users. What I am looking for is a how I could go about displaying these to the users. Ideally I would need to show two criteria for each each as well. Diagnosis Name and Diagnosis Code Ideas? How would you tackle this? I am using .Net 3.5sp1 and SQL 2005 for the backend. I don't care if the solution is WPF or Winforms.

    Read the article

  • Is it a bad programming practise to have "Public" members inside an "Internal" class?

    - by Amby
    I mean, won;t it be more specific and appropriate if i "only" keep "protected","internal" and "private" members (field,method,property,event) in a class which is declared as "internal" ? I have seen this practice ( having "public" members in an "internal" class) in various code so just wanted to know is it a bad practice or does it has some benefit or advantage. [Only concerned about C#] Thanks for your interest.

    Read the article

  • Using try vs if in python

    - by artdanil
    Is there a rationale to decide which one of try or if constructs to use, when testing variable to have a value? For example, there is a function that returns either a list or doesn't return a value. I want to check result before processing it. Which of the following would be more preferable and why? result = function(); if (result): for r in result: #process items or result = function(); try: for r in result: #process items except TypeError: pass; Related discussion: Checking for member existence in Python

    Read the article

  • Should I go back and fix work when you learn something new/better?

    - by SnOrfus
    Considering that we're all constantly learning, we've all got to come across a point where we learn something just awesome that improves our code or parts of it significantly. The question is, when you've learned some new technique, strategy or whatever, do your or should you go back to code that you know works, but could be so much better/maintainable/faster/generally improved and implement this new knowledge? I understand the concept of "if it ain't broke, don't fix it" but when does that become losing pride in code you've already written and what does it say for refactoring.

    Read the article

< Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >