Search Results

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

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

  • Strategy pattern and "action" classes explosion

    - by devoured elysium
    Is it bad policy to have lots of "work" classes(such as Strategy classes), that only do one thing? Let's assume I want to make a Monster class. Instead of just defining everything I want about the monster in one class, I will try to identify what are its main features, so I can define them in interfaces. That will allow to: Seal the class if I want. Later, other users can just create a new class and still have polymorphism by means of the interfaces I've defined. I don't have to worry how people (or myself) might want to change/add features to the base class in the future. All classes inherit from Object and they implement inheritance through interfaces, not from mother classes. Reuse the strategies I'm using with this monster for other members of my game world. Con: This model is rigid. Sometimes we would like to define something that is not easily achieved by just trying to put together this "building blocks". public class AlienMonster : IWalk, IRun, ISwim, IGrowl { IWalkStrategy _walkStrategy; IRunStrategy _runStrategy; ISwimStrategy _swimStrategy; IGrowlStrategy _growlStrategy; public Monster() { _walkStrategy = new FourFootWalkStrategy(); ...etc } public void Walk() { _walkStrategy.Walk(); } ...etc } My idea would be next to make a series of different Strategies that could be used by different monsters. On the other side, some of them could also be used for totally different purposes (i.e., I could have a tank that also "swims"). The only problem I see with this approach is that it could lead to a explosion of pure "method" classes, i.e., Strategy classes that have as only purpose make this or that other action. In the other hand, this kind of "modularity" would allow for high reuse of stratagies, sometimes even in totally different contexts. What is your opinion on this matter? Is this a valid reasoning? Is this over-engineering? Also, assuming we'd make the proper adjustments to the example I gave above, would it be better to define IWalk as: interface IWalk { void Walk(); } or interface IWalk { IWalkStrategy WalkStrategy { get; set; } //or something that ressembles this } being that doing this I wouldn't need to define the methods on Monster itself, I'd just have public getters for IWalkStrategy (this seems to go against the idea that you should encapsulate everything as much as you can!) Why? Thanks

    Read the article

  • Should I redesign my code when collegues says so?

    - by Kirill V. Lyadvinsky
    I wrote a function recently that finds maximum of two ints. Here is a code: int get_max (int(*a)(int(*)(int(*)()),int(*)(int(*)(int**))), int(*b)(int(*) (int(*)()),int*,int(*)(int(*)()))){return (int)((((int(*)(int(*)(int(*)()),int( *)(int(*)())))a)> ((int(*)(int(*)(int(*)()),int(*)(int(*)())))b))?((int(*)( int(*)(int(*)()),int(*)(int(*)())))a):((int(*)(int(*)(int(*)()),int(*)(int(*)( ))))b));} int main() { int x = get_max( (int(*)(int(*)(int(*)()),int(*)(int(*)(int**)))) 500, (int(*)(int(*)(int(*)()),int*,int(*)(int(*)()))) 100 ); cout << x << endl; // prints 500 as expected return 0; } It works fine, but my collegue says that I shouldn't use C style casts. But I think that all that modern static_cast's and reinterpret_cast's will make my code too cumbersome. Who's right? Should I redesign my code using C++ style casts or original code is OK?

    Read the article

  • When do married programmers find time to work?

    - by dave-keiture
    Hi people, Maybe my problem is unique (though I don't believe so), and probably I should go with it to the psychologist, but sinse I get married (~year ago) I feel that I don't have enough time to work anymore. For years I've been working at my day job doing regular stuff, and at nights I've been committing to the opensource projects, freelancing and self-educating. Now, I can't work at home at all, because once I start working, my wife either says that there're more important thing to do (walk out the dog, buy something in a grocery, etc.) or that I don't pay anough attention to her.. As a workaround, I've started getting up at 3-4AM in the morning to do the things I was usually doing nightly before. After a month of such schedule I feel myself totally crushed. So... 2 questions: Do you have the same problems, or I'm just a <..., who should say goodbye to programming, and start doing "really important things"? If you have the same problems, when do you find time to work? Maybe you know any cool lifehack or trick to spend at least some tome for doing the thing you like :) Best regards.

    Read the article

  • What is the most important thing you weren't taught in school?

    - by Alexandre Brisebois
    What is the most important thing you weren't taught in school? What topics are missing from the CS/IS education? Posted so far How to sell an idea Principles: Often, good enough is better than perfect. Making mistakes is actually a Good Thing™ -- as long as they're new mistakes. If a user can break your code they will. In the Real World™ they're all open-book exams Self confidence is way more important in getting ahead than intelligence. Always prefer simplicity over complexity. The best code is the code that you don't write. You never know when you'll meet someone again ... or where. It's always worthwhile to treat people with respect and kindness. Be aware of what you don't know and don't be afraid to ask questions when you need to Missing knowledge: How to communicate effectively. Lack of source control Lack of Softskills experience How to productize code How to write secure code How to formulate problems How to self-measurement. To evaluate ones true competences and market worth. How to debug code How important is backup How to read code on a large scale (being able to adapt and build upon existing projects) Good Regular expressions comprehension How to teach others effectively TDD/Unit testing Critical thinking How to integrate different skills and languages in a single project

    Read the article

  • Is this good C# style?

    - by burnt1ce
    Consider the following method signature: public static bool TryGetPolls(out List<Poll> polls, out string errorMessage) This method performs the following: accesses the database to generate a list of Poll objects. returns true if it was success and errorMessage will be an empty string returns false if it was not successful and errorMessage will contain an exception message. Is this good style? Update: Lets say i do use the following method signature: public static List<Poll> GetPolls() and in that method, it doesn't catch any exceptions (so i depend the caller to catch exceptions). How do i dispose and close all the objects that is in the scope of that method? As soon as an exception is thrown, the code that closes and disposes objects in the method is no longer reachable.

    Read the article

  • Future of Subversion?

    - by Achilles
    After reading Joel's last blog posting and having been a recent adopter of Subversion, I was wondering if anyone had any insight as to what the future of Subversion might be? Will the product evolve to accommodate distributed development or is it at the end of its life?

    Read the article

  • Business Logic Layer Pattern on Rails? MVCL

    - by Fabiano PS
    That is a broad question, and I appreciate no short/dumb asnwers like: "Oh that is the model job, this quest is retarded (period)" PROBLEM Where I work at people created a system over 2 years for managing the manufacture process over demand in the most simplified still broad as possible, involving selling, buying, assemble, The system is coded over Ruby On Rails. The app has been changed lots of times and the result is a mess on callbacks (some are called several times), 200+ models, and fat controllers: Total bad. The QUESTION is, if there is a gem, or pattern designed to handle Rails large app logic? The logic whould be able to fully talk to models (whose only concern would be data format handling and validation) What I EXPECT is to reduce complexity from various controllers, and hard to track callbacks into files with the responsibility to handle a business operation logic. In some cases there is the need to wait for a response, in others, only validation of the input is enough and a bg process would take place. ie: -- Sell some products (need to wait the operation to finish) 1. Set a View able to get the products input 2. Controller gets the product list inputed by employee and call the logic Logic::ExecuteWithResponse('sell', 'products', :prods => @product_list_with_qtt, :when => @date, :employee => current_user() ) This Logic would handle buying order, assemble order, machine schedule, warehouse reservation, and others. Have in mind that a callback on SalesOrder is not enough, since it depends on where it is called (no field for that), depends on the class of the user, among other stuff not visible for the model, or in some cases it would take long for the model to process.

    Read the article

  • Is it worth learning Perl 6?

    - by Andres
    I have the opportunity to take a two day class on Perl 6 with the Rakudo Compiler. I don't want to start a religious war, but is it worth my time? Is there any reason to believe that Perl 6 will be practical in the real world within the next two years? Does anyone currently use it effectively? Update I took the class and learned a lot. However, after day 1, my mind was a bit overwhelmed. There are tons of cool ideas in perl 6, and it will be neat to see what filters up to other languages. Overall the experience was a positive use of my time, though I wasn't able to absorb as much on the second day. If it were a three day class it would have been unproductive just because there is a limit to how much you can process in a short amount of time.

    Read the article

  • SCM/VCS: Tracking directories

    - by Roger Pate
    When I first found out that Mercurial tracked files and not directories, I was a bit disappointed. (This means you can't represent an empty directory in the repo.) However, it doesn't seem to be an issue in practice, and makes some things a tad easier for me. How about other SCM systems? (Edit this post to add them.) What advantages or disadvantages have you found by not tracking directories? (Each one separately in an answer, please.) Do track directories: Subversion Bazaar/bzr (add one!) Do NOT track directories: Mercurial/hg git (add one!)

    Read the article

  • What is the best IDE to develop Android apps in?

    - by Jamey McElveen
    I am about to start developing an android app and need to get an IDE. Eclipse and the android eclipse plugin appears to be the natural choice. However I am familiar with intelliJ and re-sharper so I would prefer use intelliJ. Has anyone used http://code.google.com/p/idea-android/"http://code.google.com/p/idea-android/? Is this any good? Should I just bite the bullet and learn Eclipse?

    Read the article

  • Template engine recommendations

    - by alex
    I'm looking for a template engine. Requirements: Runs on a JVM. Java is good; Jython, JRuby and the like, too... Can be used outside of servlets (unlike JSP) Is flexible wrt. to where the templates are stored (JSP and a lot of people require the templates to be stored in the FS). It should provide a template loading interface which one can implement or something like that Easy inclusion of parameterized templates- I really like JSP's tag fragments Good docs, nice code, etc., the usual suspects I've looked at JSP- it's nearly perfect except for the servlet and filesystem coupling, Stringtemplate- I love the template syntax, but it fails on the filesystem coupling, the documentation is lacking and template groups and stuff are confusing, GXP, TAL, etc. Ideas, thoughts? Alex

    Read the article

  • Interactive Data Language, IDL: Does anybody care?

    - by Alex
    Anyone use a language called Interactive Data Language, IDL? It is popular with scientists. I think it is a poor language because it is proprietary (every terminal running it has to have an expensive license purchased) and it has minimal support (try searching for IDL, the language, right now on stack) . I am trying to convince my colleagues to stop using it and learn C/C++/Python/Fortran/Java/Ruby. Does anybody know about or even care about IDL enough to have opinions on it? What do you think of it? Should I tell my colleagues to stop wasting their time on it now? How can I convince them? Edit: People are getting the impression that I don't know or use IDL. Also, I said IDL has minimal support which is true in one sense, so I must clarify that the scientific libraries are indeed large. I use IDL all the time, but this is exactly the problem: I am only using IDL because colleagues use it. There is a file format IDL uses, the .sav, which can only be opened in IDL. So I must use IDL to work with this data and transfer the data back to colleagues, but I know I would be more efficient in another language. This is like someone sending you a microsoft word file in an email attachment and if you don't understand how wrong that is then you probably write too many words not enough code and you bought microsoft word. Edit: As an alternative to IDL Python is popular. Here is a list of The Pros of IDL (and the cons) from AstroBetter: Pros of IDL Mature many numerical and astronomical libraries available Wide astronomical user base Numerical aspect well integrated with language itself Many local users with deep experience Faster for small arrays Easier installation Good, unified documentation Standard GUI run/debug tool (IDLDE) Single widget system (no angst about which to choose or learn) SAVE/RESTORE capability Use of keyword arguments as flags more convenient Cons of IDL Narrow applicability, not well suited to general programming Slower for large arrays Array functionality less powerful Table support poor Limited ability to extend using C or Fortran, such extensions hard to distribute and support Expensive, sometimes problem collaborating with others that don’t have or can’t afford licenses. Closed source (only RSI can fix bugs) Very awkward to integrate with IRAF tasks Memory management more awkward Single widget system (useless if working within another framework) Plotting: Awkward support for symbols and math text Many font systems, portability issues (v5.1 alleviates somewhat) not as flexible or as extensible plot windows not intrinsically interactive (e.g., pan & zoom) Pros of Python Very general and powerful programming language, yet easy to learn. Strong, but optional, Object Oriented programming support Very large user and developer community, very extensive and broad library base Very extensible with C, C++, or Fortran, portable distribution mechanisms available Free; non-restrictive license; Open Source Becoming the standard scripting language for astronomy Easy to use with IRAF tasks Basis of STScI application efforts More general array capabilities Faster for large arrays, better support for memory mapping Many books and on-line documentation resources available (for the language and its libraries) Better support for table structures Plotting framework (matplotlib) more extensible and general Better font support and portability (only one way to do it too) Usable within many windowing frameworks (GTK, Tk, WX, Qt…) Standard plotting functionality independent of framework used plots are embeddable within other GUIs more powerful image handling (multiple simultaneous LUTS, optional resampling/rescaling, alpha blending, etc) Support for many widget systems Strong local influence over capabilities being developed for Python Cons of Python More items to install separately Not as well accepted in astronomical community (but support clearly growing) Scientific libraries not as mature: Documentation not as complete, not as unified Not as deep in astronomical libraries and utilities Not all IDL numerical library functions have corresponding functionality in Python Some numeric constructs not quite as consistent with language (or slightly less convenient than IDL) Array indexing convention “backwards” Small array performance slower No standard GUI run/debug tool Support for many widget systems (angst regarding which to choose) Current lack of function equivalent to SAVE/RESTORE in IDL matplotlib does not yet have equivalents for all IDL 2-D plotting capability (e.g., surface plots) Use of keyword arguments used as flags less convenient Plotting: comparatively immature, still much development going on missing some plot type (e.g., surface) 3-d capability requires VTK (though matplotlib has some basic 3-d capability)

    Read the article

  • How significant is the bazaar performance factor?

    - by memodda
    I hear all this stuff about bazaar being slower than git. I haven't used too much distributed version control yet, but in Bazaar vs. Git on the bazaar site, they say that most complaints about performance aren't true anymore. Have you found this to be true? Is performance pretty much on par now? I've heard that speed can affect workflow (people are more likely to do good thing X if X is fast). What specific cases does performance currently affect workflow in bazaar vs other systems (especially git), and how? I'm just trying to get at why performance is of particular importance. Usually when I check something in or update it, I expect it to take a little while, but it doesn't matter. I commit/update when I have a second, so it doesn't interfere with my productivity. But then I haven't used DVCS yet, so maybe that has something to do with it?

    Read the article

  • What's Your Biggest Visual Studio 2008 Annoyance?

    - by Kyle West
    I love Visual Studio about 90% of the time, but that last 10% it is such a PITA it makes me want to launch my monitor off the desk. My latest annoyances: It won't remember my toolbar settings. I don't want any toolbars, ever. Quit popping open the CSS editor or XML editor or text editor everytime I open a file. Doesn't remember which regions I had expanded or collapsed and as far as I know there is no way to tell it to always open files with the regions expanded. When editing CSS or HTML the damn error list wants to pop up each time I start a tag and haven't finished it yet. First of all, don't pop up at all. And if you're going to ... give me a couple seconds to finish what I'm doing. The best part ... ReSharper :) EDIT [Jay Bazuzi]: It seems like this discussion is only productive if it's focused on the latest released version. Set the title to VS2008.

    Read the article

  • how could installations/configurations be easier in linux?

    - by ajsie
    although you can do anything in linux it tends to require a lot of tweaking in config files and reading a lot of manuals/tutorials before you can have it running in your way. i know that it gets a lot easier by time, and the apt-get installations with ubuntu/debian is heading the right way. but how can linux be more userfriendly for us in the future? i thought that if more is automated like an IDE environment, eg. typing svn will give us all the commands and description about each command when you move between commands with your keyboard. that would be great. but that's just one example. another is the navigation in the terminal between folders. now you have to type a lot just to jump from/to different folders. would be great with some more automatization here too. i know that these extra features will slow down the server, but its 2010 now, and these features are not that heavy for the cpu, but makes it more userfriendly and encourage maintainance of a server, not frighten u off. what do you think about this? should/could we have more user friendly linux environment in servers, something that has annoyed you a lot? a lot of things are done in the unix way, but maybe we should reinvent the wheel in some areas, cause apparently, its so...repeatingly today and difficult to do easy tasks. it should be easier i think..

    Read the article

  • What should programmers practice every day?

    - by Jacinda S
    Musicians practice scales, arpeggios, etc. every day before they begin playing "real" music. The top sports players spend time every day practicing fundamentals like dribbling before playing the "real" game. Are there fundamentals that programmers should practice every day before writing "real" code?

    Read the article

  • Aptana RadRails?

    - by salt.racer
    I've been using a text editor for my rails app for a while and I have a workflow that I am happy with for my existing app. However, I am about to be starting a new app and it appears that Aptana RadRails is sufficiently developed and stable enough for use. (The last time I tried it it was in beta and wasn't quite fully baked.) So my question is: Is it widely used in the community? What are peoples general thoughts on it?

    Read the article

  • Language for non-programmers to start learning programming

    - by zarawesome
    A non-programmer friend will be starting the Computer Science college course in a few months. I'd like her to try her hand at some programming before she starts her studies (the course itself expects one to know C, but it's an horrible language to learn to program at). What language would be the best to do so? Related question: Best ways to teach a beginner to program?

    Read the article

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