Search Results

Search found 1755 results on 71 pages for 'subjective'.

Page 35/71 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Style of if: to nest or not to nest

    - by Marco
    A colleague of mine and me had a discussion about the following best-practice issue. Most functions/methods start with some parameter checking. I advocate the following style, which avoids nesting. if (parameter one is ugly) return ERROR; if (parameter two is nonsense || it is raining) return ERROR; // do the useful stuff return result; He, who comes from a more functional/logic programming background, prefers the following, because it reduces the number of exit points from the function. if (parameter one is ok) { if (parameter two is ok && the sun is shining) { // do the useful stuff return result } } return ERROR; Which one would you prefer and why?

    Read the article

  • Is reverse engineering evil?

    - by Amir Arad
    Lately I've been pondering on how a specific beloved old game actually works. I had some mild progress, but then a friend pointed out that if I really loved the game and appreciate it, I wouldn't try to reverse-engineer it. Note that the game is long considered an abandonware and is offerd for download publicly in lawful game sites, and I have no commercial / other large scale intentions - just to learn and "mess around" with it. Did I miss something? Is there an ethical taboo regarding reverse-engeneering? Alternatively, is there a legal issue?

    Read the article

  • To what extent should code try to explain fatal exceptions?

    - by Andrzej Doyle
    I suspect that all non-trivial software is likely to experience situations where it hits an external problem it cannot work around and thus needs to fail. This might be due to bad configuration, an external server being down, disk full, etc. In these situations, especially if the software is running in non-interactive mode, I expect that all one can really do is log an error and wait for the admin to read the logs and fix the problem. If someone happens to interact with the software in the meantime, e.g. a request comes in to a server that failed to initialize properly, then perhaps an appropriate hint can be given to check the logs and maybe even the error can be echoed (depending on whether you can tell if they're a technical guy as opposed to a business user). For the moment though let's not think too hard about this part. My question is, to what extent should the software be responsible for trying to explain the meaning of the fatal error? In general, how much competence/knowledge are you allowed to presume on administrators of the software, and how much should you include troubleshooting information and potential resolution steps when logging fatal errors? Of course if there's something that's unique to the runtime context this should definitely be logged; but lets assume your software needs to talk to Active Directory via LDAP and gets back an error "[LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 525, vece]". Is it reasonable to assume that the maintainers will be able to Google the error code and work out what it means, or should the software try to parse the error code and log that this is caused by an incorrect user DN in the LDAP config? I don't know if there is a definitive best-practices answer for this, so I'm keen to hear a variety of views.

    Read the article

  • How do you get "in the zone"?

    - by Wayne Werner
    Hi, I've just started my first real programming job and am pleased to discover that this is exactly what I want to do for the rest of my life. When it comes round to ~1 hour before it's time to go home and I think "Man, do I have to go home already?" I'd say that's A Good Thing(tm). One thing I've discovered though is that it takes a little while for my brain to get "in gear" or "in the Zone", so I'm curious what other folks do to get programming at their prime. My current flow is when I get here I visit SO and look at the interesting problems - I find it helps get my brain moving. After 20-30 minutes I start looking at my code/specs/etc to decide what I want/need to work on first. So how do you get started?

    Read the article

  • Local web apps and W3C standards.

    - by Babiker
    If am writing a local app that will only run using a specific browser, am i setting my self up by slightly ignoring W3C's standards? I ask this question because in this app i am thinking of using custom HTML tags, custom attributes, etc... Thanks in advance guys.

    Read the article

  • Developer friendly open-source license?

    - by Francisco Garcia
    As a software engineer/programmer myself, I love the possibility to download the code and learn from it. However building software is what brings food to my table. I have doubts regarding the type of license I should use for my own personal projects or when picking up one project to learn from. There are already many questions about licenses on Stackoverflow, but I would like to make this one much more specific. If your main profession and way of living is building software, which type of license do you find more useful for you? And I mean, the license that can benefit you most as a professional because it gives you more freedom to reuse the experience you gain. GPL is a great license to build communities because it forces you to give back your work. However I like BSD licenses because of their extra freedom. I know that if the code I am exploring is BSD licensed, I might be able to expand not only my skills, but also my programmer toolbox. Whenever I am working for a company, I might recall that something similar was done in another project and I will be able to copy or imitate certain part of the code. I know that there are religious wars regarding GPL vs BSD and it is not my intention to start one. Probably many companies already take snipsets from GPL projects anyway. I just want to insist in the factor of professional enrichment. I do not intend to discriminate any license. I said I prefer BSD licenses but I also use Linux because the user base is bigger and also the market demand.

    Read the article

  • Better Java method Syntax? Return early or late? [closed]

    - by Gandalf
    Duplicate: Should a function have only one return statement? and Single return or multiple return statements? Often times you might have a method that checks numerous conditions and returns a status (lets say boolean for now). Is it better to define a flag, set it during the method, and return it at the end : boolean validate(DomainObject o) { boolean valid = false; if (o.property == x) { valid = true; } else if (o.property2 == y) { valid = true; } ... return valid; } or is it better/more correct to simply return once you know the method's outcome? boolean validate(DomainObject o) { if (o.property == x) { return true; } else if (o.property2 == y) { return true; } ... return false; } Now obviously there could be try/catch blocks and all other kinds of conditions, but I think the concept is clear. Opinions?

    Read the article

  • Caffeine and Stimulant Usage

    - by Jon Purdy
    Let's see how many of us fit the old stereotype, shall we? Do you typically use caffeine when programming? During the day or at night? How frequently do you pull all-nighters? Do you use caffeine when you do stay up late? Do you prefer to have a large amount of caffeine all at once, or small amounts over a longer period of time? Do you use energy drinks, 5-hour energy shots, coffee, tea, or caffeine pills? How about other stimulants such as amphetamines? For instance, I've known a programmer who dabbled in speed because they believed it increased their ability to focus on programming, though happily they're clean now and quite honest about the whole experience. Share, discuss, find the Ballmer Peak of caffeine, enjoy. Happy Easter.

    Read the article

  • Career day in kindergarten

    - by Péter Török
    I was invited to the kindergarten group of my elder daughter to talk and answer the kids' questions about my profession. There are 26 kids of age 4-6 in the group, plus 3 teachers who are fairly scared of anything related to programming and IT themselves, but bold enough to learn new tricks. I would have about 20-30 minutes, without projector or anything. They have an old computer though, which by its look may be a 486, and I am not even sure if it's functioning. My research turned up excellent earlier threads, with lots of good tips: How would you explain your job to a 5-year old? Career Day: how do I make “computer programmer” sound cool to 8 year olds? What things can I teach a group of children about programming in one day? My situation is different from each of the above though: the latter ones are concerned with older children, while the first one is about talking to a single kid (or elder person)—a group of 20 is a whole different challenge. How can I teach the kids and their teachers about programming in a fun way?

    Read the article

  • Clear form button in HTML...do we really need this?

    - by craigmoliver
    I usually add the clear form button to HTML forms by default, but tonight I had what alcholics call a "moment of clarity". Why the hell do we add this? In all my years of using the internet I have never gotten to the end of the form and thought "crap!, I screwed up, I need to reset this!". Is this button actually necessary or a hold over from another time?

    Read the article

  • What lessons can you learn from software maintanence?

    - by Vasil Remeniuk
    Hello everyone, In the perfect world, all the software developers would work with the cutting edge technologies, creating systems from the scratch. In the real life, almost all of us have to maintain software from time to time (unlucky ones do it on a regular basis). Personally I first 2 years of my career was fixing bugs in the company that no longer exists (it has been taken up by Oracle). And probably the biggest lesson I've learned that time - despite of the pressure, always try to get as much information about the domain as possible (even if it's irrelevant to fixing a specific bug or adding a feature) - abstract domain knowledge doesn't lose value as fast as knowledge about trendy frameworks or methodologies. What lessons have you learned from maintenance?

    Read the article

  • Tab versus space indentation in C#

    - by Lars Fastrup
    I sometimes find myself discussing this issue with other C# developers and especially if we use different styles. I can see the advantage of tab indentation allowing different developers to browse the code with their favorite indent size. Nonetheless, I long ago went for two space indentation in my C# code and have stuck with it ever since. Mainly because I often disliked the way statements spanning multiple lines are sometimes messed up when viewing code from other developers using another tab size. Recently a developer at one of my clients approached me and asked why I did not use tabs because he preferred to view code with an indentation size of 4. So my question is: Which style do you prefer and why?

    Read the article

  • Why is distributed source control considered harder?

    - by Will Robertson
    It seems rather common (around here, at least) for people to recommend SVN to newcomers to source control because it's "easier" than one of the distributed options. As a very casual user of SVN before switching to Git for many of my projects, I found this to be not the case at all. It is conceptually easier to set up a DCVS repository with git init (or whichever), without the problem of having to set up an external repository in the case of SVN. And the base functionality between SVN, Git, Mercurial, Bazaar all use essentially identical commands to commit, view diffs, and so on. Which is all a newcomer is really going to be doing. The small difference in the way Git requires changes to be explicitly added before they're committed, as opposed to SVN's "commit everything" policy, is conceptually simple and, unless I'm mistaken, not even an issue when using Mercurial or Bazaar. So why is SVN considered easier? I would argue that this is simply not true.

    Read the article

  • Single-letter prefix for PHP class constants?

    - by keithjgrant
    I've noticed many (all?) PHP constants have a single-letter prefix, like E_NOTICE, T_STRING, etc. When defining a set of class constants that work in conjunction with one another, do you prefer to follow similar practice, or do you prefer to be more verbose? class Foo { // let's say 'I' means "input" or some other relevant word const I_STRING = 'string'; const I_INTEGER = 'integer'; const I_FLOAT = 'float'; } or class Bar { const INPUT_STRING = 'string'; const INPUT_INTEGER = 'integer'; const INPUT_FLOAT = 'float'; }

    Read the article

  • Most interesting and challenging programming tasks

    - by dsimcha
    Some programmers enjoy optimizing code to make the implementation as fast as humanly possible; or golfing to make code as compact as possible. Others enjoy metaprogramming to make code generic, or designing algorithms to be asymptotically efficient. What do you find most interesting and challenging as a programmer?

    Read the article

  • Are we using IoC effectively?

    - by Juliet
    So my company uses Castle Windsor IoC container, but in a way that feels "off": All the data types are registered in code, not the config file. All data types are hard-coded to use one interface implementation. In fact, for nearly all given interfaces, there is and will only ever be one implementation. All registered data types have a default constructor, so Windsor doesn't instantiate an object graph for any registered types. The people who designed the system insist the IoC container makes the system better. We have 1200+ public classes, so its a big system, the kind where you'd expect to find a framework like Windsor. But I'm still skeptical. Is my company using IoC effectively? Is there an advantage to new'ing objects with Windsor than new'ing objects with the new keyword?

    Read the article

  • Google Code + SVN or GitHub + Git

    - by Nazgulled
    Let me start by telling you that I never used anything besides SVN and I'm also a Windows user. I have a couple of simple projects that are open-source, others are on there way when I'm happy enough to release their source code but either way, I was thinking of using Google Code and SVN to share the source code of my projects instead of providing a link to the source on my website. This as always been a pain cause I had to update the binaries and the code every time I released a new version. This would also help me out to have a backup of my code some where instead of just my local machine (I used to have a local Subversion server running). What I want from a service like this is very simple... I just want a place to store my source code that people can download if they want, allows me to control revisions and provide a simple and easy issue system so people can submit bugs and stuff like that. I guess both of them have this. But I don't want to host any binaries in their websites, I want this to be hosted on my website so I can control download statistics with my own scripts, I also don't have the need for wiki pages as I prefer to have all the documentation in my own website. Does anyone of this services provide a way to "disable" features like wiki and downloads and don't show them at all for my project(s)? Now, I'm sure there are lots of pros and cons about using Google Code with SVN and GitHub with Git (of course) but here's what it's important for me on each one and why I like them: Google Code: As with any Google page, the complexity is almost non-existent Everyone (or almost) as a Google account and this is nice if people want to report problems using the issues system GitHub: May (or may not) be a little more complex (not a problem for me though) than Google's pages but... ...has a much prettier interface than Google's service It needs people to be registered on GitHub to post about issues I like the fact that with Git, you have your own revisions locally (can I use TortoiseGit for this or?) Basically that's it, not much I know... What other, most common, pros and cons can you tell me about each site/software? Keep in mind that my projects are simple, I'm probably the only one who will ever develop these projects on these repositories (or maybe not, for now I will)

    Read the article

  • How to build Object Oriented Skills?

    - by cedar715
    Being a core developer for couple of years, coding applications seeing the class diagrams, sequence diagrams, I decided to improve my self, taking the next step of designing. As I'm an OO developer, I'm interested in improving my design skills. For Example, I had a hard time designing a currency converter. My questions to the SO: Is it by experience the design skills can be acquired? Will learning books/blog/material over internet etc help? Is it that one needs the domain knowledge of the application being developed? Knowing Design patterns, principles? Studying 'Code Complete' book ? Need to have Problem-solving skills? In short, given a problem, I just want to solve it in Object-oriented way??

    Read the article

  • Is it bad practice to have a long initialization method?

    - by Paperflyer
    many people have argued about function size. They say that functions in general should be pretty short. Opinions vary from something like 15 lines to "about one screen", which today is probably about 40-80 lines. Also, functions should always fulfill one task only. However, there is one kind of function that frequently fails in both criteria in my code: initialization functions. For example in an audio application, the audio hardware/API has to be set up, audio data has to be converted to a suitable format and the object state has to properly initialized. These are clearly three different tasks and depending on the API this can easily span more than 50 lines. The thing with init-functions is that they are generally only called once, so there is no need to re-use any of the components. Would you still break them up into several smaller functions would you consider big initialization functions to be ok?

    Read the article

  • Brilliant features of C++

    - by John
    (Following Features to remove from C++ and Desired features for C++, I thought why not complete the trio...) What C++ features would you not change? What features are elegantly and brilliantly implemented and still look better than other popular languages?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >