Search Results

Search found 33509 results on 1341 pages for 'good practices'.

Page 18/1341 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How to deal with seniors' bad coding style/practices?

    - by KaluSingh Gabbar
    I am new to work but the company I work in hires a lot of non-comp-science people who are smart enough to get the work done (complex) but lack the style and practices that should help other people read their code. For example they adopt C++ but still use C-like 3 page functions which drives new folks nuts when they try to read that. Also we feel very risky changing it as it's never easy to be sure we are not breaking something. Now, I am involved in the project with these guys and I can't change the entire code base myself or design so that code looks good, what can I do in this situation? PS we actually have 3 page functions & because we do not have a concept of design, all we can do is assume what they might have thought as there is no way to know why is it designed the way it is. I am not complaining.I am asking for suggestion,already reading some books to solve the issues Pragmatic Programmer; Design portion from B.Stroustrup; Programming and principles by B.Stroustrup;

    Read the article

  • Best practices regarding equals: to overload or not to overload?

    - by polygenelubricants
    Consider the following snippet: import java.util.*; public class EqualsOverload { public static void main(String[] args) { class Thing { final int x; Thing(int x) { this.x = x; } public int hashCode() { return x; } public boolean equals(Thing other) { return this.x == other.x; } } List<Thing> myThings = Arrays.asList(new Thing(42)); System.out.println(myThings.contains(new Thing(42))); // prints "false" } } Note that contains returns false!!! We seems to have lost our things!! The bug, of course, is the fact that we've accidentally overloaded, instead of overridden, Object.equals(Object). If we had written class Thing as follows instead, then contains returns true as expected. class Thing { final int x; Thing(int x) { this.x = x; } public int hashCode() { return x; } @Override public boolean equals(Object o) { return (o instanceof Thing) && (this.x == ((Thing) o).x); } } Effective Java 2nd Edition, Item 36: Consistently use the Override annotation, uses essentially the same argument to recommend that @Override should be used consistently. This advice is good, of course, for if we had tried to declare @Override equals(Thing other) in the first snippet, our friendly little compiler would immediately point out our silly little mistake, since it's an overload, not an override. What the book doesn't specifically cover, however, is whether overloading equals is a good idea to begin with. Essentially, there are 3 situations: Overload only, no override -- ALMOST CERTAINLY WRONG! This is essentially the first snippet above Override only (no overload) -- one way to fix This is essentially the second snippet above Overload and override combo -- another way to fix The 3rd situation is illustrated by the following snippet: class Thing { final int x; Thing(int x) { this.x = x; } public int hashCode() { return x; } public boolean equals(Thing other) { return this.x == other.x; } @Override public boolean equals(Object o) { return (o instanceof Thing) && (this.equals((Thing) o)); } } Here, even though we now have 2 equals method, there is still one equality logic, and it's located in the overload. The @Override simply delegates to the overload. So the questions are: What are the pros and cons of "override only" vs "overload & override combo"? Is there a justification for overloading equals, or is this almost certainly a bad practice?

    Read the article

  • DataSet size best practices - are there any general rules?

    - by Galwegian
    I'm working on a desktop application that will produce several in-memory datasets as an intermediary before being committed to a database. Obviously I'm going to try to keep the size of these to a minimum, but are there any guidelines on thresholds I shouldn't cross for good functionality on an 'average' machine? Thanks for any help.

    Read the article

  • What are the standard practices for throwing Javascript Exceptions?

    - by T.R.
    w3schools says that exceptions can be strings, integers, booleans, or objects, but the example given doesn't strike me as good practice, since exception type checking is done through string comparison. Is this the preferred method of exception handling in Javascript? Are there built-in exception types (like NullPointerException)? (if so, what are they, what kind of inheritance do they use, and are they preferred over other options?)

    Read the article

  • What are the standard practices for throwing JavasScript Exceptions?

    - by T.R.
    w3schools says that exceptions can be strings, integers, booleans, or objects, but the example given doesn't strike me as good practice, since exception type checking is done through string comparison. Is this the preferred method of exception handling in JavaScript? Are there built-in exception types (like NullPointerException)? (if so, what are they, what kind of inheritance do they use, and are they preferred over other options?)

    Read the article

  • Portal And Content - Content Integration - Best Practices

    - by Stefan Krantz
    Lately we have seen an increase in projects that have failed to either get user friendly content integration or non satisfactory performance. Our intention is to mitigate any knowledge gap that our previous post might have left you with, therefore this post will repeat some recommendation or reference back to old useful post. Moreover this post will help you understand ground up how to design, architect and implement business enabled, responsive and performing portals with complex requirements on business centric information publishing. Design the Information Model The key to successful portal deployments is Information modeling, it's a key task to understand the use case you designing for, therefore I have designed a set of question you need to ask yourself or your customer: Question: Who will own the content, IT or Business? Answer: BusinessQuestion: Who will publish the content, IT or Business? Answer: BusinessQuestion: Will there be multiple publishers? Answer: YesQuestion: Are the publishers computer scientist?Answer: NoQuestion: How often do the information changes, daily, weekly, monthly?Answer: Daily, weekly If your answers to the questions matches at least 2, we strongly recommend you design your content with following principles: Divide your pages in to logical sections, where each section is marked with its purpose Assign capabilities to each section, does it contain text, images, formatting and/or is it static and is populated through other contextual information Select editor/design element type WYSIWYG - Rich Text Plain Text - non-format text Image - Image object Static List - static list of formatted informationDynamic Data List - assembled information from multiple data files through CMIS query The result of such design map could look like following below examples: Based on the outcome of the required elements in the design column 3 from the left you will now simply design a data model in WebCenter Content - Site Studio by creating a Region Definition structure matching your design requirements.For more information on how to create a Region definition see following post: Region Definition Post - note see instruction 7 for details. Each region definition can now be used to instantiate data files, a data file will hold the actual data for each element in the region definition. Another way you can see this is to compare the region definition as an extension to the metadata model in WebCenter Content for each data file item. Design content templates With a solid dependable information model we can now proceed to template creation and page design, in this phase focuses on how to place the content sections from the region definition on the page via a Content Presenter template. Remember by creating content presenter templates you will leverage the latest and most integrated technology WebCenter has to offer. This phase is much easier since the you already have the information model and design wire-frames to base the logic on, however there is still few considerations to pay attention to: Base the template on ADF and make only necessary exceptions to markup when required Leverage ADF design components for Tabs, Accordions and other similar components, this way the design in the content published areas will comply with other design areas based on custom ADF taskflows There is no performance impact when using meta data or region definition based data All data access regardless of type, metadata or xml data it can be accessed via the Content Presenter - Node. See below for applied examples on how to access data Access metadata property from Document - #{node.propertyMap['myProp'].value}myProp in this example can be for instance (dDocName, dDocTitle, xComments or any other available metadata) Access element data from data file xml - #{node.propertyMap['[Region Definition Name]:[Element name]'].asTextHtml}Region Definition Name is the expect region definition that the current data file is instantiatingElement name is the element value you like to grab from the data file I recommend you read following  useful post on content template topic:CMIS queries and template creation - note see instruction 9 for detailsStatic List template rendering For more information on templates:Single Item Content TemplateMulti Item Content TemplateExpression Language Internationalization Considerations When integrating content assets via content presenter you by now probably understand that the content item/data file is wired to the page, what is also pretty common at this stage is that the content item/data file only support one language since its not practical or business friendly to mix that into a complex structure. Therefore you will be left with a very common dilemma that you will have to either build a complete new portal for each locale, which is not an good option! However with little bit of information modeling and clear naming convention this can be addressed. Basically you can simply make sure that all content item/data file are named with a predictable naming convention like "Content1_EN" for the English rendition and "Content1_ES" for the Spanish rendition. This way through simple none complex customizations you will be able to dynamically switch the actual content item/data file just before rendering. By following proposed approach above you not only enable a simple mechanism for internationalized content you also preserve the functionality in the content presenter to support business accessible run-time publishing of information on existing and new pages. I recommend you read following useful post on Internationalization topics:Internationalize with Content Presenter Integrate with Review & Approval processes Today the Review and approval functionality and configuration is based out of WebCenter Content - Criteria Workflows. Criteria Workflows uses the metadata of the checked in document to evaluate if the document is under any review/approval process. So for instance if a Criteria Workflow is configured to force any documents with Version = "2" or "higher" and Content Type is "Instructions", any matching content item version on check in will now enter the workflow before getting released for general access. Few things to consider when configuring Criteria Workflows: Make sure to not trigger on version one for Content Items that are Data Files - if you trigger on version 1 you will not only approve an empty document you will also have a content presenter pointing to a none existing document - since the document will only be available after successful completion of the workflow Approval workflows sometimes requires more complex criteria, the recommendation if that is the case is that the meta data triggering such criteria is automatically populated, this can be achieved through many approaches including Content Profiles Criteria workflows are configured and managed in WebCenter Content Administration Applets where you can configure one or more workflows. When you configured Criteria workflows the Content Presenter will support the editors with the approval process directly inline in the "Contribution mode" of the portal. In addition to approve/reject and details of the task, the content presenter natively support the user to view the current and future version of the change he/she is approving. See below for example: Architectural recommendation To support review&approval processes - minimize the amount of data files per page Each CMIS query can consume significant time depending on the complexity of the query - minimize the amount of CMIS queries per page Use Content Presenter Templates based on ADF - this way you minimize the design considerations and optimize the usage of caching Implement the page in as few Data files as possible - simplifies publishing process, increases performance and simplifies release process Named data file (node) or list of named nodes when integrating to pages increases performance vs. querying for data Named data file (node) or list of named nodes when integrating to pages enables business centric page creation and publishing and reduces the need for IT department interaction Summary Just because one architectural decision solves a business problem it doesn't mean its the right one, when designing portals all architecture has to be in harmony and not impacting each other. For instance the most technical complex solution is not always the best since it will most likely defeat the business accessibility, performance or both, therefore the best approach is to first design for simplicity that even a non-technical user can operate, after that consider the performance impact and final look at the technology challenges these brings and workaround them first with out-of-the-box features, after that design and develop functions to complement the short comings.

    Read the article

  • SQL Server CLR stored procedures in data processing tasks - good or evil?

    - by Gart
    In short - is it a good design solution to implement most of the business logic in CLR stored procedures? I have read much about them recently but I can't figure out when they should be used, what are the best practices, are they good enough or not. For example, my business application needs to parse a large fixed-length text file, extract some numbers from each line in the file, according to these numbers apply some complex business rules (involving regex matching, pattern matching against data from many tables in the database and such), and as a result of this calculation update records in the database. There is also a GUI for the user to select the file, view the results, etc. This application seems to be a good candidate to implement the classic 3-tier architecture: the Data Layer, the Logic Layer, and the GUI layer. The Data Layer would access the database The Logic Layer would run as a WCF service and implement the business rules, interacting with the Data Layer The GUI Layer would be a means of communication between the Logic Layer and the User. Now, thinking of this design, I can see that most of the business rules may be implemented in a SQL CLR and stored in SQL Server. I might store all my raw data in the database, run the processing there, and get the results. I see some advantages and disadvantages of this solution: Pros: The business logic runs close to the data, meaning less network traffic. Process all data at once, possibly utilizing parallelizm and optimal execution plan. Cons: Scattering of the business logic: some part is here, some part is there. Questionable design solution, may encounter unknown problems. Difficult to implement a progress indicator for the processing task. I would like to hear all your opinions about SQL CLR. Does anybody use it in production? Are there any problems with such design? Is it a good thing?

    Read the article

  • Where can a self-teacher learn general good programming habits and conventions?

    - by lucid
    A few mistakes and general childishness in early adulthood have left me in a situation where I work a menial job, with no possibility (in the near future) of attending school. I aspire to one day work in the programming field (gaming specifically), after proving myself on the indie end of things. I've gotten very confident in C++, java, and python, and I find I'm able to solve any problem I want either from previous experience, or from scouring the web for help. The solutions work, and with each attempt they become more readable, maintainable, and extensible. But this is because I'm learning from mistakes and bad programming and design habits I feel I might have avoided with actual schooling. General tips like: "if it's hard to read or getting long, or you're writing it twice, it should be in one or more functions." or "design all your classes before you start coding, so you don't have to rewrite classes later when you discover an unforeseen dependency" Is there a good book or website for learning general good programming practices and design habits? Also, naming and format conventions. I realize sometimes development houses have their own conventions, but things like "Classes in python usually have the first letter of each word capitalized". I'd like to be able to show some source code to a potential employer, and be prepared when for what's expected on a team. Is there some central database of naming and formatting conventions somewhere? Also, feel free to give any thoughts on whether or not the self-teach, garner some indie sales, use them as your resume' route is realistic

    Read the article

  • Microsoft Tech-Ed North America 2010 - SQL Server Upgrade, 2000 - 2005 - 2008: Notes and Best Practi

    - by ssqa.net
    It is just a week to go for Tech-Ed North America 2010 in New Orleans, this time also I'm speaking at this conference on the subject - SQL Server Upgrade, 2000 - 2005 - 2008: Notes and Best Practices from the Field... more from here .. It is a coincedence that this is the 2nd time the same talk has been selected in Tech-Ed North America for the topic I have presented in SQLBits before....(read more)

    Read the article

  • SQL Server data platform upgrade - Why upgrade and how best you can reduce pre & post upgrade problems?

    - by ssqa.net
    SQL Server upgrade, let it be database(s) or instance(s) or both the process and procedures must follow best practices in order to reduce any problems that may occur even after the platform is upgraded. The success of any project relies upon the simpler methods of implementation and a process to reduce the complexity in testing to ensure a successful outcome. Also the topic has been a popular topic that .... read more from here ......(read more)

    Read the article

  • Successful Common Code Libraries

    - by Adam Jenkin
    Are there any processes, guidelines or best practices that can be followed for the successful implementation of a common code libraries. Currently we are discussing the implementation of common code libraries within our dev team. In our instance, our common code libraries would compliment mainstream .net software packages we develop against. In particular, im interested in details and opinions on: Organic vs design first approach Version management Success stories (when the do work) Horror stories (when they dont work) Many Thanks

    Read the article

  • What modern design pattern / software engineering books for Java SE 6 do you recommend ?

    - by Scott Davies
    Hi, I am very familiar with Java 6 SE language features and am now looking for modern books that cover design patterns in Java for beginners as well as software engineering books that discuss architectures, algorithms and best practices in Java coding (sort of like the Effective C# books). I am aware of the classic GoF design patterns book, however, I'd like a more modern reference that takes advantage of the features of Java 6 SE. What books would you recommend ? Thanks, Scott

    Read the article

  • What is the best way to do development with git?

    - by marlene
    I have been searching the web for best practices, but don't see anything that is consistent. If you have an excellent development process that includes successful releases of your product as well as hotfixes/patches and maintenance releases and you use git. I would love to hear how you use git to accomplish this. Do you use branches, tags, etc? How do you use them? I am looking for details, please.

    Read the article

  • Microsoft SQL Server 2008 R2 Administration Cookbook

    - by ssqa.net
    Its one year on my first book released, keeping aside the financial gains from this book I'm more happy to achieve one of the important goals from my career. This is something big in my life to announce, it gives immensive pleasure and happiness to share about my first book (hard paper) and eBook release, titled : Microsoft SQL Server 2008 R2 Administration Cookbook is released and out now. share my experience and task based real-world best practices in a cookbook style. My thanks to the technical...(read more)

    Read the article

  • Erfolgreich sein durch Reference Selling

    - by A&C Redaktion
    Referenzen sind eine hervorragende Möglichkeit, die Zuverlässigkeit von Partner-Lösungen auf Basis von Oracle Technologien darzustellen, denn sie sind ein Spiegelbild zufriedener Kunden. Sie dienen als Best Practices und beeinflussen damit positiv die Kaufentscheidung neuer Kunden. Iris Musiol, Customer Reference Manager DACH, erklärt das Oracle Referenzprogramm für Partner sowie deren Vorteile, Inhalte und Voraussetzungen.

    Read the article

  • What should I do to scale out an high-traffic website?

    - by makerofthings7
    What Best Practices should be undertaken for a Website that needs to "scale out" to handle capacity? This is especially relevant now that people are considering the cloud, but may be missing out on the fundamentals. I'm interested in hearing about anything you consider a best practice from development-level tasks, to infrastructure, to management. Use your best judgement when posting multiple answers, since it may make sense to post them separately for voting purposes. (hint: you'll likely get more reputation points for many small answers than one large answer)

    Read the article

  • Any technical references for game-oriented icons and symbols?

    - by willc2
    To make localizing easier, I'm using icons to show in-game information like achievements and bonuses. Coming up with good designs isn't easy, especially when it has to be integrated into the rest of the game's art style. Can I do better than looking at some random selection of existing games? Are there any reference books or sites that cover game graphics specifically? I'm looking for more theory and best-practices rather than pre-made graphics.

    Read the article

  • EXT-js PropertyGrid best practices to achieve an update ?

    - by Tom
    Hello, I am using EXT-js for a project, usually everything is pretty straight forward with EXT-js, but with the propertyGrid, I am not sure. I'd like some advice about this piece of code. First the store to populate the property grid, on the load event: var configStore = new Ext.data.JsonStore({ // store config autoLoad:true, url: url.remote, baseParams : {xaction : 'read'}, storeId: 'configStore', // reader config idProperty: 'id_config', root: 'config', totalProperty: 'totalcount', fields: [{ name: 'id_config' }, { name: 'email_admin' } , { name: 'default_from_addr' } , { name: 'default_from_name' } , { name: 'default_smtp' } ],listeners: { load: { fn: function(store, records, options){ // get the property grid component var propGrid = Ext.getCmp('propGrid'); // make sure the property grid exists if (propGrid) { // populate the property grid with store data propGrid.setSource(store.getAt(0).data); } } } } }); here is the propertyGrid: var propsGrid = new Ext.grid.PropertyGrid({ renderTo: 'prop-grid', id: 'propGrid', width: 462, autoHeight: true, propertyNames: { tested: 'QA', borderWidth: 'Border Width' }, viewConfig : { forceFit: true, scrollOffset: 2 // the grid will never have scrollbars } }); So far so good, but with the next button, I'll trigger an old school update, and my question : Is that the proper way to update this component ? Or is it better to user an editor ? or something else... for regular grid I use the store methods to do the update, delete,etc... The examples are really scarce on this one! Even in books about ext-js! new Ext.Button({ renderTo: 'button-container', text: 'Update', handler: function(){ var grid = Ext.getCmp("propGrid"); var source = grid.getSource(); var jsonDataStr = null; jsonDataStr = Ext.encode(source); var requestCg = { url : url.update, method : 'post', params : { config : jsonDataStr , xaction : 'update' }, timeout : 120000, callback : function(options, success, response) { alert(success + "\t" + response); } }; Ext.Ajax.request(requestCg); } }); and thanks for reading.

    Read the article

  • Which are the Extreme Programming "core" practices?

    - by MiKo
    Recently, I began reading about agile methodologies and XP in particular. I am a bit confused, though, about what are considered the practices involved in extreme programming. More precisely: Wikipedia reports 12 practices, which I someway believe to be the "classic" ones. Both Kent Beck and Ron Jeffries indicate 13 practices (you can find the links at the bottom of wikipedia page about "Extreme Programming Practices", I cannot post them here since I am new user of Stack Overflow), while this review of Kent Beck's "XP explained" (2nd edition) report more than 20 somewhat different practices. As a complete beginner in the topic (and basically as a complete beginner as a programmer), I would like to be enlightened on the matter. My impression is that I should look at Beck's book, since the second edition has been written after several years of XPerience, but I can find a lot less material based on that.

    Read the article

  • Separating code logic from the actual data structures. Best practices?

    - by Patrick
    I have an application that loads lots of data into memory (this is because it needs to perform some mathematical simulation on big data sets). This data comes from several database tables, that all refer to each other. The consistency rules on the data are rather complex, and looking up all the relevant data requires quite some hashes and other additional data structures on the data. Problem is that this data may also be changed interactively by the user in a dialog. When the user presses the OK button, I want to perform all the checks to see that he didn't introduce inconsistencies in the data. In practice all the data needs to be checked at once, so I cannot update my data set incrementally and perform the checks one by one. However, all the checking code work on the actual data set loaded in memory, and use the hashing and other data structures. This means I have to do the following: Take the user's changes from the dialog Apply them to the big data set Perform the checks on the big data set Undo all the changes if the checks fail I don't like this solution since other threads are also continuously using the data set, and I don't want to halt them while performing the checks. Also, the undo means that the old situation needs to be put aside, which is also not possible. An alternative is to separate the checking code from the data set (and let it work on explicitly given data, e.g. coming from the dialog) but this means that the checking code cannot use hashing and other additional data structures, because they only work on the big data set, making the checks much slower. What is a good practice to check user's changes on complex data before applying them to the 'application's' data set?

    Read the article

  • Where to find good examples or Templates for Configuration Management Plans?

    - by Geo
    Documentation is not the favorite area of a developer but an important area to fulfill if you want to have standards in the organization. We are trying to put together a new Configuratio Mgmt Plan to setup Change Controls, Backups strategies and other fun things, like the process from development, staging to production. I will like to have your opinions on good examples or probably a good start for CMP process.

    Read the article

  • Mobile Development- Obtaining development hardware - best practices?

    - by Zoot
    I'm looking to get into smartphone development, but there a quite a few options out there for platforms right now. (iOS/Android/WebOS/Bada/Symbian/MeeGo/WindowsMobile/JavaME) I'd like to have development hardware to test my code and the overall functionality of the devices. What is the best way to obtain and/or borrow hardware for development and testing? Are there rules of thumb to follow which apply to all companies and platforms? In this situation, I'm a single developer. Does this process change for a startup? A hackerspace? A small business? A large business? Thanks.

    Read the article

  • Web Development know how. Best practices [closed]

    - by Mir
    Possible Duplicate: What should every programmer know about web development? I have recently started learning about web development and I am currently working on a project that involves web scraping. While doing the project I came across an error which upon doing a little web search made me realize that one must clean the html before processing it further. Similarly, there were a few more interesting things that I had missed. My question is how can I quickly familiarize myself with best practice methods for web development.( I am asking as an an electrical engineer with experience in C/C++/Java and very little experience in web dev). Thanks

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >