title: How to go about bring up the topic of bad programming practices with colleague

text: > **Possible Duplicate:**   >  How do I approach a coworker about his or her code quality? My development colleague is producing numerous blocks of code which I am a bit concerned doesn't really make for easy reading and potential issues in the future. I've tried giving little tips along the way without blantantly saying what I think but his technique never seems to change. I wouldn't normally be worried however we never identified any specific programming standards at the beginning of our project and it's now really starting to effect me a bit as I have to go through his code and try and debug it. A small snippet of just a small part of the code is as such.               foreach(DistributionRecord record in _manager.Distributions)     {         foreach (Engine.Model.DistributionModel.LossFromAtmosphericConditionsEnum NLossAt                         in Enum.GetValues(typeof(Engine.Model.DistributionModel.LossFromAtmosphericStructureEnum)))                         if (record.NlossAt.ContainsKey(NLossAt))                             if (record.NlossAt[NLossAt].ContainsKey(DistributionModel.LossFromAtmosphericConditionsEnum.Atvolat))                                 _indirect[GetIndirectSourceEnumFromEnterpriseType(record)] += record.NlossAt[NLossAt][DistributionModel.LossFromAtmosphericConditionsEnum.Atvolat]                                     * _manager.Scenario.Management.EmissionFactors.EmissionFactorIndirectBackgroundVolatisation;                          foreach (Engine.Model.DistributionModel.LossOffEnum lossOff in Enum.GetValues(typeof(Engine.Model.DistributionModel.LossOffEnum)))                         if (enterprise.NlossOff.ContainsKey(lossOff))                             if (enterprise.NlossOff[lossOff].ContainsKey(DistributionModel.LossTypesEnum.lossleach))                                 _indirect[GetIndirectSourceEnumFromEnterpriseType(record)] += record.NlossOff[lossOff][DistributionModel.LossTypesEnum.lossleach][NutrientEnum.N].Value                                     * _manager.Scenario.Management.EmissionFactors.EmissionFactorN2OIndirectBackgroundLeach;     }      I've talked to the boss and without blatantly saying it explained my concerns etc I don't know what else to do. Not sure if this is appropriate for this forum but any advice would be appreciated basically on how I can tackle this with my colleague. Or perhaps I'm just being unrealistic and gotta get with the real world in that this is just how some people write code and it's ok?


title: How to code review without offending other developers

text: I work on a team that does frequent code reviews. But it seems like more of a formality than anything. No one really points out problems in the code for fear of offending other developers. The few times I've tried to ask for changes were met with very defensive and reluctant attitudes. This is of course not good. Not only are we spending the time to code review, but we're getting literally zero value from it. Is this an issue that needs to be addressed by individual developers, or are there techniques for suggesting changes without stepping on other people's toes?


title: Starting Up Code Review Process Where there Previously Was None?

text: Any tips for a group needing to start code reviews? We have no real software engineering processes currently. I have been working as software engineer for 7 years and have never seen any real processes implemented at the various places I have worked, though many books espouse all kinds of engineering methodologies. The management supports the idea of enabling new processes, though there is some resistance from the senior engineer who has over 20 years of software engineering experience. We are a set of two programmers, with no software engineering manager. We report direct to the managing director of the Company. But we work on numerous software projects. The real reason why we have to begin performing code reviews is because of PA-DSS requirements. Therefore, I am pushing for us to do code reviews all around - not just on the payment application software.


title: How can I tactfully suggest improvements to others' badly designed code during review?

text: I'm a great believer in clean code and code craftsmanship, though I'm currently at a job where this isn't regarded as a top priority. I sometimes find myself in a situation where a peer's code is _riddled_ with messy design and very little concern for future maintenance, though it's functional and contains little to no bugs. How do you go about suggesting improvements in a code review when you believe there is so much that needs changing, and there's a deadline coming up? Keep in mind that suggesting the improvements be made _after_ the deadline may mean they'll be de-prioritized altogether as new features and bug-fixes come in.


title: How do you make people accept code review?

text: All programmers have their style of programming. But some of the styles are let’s say... let’s not say. So you have code review to try to impose certain rules for good design and good programming techniques. But most of the programmers don’t like code review. They don’t like other people criticizing their work. _Who do they think they are to consider themselves better than me and tell me that this is bad design, this could be done in another way. It works right? What is the problem?_ This is something they might say (or think but not say which is just as bad if not worse). So how do you make people accept code review without starting a war? How can you convince them this is a good thing; that will only improve their programming skills and avoid a lot of work later to fix and patch a zillion times a thing that hey... "it works"? People will tell you how to make code review (peer-programming, formal inspections etc) what to look for in a code review, studies have been made to show the number of defects that can be discovered before the software hits production etc. But how do you convince programmers to accept a code review?


title: Fixing a bug while working on a different part of the code base

text: This happened at least once to me. I'm working on some part of the code base and find a small bug in a different part, and the bug stops me from completing what I'm currently trying to do. Fixing the bug could be as simple as changing a single statement. What do you do in that situation?   1. Fix the bug and commit it together with your current work   2. Save your current work elsewhere, fix the bug in a separate commit, then continue your work [1]   3. Continue what you're supposed to do, commit the code (even if it ~~breaks the build~~ fails some tests), then fix the bug (and ~~the build~~ make tests pass) in a separate commit [1] In practice, this would mean: clone the original repository elsewhere, fix the bug, commit/push the changes, pull the commit to the repository you're working on, merge the changes, and continue your work. **Edit:** I changed number three to reflect what I really meant.


title: How to deal with someone who dislikes the idea of code reviews?

text: Obviously, if management buy into spending time with code reviews, then everyone has to do it. But there are always those guys (or gals) who resist with every ounce of their being. How do you effectively manage dealing with this scenario when dealing with it as the peer reviewer?


title: What to do if a team member delivers bad quality code?

text: I work as a kind of mixture of a Scrum Master and a team lead. In my team I have the problem that one of the members delivers bad quality. The code he produces is difficult to understand, difficult to maintain by anybody else than the guy himself. The solutions are more a "hack" (if not a botch) than a conceptual or elaborated work. And what is worst: he doesn't see it. He thinks he is a quite good programmer, when all the other team members are constantly complaining about his code - when he's not there (which is not so difficult since the guy works remote most of the time). They all avoid to tell him what they think about his work because they don't want to offend or demotivate him. What should I do?   * Try to tell him what the others think in 1-to-1 meeting? But I don't find it right to say "the others are complaining" when the others are not there and don't bring up their examples.    * Set up a team meeting and encourage the other members to tell what they think? But this feels like a tribunal to me. (And all against one is not fair.)   * Something else?


title: How to integrate code reviews to a team

text: I work in a team that keeps growing. However, there are no code reviews and I see this as a problem every day. There are people with really limited skills committing code to our repository that I believe should not commit. I'm not the team leader nor am I in a management position. I already proposed code reviews about 6 months ago and there was no feedback received. Nor were there any code reviews. I know code reviews would benefit everyone including the more experienced. Has anyone had any experience trying to integrate code reviews in a team? What did you propose and how did you do it?


title: How to do structured code reviews

text: We need to do pre-check-in code reviews. We are using Visual Studio and TFS. The built in code review functionality, is a bit odd to me. If I "reject" a check-in and comments what needs work, the review goes away. When the developer then makes the changes, he requests a new review, and I start all over again. Now, let's just say there are 10 files in this check-in. Maybe 7 of them were originally fine. Now, I have to review them again, as we are doing a brand new review. OR, I can track myself, what I have done. I can also, ONLY compare code with the original version, not the one from the reject review. So, my questions are:   1. what do you guys do?    2. What are your experiences with pre-checkin code reviews?


title: What does a code review look like?

text: I'm writing a code review process document for our team; we've never had a formal process in place although we do do some code review. I've found lots of articles talking about how important code review is, but I have one question in particular that I haven't found the answer to on the web... is the programmer part of the code review? In other words, should a code review be 2 people sitting together, going over what's in the code, or should it be 1 person looking at another person's code? Most often, our projects are done by a team of 2 people, so before it is sent to QA, should those 2 people just sit together and go over the entire project, including what each of them have written? Or, should they just both look at each other's code? I can see advantages to each. Finally, what happens with issues found during code review? Are they noted, and then sent back to the programmer? Or should the reviewer note them and then just fix them? Or is it ever ok to make a change and not even tell the programmer specifically what you found?


title: What feedback is or is not appropriate for a code review?

text: I am interested in hearing some guidelines as to what feedback is or is not appropriate for a code review. My team has a very unstructured review process and I am trying to suggest some ways to improve it. I am no expert so I hope to hear from you experts out there!   1. Should code review comments be limited to actual problems with the code?   2. Are criticisms about other LOC in the file appropriate even if those lines are not being modified? i.e., criticism of pre-existing code?   3. What about suggestions of different ways to solve the same problem? Should I suggest a new way only when a case can be made for it being better? How do I draw the line between contributing ideas but not sounding like a know-it-all?   4. In matters which are purely a difference of opinion, who should get the 'final say'? The author, the person who knows the code base the best, the person with the highest title or someone else?   5. Any other advice for ensuring the code reviews serve their purpose without unnecessarily blocking the developer's progress? Please, if you could, provide reasoning along with any answers. It will help this junior developer be able to really understand the best way to approach a code review.


title: Fixing bugs in other peoples code

text: I'm working with another programmer and we are always having issues with refactoring or changing each others code. Recently I had to fix a bug, but I pushed the changes before notifying him. He was very upset about it. Should I have talked to him about it before the push? This is a hobby project btw. What is the best way to change other peoples code when we don't have a project manager or coding standard?


title: How to make code-review feel less like a way to *shift* the responsibility?

text: Sometimes it seems to me that people ask for code-reviews just so they would be able to say "Xyz reviewed my code!"(1) when something broke. Question, is that ever the case? (Or is it just my imagination) If it is, how do I handle this? (1): What s/he really meant: It's Xyz's fault or something along those lines.


title: Getting coders to do code review

text: I am running a project where I pay developers to contribute to my semi open source project. My problem is that it is easy to hire developers, but it is very difficult to get anyone to do code reviewing. I have repeatedly attempted to get the senior developers to review the code of the junior developers. I have attempted to pay them more, give them higher status etc. But they just seem to want to code instead of reviewing code. Now I am considering forcing all developers that want to code, to also review code, but I have a feeling that it is a bad idea. My question is, therefore, how can I motivate capable people to review the code of others? How is this done in successful open source projects like Linux, PostgreSQL, LibreOffice etc.


title: What's the most effective way to perform code reviews?

text: I've never found the ideal way to perform code reviews and yet often my customers require them. Each customer seems to do them in a different way and I've never felt satisfied in any of them. What has been the most effective way for you to perform code reviews? For example:   * Is one person regarded as the gatekeeper for quality and reviews the code, or do the team own the standard?    * Do you do review code as a team exercise using a projector?   * Is it done in person, via email or using a tool?    * Do you eschew reviews and use things like pair programming and collective code ownership to ensure code quality?


title: How can I deal with a team member who duplicates code?

text: One of our team member duplicates code. Code duplication causes confusion among my team members reading his code, it causes bugs down the line when the duplicated segment is fixed in one location and not the others and it bloats the size of his code-base. I have discussed with him not to duplicate code. But he show excuses that it will delay our projects deadline if he refactors all the places where he made code duplication. How better can I deal with him?


title: How should code reviews be Carried Out?

text: My previous question has to do with how to advance code reviews among the developers. Here I am interested in how a code review session should be carried out, so that both the reviewer and reviewed are feeling comfortable with it. I have done some code reviews before and the experience has been very unpleasant. My previous manager would come to us --on an ad hoc basis-- and tell us to explain our code to him. Since he wasn't very familiar with the code base, whenever he would ask me to explain my code, I'd find myself spending a huge amount of time explaining the most basic structure of my code. As a result, each review would last much too long, and the process would leave both of us exhausted. Once I was done explaining my work, he would continue by raising issues with it. Most of the issues he raised were cosmetic in nature ( e.g, don't use `region` for this code block, change the variable name from `xxx` to `yyy` even though the later makes even less sense, and so on). After trying this process for few rounds, we found the review session didn't derive much benefits for either of us, and we stopped. How would you go about making each code review a natural, enjoyable, thought stimulating, bug-fixing and mutual-learning experience? Also, how frequently you do your code reviews - as soon as the code is checked in? Do you allocate a fixed time every week to do this? What are the guidelines that you follow during your code reviews? Finally, the motivation: What I do want my team to get out of the code review? Answer: I want my team members to be able to cover each other's work. That's the primary motivation. Second motivation: I want all the code to be easy to read/ modify/ extended, so that new features can be added easily.


title: How do you deal with discovering bad and false code in your team?

text: Every year in january we process a big task with our system. While the performance during the task was above average the maintaince follow up is currently having a lot of trouble with jobs running too long and out of their respective time schedule. Therefore I am tasked with the optimization of those maintaince jobs and I am doing thusly the most thorough code review the system has ever seen. As I am good with analysing code I am also doing a lot of bug fixes. This means I see lots and lots of bad or completely wrong code and implementations. My question is: How can I deal with that in front of my coworkers? I hate it if I cause a bug (which I guess happens to everyone sometimes) and someone else fixes it without telling me about it. Because then I cannot learn from my mistake. On the other hand I do not want to be the guy on the team who is constantly nagging about how everyone else has to do his or her work. Also I am a bit wary of my own hubris. I do not want to find myself in the position that I start looking down on coworkers just because my biased mind thinks my code is superior. Currently I am not checking who has caused a bug I just fix it. I am not sure whether this is the best way to go. I am a Junior level developer and English is not my mother tongue. Any advice (and grammar edits) are highly appreciated. The team follows the Rational Unified Process framework.


title: How do I deal with a slow and undedicated colleague in the team?

text: I have been working on a new project. The project works like this: The end user can access a webapp using a link and he can add multiple systems on his network and manage that particular systems details. My part involves the front end and the webserver, which is done in python. My python actually communicates with another project which is entirely done in c & c++. The c/c++ project is the main app which does all the functionality. My python sends the user request to it and displays the response from it to the user. I am very familiar with my work and I will finish it soon. Since that's not much work in it. And I am a person who loves to work. I spends most of the time in office and only go home when I feel sleepy. The c/c++ app is managed by another colleague who has 5+ year experience and can do things much faster than me, but he never does it. May be he doesn't like to do it. His app crashes often when my python communicate with it or returns wrong values. It's full of bugs. Since my app depends on it, I am having a hard time building it. Instead of fixing the bugs, he asks me to slow down my work. He asks me to tell manager that my work needs a lot of time. He is asking me to fool the manager and even forcing me to work slowly like him. During project meeting, when manager asks him about the bugs he says that he fixed everything and it works fine. Since he is my colleague, I couldn't tell anything to the manager. I obviously need to have a good relationship with my colleagues more than my manager, since most of the time we will be with our colleagues, not with the manager. I am not able to tell the manager anything regarding this, since if manager asks him why, then he may think I complained about him to the manager. And he keeps on lying in the meeting. And since he fixes the bug slowly, it even slows down my work. Now I thought of working on the front-end part of my app and finishing it off so that in the mean time he can make his project stable. Now he is asking me to tell the manager that my front end part require a lot of work and I may need more and more time, simply so that he can drag the project down. And the sad thing is our actual manager has gone to the US, so we have a temporary manager and this guy doesn't know about the project much, so the c,c++ just fools him. Can anyone suggest me how I deal with this? I wanted to finish off the project soon. How can I make him work even by maintaining a good relationship with him? ### Responses to comments: > If he's really deliberately misleading the company, you should report him to > management. I am new to this company and the other guy has been there for many years. And I have just started knowing my colleagues. If I directly go and complaint him, I don't think so I can make good relationship with my other colleagues. Even he has the power to mislead them. I am not telling he is a bad guy, he can do the work, but he is not doing it. > Doesn't your company have any kind of bug tracking system ? Here actual bug tracking system isn't there. The company tries to finish off the project as soon as possible and gives it to the QA. And then fixes the bugs reported by QA. > This is why companies should give employees stock / options or some sort of > ownership. That way you can literally tell the guy "You are costing me > monetary growth... don't you want to make money also?". The company has the stock options they have given me a 2500 share, mostly he too would have got some more. > Seniority does deserve some benefit of a doubt. You really need to speak to > him first and try to understand the problem. He may be out of his depth, you > may be able to help him, there could easily be variables you are unaware of. > It may be hard now, but you could easily make the situation a lot worse by > jumping the gun. I even does it, first his app wasn't handling multiple requests at a time, he was using a queue to handle the requests I sent to him. I even suggested to him some of my ideas on it. He said he already had these ideas, and will be executing them. His explanations was: "Everything require certain time to do and this is a project which may need two years to complete and we are asked to finish it in two months". I used to have a hard time coding during first few weeks because of this bug. But now he fixed it. But he is using a single queue for a user requests and that is now slowing down the app, since it processes one request at a time. > What is QA doing this whole time? Why aren't they reporting/confirming the > status of the project(s)? The manager is the person who decides when to give to the QA. As of now it has not yet given to QA. He said we should give it by this month end.


title: complex numbers in programming?

text: Are complex numbers used in programming? If they are what is their significance? What IDEs and languages use them? And would it be recommended to learn how to implement them for a programming job (if so please specify what job)? I've been working in Eclipse and just studied the importance of complex numbers in math and wondered if it correlated.


title: Is there a name for CSS code smell that can be seen in class names like "float" or "white"?

text: I noticed some code in our projects using CSS class names such as `red`, `black` or `float`.   I want to provide some information for people so they know to avoid it. Is there a common name for that code smell so I can reference it?


title: Broadcast receiver Or Services

text: I am creating an "Alarm Clock" app in Android. I learned that we can implement `OnReciever()` method and write those things which we want the alarm to do after an intent is fired. But I have now come across the "Services" of android which is (might) be useful in the app. Which one should I prefer, keeping in mind the simplicity of using either of them.


title: gcc -S seems a bit misshapen with shifting and ANDing bits

text: Example:               int c = 4;     int p = 5;          if (p & (1 << c))        printf("ok\n");     else        printf("nop\n");      gcc -S:               movl    -4(%rbp), %eax   /* eax holds the variable c  */     movl    -8(%rbp), %edx   /* and edx holds p  */     movl    %eax, %ecx       /* tmp(ecx) = c  */     sarl    %cl, %edx        /* edx(p) >>= c  */     movl    %edx, %eax       /* eax = p shifted right by c */     andl    $1, %eax         /* eax(p shifted right by c) &= 1  */     testl   %eax, %eax       /* test if p is 0  */     ... jumps and such ...      As you can see, GCC for some reason converted my code to:               p >>= c;     p &= 1     if (p != 0)         ...     else         ...      Something fishy is going on here or I am missing something... It kinda made the operation backwards, although I had brackets around the `1 << c` so it should've done it separately then AND it with `p` correct? Can someone explain why did GCC do this? Is it some sort of optimization (I had no optimization enabled when I compiled this, so doubt it) Or is it how it should be done in assembly?


title: Is the GPL dangerous to the organisation in terms of exposure of its intellectual property?

text: GNU General Public License is a ‘Viral License”. If an organisation is using Linux and MySQL which come under this license, is it dangerous to the organisation in terms of exposure of its intellectual property? As this license will demand the software that is linked to or that incorporates a GPL program to also be made available in source form under the same license when it is “distributed.”


title: How much can you talk about your job experience during an interview

text: I recently saw a comment here, that the signs of a bad hire is when he says "I worked with this and that", but then doesn't elaborate when asked. And the question is why? Hypothetical scenario: Say you work for company X that develops rockets for space trips, then you walk to an interview for position Z in company Y. Interviewer sees your CV, asks a question - What technologies have you used? You respond, oh, I have used boost library to control the rocket navigation systems. Employer decides that you are a bad hire and doesn't offer you a job. Next he walks home, cross references your previous company X, finds documented bug in boost library and brings the rocket down. BOOM! From one point of view, you didn't said anything of interest, from another point of view, libraries, patterns, and algorithms can come a very long way towards letting malicious people reverse the heck out of the competitors product. Do you have right to talk about previous products, even in abstract way. And does the interviewer has rights to ask you anything about things you've coded for some commercial entity at all?


title: Which languages use "paired" header/implementation files?

text: C is ubiquitous, and C++ nearly as much, but I'm curious which other languages follow a similar model of header files. Specifically, in which other languages is it idiomatic to edit pairs or groups of "header" and "implementation" files? (A group as in multiple headers with one corresponding implementation file or a single header with multiple implementation files, as also seen in C.) For example, the pair "blah.h" and "blah.c". C's header files are tied into the C preprocessor, but that's not the detail I'm focusing on here. For example, PHP has various include mechanisms, but you don't have a pair/group of "blah-header.php" plus "blah-notheader.php". Some languages generate a file from source in a one-to-one mapping, such as Java, but that's not what I'm talking about either. I'm interested in cases where the programmer _directly edits_ both/all files in the pair/group. Perhaps to put it another way: which languages have a declaration file ("header") and definition file ("implementation") such that a person would generally edit both files in tandem?


title: Example of an agreement with the client

text: I've started my company in UK. Used to work as a freelancer, therefore legal issues didn't use to be a big headache. Now, I'd like to see an example of the document a company would sign with a client when starting to build them a website. This should include a project quote, project overview, agreed upon things, deadlines, etc. Anyone is so kind to share such a document?


title: Logging Exception in multi-tier application

text: I'm building a multi-tier enterprise application using Spring. I have different layers: Controller, Business and Provider. Within the application I've built a custom error handling mini-framework that is based on a single RuntimeException which has an error code to discriminate different kind of errors. Error codes are enums implementing this interface:               public interface ErrorCode {         public int getNumber();         public String getDeveloperMessage();         public String getHelpURL();         public boolean isSystemError();     }      So for example I have:               public enum SystemErrorCode implements ErrorCode{         E_UNKNOWN_ERROR(10000, "Unkwown internal error", true),         E_MISSING_ARGUMENT(10001, "Missing argument", true),         E_INVALID_ARGUMENT(10002, "Invalid argument", true),         E_CONTEXT_NO_TENANT(10003, "No tenant in context", true),         E_CONTEXT_TENANT_CHANGE(10004, "Tenant change attempt", true),         E_CONTEXT_ALREADY_INITIALIZED(10005, "Tenant already initialized", true),         E_NOT_IMPLEMENTED(10005, "Feature not implemented", true),         ...     }      The exception class itself look like this (getters, constructors, and utility methods are stripped out for brevity):               public class EngineRuntimeException extends RuntimeException {         private static final long serialVersionUID = 1L;              private final String incidentReportId;         private final ErrorCode code;         private final Map<String, Object> additionalInfo;              ...              public static EngineRuntimeException wrap(Throwable exception, ErrorCode errorCode) {             if(exception instanceof EngineRuntimeException) {                 EngineRuntimeException se = (EngineRuntimeException)exception;                 if(errorCode != null && errorCode != se.getCode()) {                     return new EngineRuntimeException(exception.getMessage(), exception, errorCode);                 }                 return se;             } else {                 return new EngineRuntimeException(exception.getMessage(), exception, errorCode);             }         }                   public static EngineRuntimeException wrap(Throwable exception) {             return wrap(exception, SystemErrorCode.E_UNKNOWN_ERROR);         }      Using the wrap utility method I can easily encapsulate exceptions in the different layers without loosing the original stack and without having it dirty by rethrowing or incapsulating exception more than once.               try {       if(a == null) {         throw new EngineRuntimeException(SystemErrorCode.E_UNKNOWN_ERROR, "blah, blah, blah");       }            // Some other code that can throw exceptions (checked or unchecked),       // these exceptions will be wrapped inside EngineRuntimeException if they       // are not already of that type.          } catch (Exception ex) {         throw EngineRuntimeException.wrap(ex);     }          To recap, each layer has a safety boundary try-catch that wraps Exceptions into EngineRuntimeException, just rethrowing what is already an EngineRuntimeException. The question is: where should I log the exception? I want to log the exception only once so I was thinking about do the logging stuff inside the constructor of EngineRuntimeException class itself. Is that a bad idea? Is it better to do the logging stuff only in the catch blocks of the layer boundaries? Also I don't want to simply log using a log4j but I want to use a service (@Service) injected by spring so that I can decide to do something more than just logging on file system. How can I do that since I can't make spring inject something in a class I have created with the "new" instruction.


title: Developing professionally for iOS, Android and web - an insight

text: This is not really a question on how to develop all three, I know various cross platform ways and so on. But I more want to know from developer standpoint how hard it is to basically develop iOS, Android and web apps? I am currently in my first job as a mobile/web developer. I have already developed my first iPhone/iPad app and now I have to develop the app for android because the web version I tried just didn't perform as well as needed and web databases just did not seem to make the cut. But I am not sure it's possible to be good at developing all 3 in terms of remembering all the api's etc. I wouldn't say I have an issue with the programming languages just how to use the api's for the various platforms. Also, all the other languages I look at, in my spare time, just feel like I am spreading myself to thin. Is it feasible for one person to be developing ios, android and web apps? Should I think about reducing it to iOS and web based apps? I develop everything by myself, so I have no one to discuss what the best solutions are for everything and I am just trying to workout as I go along. So any cross platform developers out there? Do companies have different teams for different platforms? Any insight would just help me get my head together. Hopefully this question makes sense.


title: Examples of general purpose algorithms that have benefited from running on a GPU?

text: I am looking for examples of general purpose algorithms (meaning non-graphics related) that have been proven to run an order of magnitude faster on a GPU than on a CPU. I will use these examples to think creatively about other algorithms that I could implement on a GPU.


title: Any advice from self-taught programmers on competing with more conventional types?

text: As a self-taught programmer myself competing in an industry dominated by CS majors, I often find myself intimidated. I have a BA in liberal arts but have found that many "trained" programmers tend to look down and assume I have huge holes in my understanding of fundamentals. I tend to not tell anyone, unless I have to, that I learned this way to avoid the stigma. Would it be better to embrace how I learned or would it be more prudent to continue to deliver while being less than open about my background? Edit: I guess I did not mention this, but I actually have taken many CS classes, but I never had the time to get the actual paper with the random requirements attached. I have all the core stuff like data structures and algorithms, etc. I've found that I learned more on my own, however, I was primarily concerned with how this approach was viewed by employers and whatnot. Thanks for all of the great advice though!


title: Numerous Unexpected Obstacles Ruining any Project Plans

text: I am working as software developer and struggling with this problem time and time again for almost thirteen years. There seems not to be any way out of the following problem. And it happens with small projects as well. For example, I plan to write an extension for Microsoft Visual Studio. I dowload learning materials, get some book on the topic and allocate time for learning and development. However, during the development, many seemingly trivial problems arise, for example:   * Why the script refuses to delete the file?   * Why Visual Studio does not register the extension?   * (after two days) OK, it registers it, but now it got broken. How to fix it? each of these "small" obstacles usually take 1-5 days to resolve and the project finally consumes several times more man-hours than planned. Maybe it happens only because I am working on Microsoft platform and many of their Frameworks and architectures are bit confusing and badly documented. I would like to have most problems resolved by finding answer in a book or official documentation (MSDN), but the only answer I usually find is on some weird forum or personal blog googled after desperately searching for any relevant information on the topic. Do you have the same struggles? Do you have techniques on how to prevent these problems? I was thinking of simply multiplying projected time for a given project by some factor, but this does not help. Some projects get done briskly and some take months and the guiding factor here are these small "glitches" which take programmers whole weeks to resolve. I have to admit that lots of these obstacles demoralizes me and drains me of focus and joy of work (who likes to get back to work when he have to resolve some stupid registry problem or weird framework bug instead of doing creative work?) After the project is finally done, I am feeling like dying from thousand cuts.


title: When are Getters and Setters Justified

text: Getters and setters are often criticized as being not proper OO. On the other hand most OO code I've seen has extensive getters and setters. When are getters and setters justified? Do you try to avoid using them? Are they overused in general? If your favorite language has properties (mine does) then such things are also considered getters and setters for this question. They are same thing from an OO methodology perspective. They just have nicer syntax. Sources for Getter/Setter Criticism (some taken from comments to give them better visibility):   * http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html   * http://typicalprogrammer.com/?p=23   * http://c2.com/cgi/wiki?AccessorsAreEvil   * http://www.darronschall.com/weblog/2005/03/no-brain-getter-and-setters.cfm   * http://www.adam-bien.com/roller/abien/entry/encapsulation_violation_with_getters_and To state the criticism simply: Getters and Setters allow you to manipulate the internal state of objects from outside of the object. This violates encapsulation. Only the object itself should care about its internal state. And an example Procedural version of code.               struct Fridge     {         int cheese;     }          void go_shopping(Fridge fridge)     {          fridge.cheese += 5;     }      Mutator version of code:               class Fridge     {          int cheese;               void set_cheese(int _cheese) { cheese = _cheese; }          int get_cheese() { return cheese; }      }          void go_shopping(Fridge fridge)     {          fridge.set_cheese(fridge.get_cheese() + 5);             }      The getters and setters made the code much more complicated without affording proper encapsulation. Because the internal state is accessible to other objects we don't gain a whole lot by adding these getters and setters. The question has been previously discussed on Stack Overflow:   * http://stackoverflow.com/questions/565095/java-are-getters-and-setters-evil   * http://stackoverflow.com/questions/996179


title: Why are public and private accessors considered good practice?

text: > **Possible Duplicate:**   >  When are Getters and Setters Justified Why exactly is having public and private accessors like these:               private string foo;          public string Foo     {         get         {             return foo;         }         set         {             foo = value;         }     }      considered better than just having public ones like this:               public string Foo;      The end result seems to be the same.


title: How to design member access for an Article-type class?

text: I am doing a final project in a C++ class writing a _very_ simple usenet-like client/server. I figure that since it's usenet-like I'll have a `NewsGroup` class and an `Article` class, I'm now working on my `Article` class. I can't really decide on a good design, though (this class is not about design patterns and I haven't taken any). This is what I have:               class Article {     public:         const std::string author;         std::string title;         std::string text;         const uint32_t id;         system_clock::time_point timestamp;              Article(const std::string auth&,                 const std::string tit&,                 const std::string txt&,                 const system_clock::time_point&);          private:         Article(const Article&);         void operator=(const Article&);         static uint32_t id_pool;     };      My motivation is this: `author` should never change -> `const` `title` could change if edited -> `non-const` `text` could change if edited -> `non-const` `id` should never change -> `const` `timestamp` could change but probably shouldn't, I'm not sure what to do with it yet. `id_pool` is just where I get IDs from. One specification is that IDs should never be reused so I just increment `id_pool` in the Article constructor. Coming from Java with all the getters and setters that I really don't like, and then some Python with it's "Everything public" and properties, that I do like, I'm getting a bit confused here. I mean, I could make the members private and have getters and setters (I can't think of any natural "verb-methods" that an Article can "do"), but it feels like I would gain very little. I would be thankful for some pointers on good design in this case.


> **Possible Duplicate:**   >  When are Getters and Setters Justified Is it a good programming practice to not use getters and setters in trivial parts of code?


title: What is the benefit of using getters and setters on properties in C#?

text: > **Possible Duplicate:**   >  When are Getters and Setters Justified Why do we use get and set method in C#? And why do we use public and private method property? For example:               public class Date     {         private int month = 7;           public int Month         {             get             {                 return month;             }             set             {                 if ((value > 0) && (value < 13))                 {                     month = value;                 }             }         }     }


title: Are Get-Set methods a violation of Encapsulation?

text: > **Possible Duplicate:**   >  When are Getters and Setters Justified In an Object oriented framework, one believes there must be strict encapsulation. Hence, internal variables are _not to be exposed_ to outside applications. But in many codebases, we see _tons_ of get/set methods which essentially open a formal window to modify internal variables that were originally intended to be strictly prohibited. Isn't it a clear violation of encapsulation? How broadly such a practice is seen and what to do about it? EDIT: I have seen some discussions where there are two opinions in extreme: on one hand people believe that because get/set interface is used to modify any parameter, it does qualifies not be violating encapsulation. On the other hand, there are people who believe it is does violate. Here is my point. Take a case of UDP server, with methods - get_URL(), set_URL(). The URL (to listen to) property is quite a parameter that application needs to be supplied and modified. However, in the same case, if the property like get_byte_buffer_length() and set_byte_buffer_length(), clearly points to values which are quite internal. Won't it imply that it _does_ violate the encapsulation? In fact, even get_byte_buffer_length() which otherwise doesn't modify the object, still misses the point of encapsulation, because, certainly there is an App which _knows_ i have an internal buffer! Tomorrow, if the internal buffer is replaced by something like a *packet_list* the method goes dysfunctional. Is there a universal yes/no towards get set method? Is there any strong guideline that tell programmers (specially the junior ones) as to _when_ does it violate encapsulation and when does it not?


title: How important is encapsulation?

text: As a student in programming, I learned that encapsulation is one of the most important principles of object-oriented programming. However, I only follow that principle when I feel like it suits my purpose. I sometimes leave internal class variables public if they are intended to be directly read at some time, and only use things like setters and getters when there are actual calculations (and assignments of other variables) involved in the assignment/evaluation of a variable (say, a `getDegrees()` of an `Angle` class that only stores radians internally). If I find that some procedure done with a class involves a lot of modification of internal variables and is easily groupable into a single operation, I will put it into a function of the class rather than having the outside code call multiple smaller functions. However, I will not always _enforce_ this in the interface by making the affected variables private instead. Am I violating any principles by doing this? If so, how severely? The code that does this usually doesn't face outward, as I pay a lot of attention to how out-of-program input is processed.


title: which style of member-access is preferable

text: the purpose of oop using classes is to encapsulate members from the `outer space`. i always read that accessing members should be done by methods. for example:               template<typename T>     class foo_1 {       T state_;     public:       // following below     };      the most common doing that by my professor was to have a get and set method.                 // variant 1       T const& getState() { return state_; }       void setState(T const& v) { state_ = v; }      or like this:                 // variant 2       // in my opinion it is easier to read       T const& state() { return state_; }       void state(T const& v) { state_ = v; }      assume the `state_` is a variable, which is checked periodically and there is no need to ensure the value (state) is consistent. Is there any disadvantage of accessing the state by reference? for example:                 // variant 3       // do it by reference       T& state() { return state_; }      or even directly, if I declare the variable as public.               template<typename T>     class foo {     public:       // variant 4       T state;     };      In variant 4 I could even ensure consistence by using c++11 atomic. So my question is, which one should I prefer?, Is there any coding standard which would decline one of these pattern? for some code see here


title: The New Programming Language & BCL for the Cloud

text: Let's say you need to implement a new programming language and BCL designed specifically for operating in the cloud (it won't be used on client machines ever). It should be optimized for cloud computing; easy to learn, fast, efficient, powerful, modern. What it would look like? What would be it's major differences from C#, Java, Ruby, Python, JavaScript? How would it's BCL (base class library) differ from let's say the one in .NET Framework 4.0? .. The same way Silverlight BCL was built for in-browser/multi-platform use, a totally new BCL should be build for a cloud, don't you think so? .. As Jörg W Mittag mentioned, a programming language created exclusively for a cloud can have it's own advantages over traditional programming languages. For example this language may evolve without breaking existing applications, let's say you rename a method / change it's signature / or move it to another namespace, all the applications in the cloud will be automatically updated to reflect that change. .. Theoretically C# 5.0 could become such a language with it's complier as a service feature. But that still won't eliminate a need for a dedicated BCL for the cloud.


title: Registration: Email hash and verifying only one account per email

text: I'm using a registration function that hashes the email in PBKDF2 with a random and unique Salt each time. The hashes email and his salt are saved in the DB. No problem with that. The problem is that now I want to make sure that users only create one single account per email. Obviously to verify that I need to check my DB and that's where the problem starts. I either lose in security or in time. Because as I see it I have 2 choices: 1 - I change my hash method and use a common Salt for all emails. Which make me lose a bit of security. Or 2 - I hash the email with all the Salts from the DB and check for matches. My guess is that this will be horribly slow. So my question are:   * What should I do? Optimize security or "time"?   * Maybe hashing emails with unique and random salts in PBKDF2 is too much? If yes, what hashing method should I use?   * Is there any other solution? PS: I didn't post any code because I think this is more of a theory discussion but if code is needed let me know, I will add it.


title: Which open-source license is right for my project?

text: I am trying to choose the right license for a project that I would like to release as open-source later this year but I am unsure as to what the most appropriate license would be. I was originally thinking of the GPLv2 license, but I don't think that it is what I am after. I have been working on this project for over a year now (on and off) for my company. I figured that it would be great to give something back to the community and would like to release the project as open-source, but I want to retain full custody of the project. My company will be providing both free, commercial and community contributed content (perhaps with GitHub). Here is basically what I am after:   * Original source can be distributed and re-distributed (verbatim) both commercially and non-commercially as long as the original copyright information, website link and license is maintained.   * License of original source cannot be changed.   * Original source can be modified and distributed (commercially & non-commercially) for a specific application, but cannot be re-distributed without written consent from the original author (me). For example, a developer could change the source for their client, but they cannot redistribute that change. The developer may, however, choose to submit their modifications for integration into the original source.   * Themes and extensions must be covered by an open-source license. It must be possible for any developer to modify, distribute and re-distribute all themes and extensions (commercially & non-commercially) should they choose to do so. I am aware that it is unlikely that there is a license that will cover all of these points, but something along those lines would be fantastic. I have put a lot of hard work into this project and whilst I am happy to share it, I do not want to loose it to a big company who has loads of money to splash at it.


title: What are the recommended resources for learning about the Actor model of concurrent systems?

text: The Actor concurrency model is clearly gaining favor. Is there a good book that presents the patterns and pitfalls of the model? I am thinking about something that would discuss, for instance, the problems of consistency and correctness in the context of hundreds or thousands of independent Actors. It would be okay if it were associated with a specific language (Erlang, I would imagine, since that seems universally regarded as the proven implementation of Actors), but I am hoping for something more than an introductory chapter or two. I'm actually most interested in Actors as they are implemented in Scala, if there are any such resources available.


title: Learning C++ properly (not C with classes)

text: The typical reason I hear to why people bash C++ is that they don't actually know C++, they just know "C with classes", which apparently is different. I am just beginning to learn C++, however, I want to actually learn C++ and not simply "C with classes". How can I ensure I learn C++ properly? Some examples would be wonderful.


title: How can I make sure I'm writing C++ like it's meant to be written?

text: > **Possible Duplicate:**   >  How can I learn to write idiomatic C++? Besides the obvious answers of "use g++ instead of gcc, and cout instead of printf", how can I ensure that my toy project is teaching me proper C++ paradigms and patterns? Backstory: I've never written a line of C++ beyond Hello World, and I've chosen what should be a straightforward (albeit somewhat complicated) sample project to help me learn the language. I've decided that the goal I want to end at is a CLI Huffman encoder. It doesn't have to compete with modern compressors in speed or efficiency, it just seemed like a project that would help me touch many aspects of the language at once. So, before I dive into this project, what are some things I should keep in mind? A lot of what I'm going to be doing is research online, and I have a fear that a lot of tutorials are C-in-C++. I'm looking for answers like: "if you're using malloc, you're probably doing something wrong" or "you should probably be using `boost` or something similar". I'm also looking for suggestions like "if I were writing this, I'd use a template around x".


title: Find pattern in a string

text: How would one approach the following question: We have two strings: a normal alphanumeric string and a pattern string. the pattern string can be composed by alphanumeric chars plus the char "?" and "*" We want to check if the first string match the pattern, where the ? means that every char (alphanumeric) is permitted in that position, while * allows to have a sequence of alphanumeric chars.


title: Do I need to return error: null in JSON response?

text: When designing a RESTful API that uses JSON to respond to requests, I usually return an object like this when an error happens:               {       "error": "Something bad happened",       "error_code": "XXX"     }      Do I need to have a `"error": ""` or `"error": null` in my object when there is no error?


title: Validating User Stories: How much change is too much?

text: While the core of requirements development and acceptance criteria would ideally take place during the planning meeting in order to create a better estimate, Scrum encourages continuous interaction with the product owner throughout the sprint to validate and refine user stories.   * What kind of criteria is used to judge if there is too much change being imposed on a user story mid-sprint?   * When is it appropriate to change the requirements of the user story?   * When is it appropriate to cancel the user story / sprint in order to re-evaluate and re-estimate a user story in question?


title: Would Single Page Apps(thin server-thick client architectures) kill server side languages like Java, C++

text: Single Page Apps strips server down to a REST api. If SPAs are the modern and better way of developing web apps, then would someday JavaScript rule the world and server-side languages like Java, C++ etc would not be the prominent skill companies look for? Or are there still parts of huge and prominent web apps like youtube, amazon.com which just can't be all ported to client side JavaScript and would continue to depend upon server-side languages.


title: Sessions in cloud applications dangerous?

text: We have a django app hosted on heroku. I had a situation:   1. A user entered an email in a form on page1. If the email existed in the database he was redirected to Login page otherwise to register page.    2. In the register page the form was filled with the same email entered on page1 using request.session that was populated previously. **I was told it was dangerous as using sessions is not recommended in cloud applications. Is this notion correct both generally, and under above scenario?**


title: The Written Roles of Software Development Manager

text: We all know what a software development manager does, but I'm afraid that we only know it _vaguely_. We think we know what he is doing, but to exactly list down what is the job scope is a bit hard. In your opinion, what are the roles of a software development manager?


title: With AMD style modules in JavaScript is there any benefit to namespaces?

text: Coming from C++ originally and seeing lots of Java programmers doing the same we brought namespaces to JavaScript. See Google's closure library as an example where they have a main namespace, `goog` and under that many more namespaces like goog.async, goog.graphics But now, having learned the AMD style of requiring modules it seems like namespaces are kind of pointless in JavaScript. Not only pointless but even arguably an anti-pattern. What is AMD? It's a way of defining and including modules that removes all direct dependencies. Effectively you do this               // some/module.js     define([         'name/of/needed/module',         'name/of/someother/needed/module',       ], function(          RefToNeededModule,          RefToSomeOtherNeededModule) {            ...code...            return object or function     });      This format lets the AMD support code know that this module needs `name/of/needed/module.js` and `name/of/someother/needed/module.js` loaded. The AMD code can load all the modules and then, assuming no circular dependencies, call the `define` function on each module in the correct order, record the object/function returned by the module as it calls them, and then call any other modules' `define` function with references to those modules. This seems to remove any need for namespaces. In your own code you can call the reference to any other module anything you want. For example if you had 2 string libraries, even if they define similar functions, as long as they follow the AMD pattern you can easily use both in the same module. No need for namespaces to solve that. It also means there's no hard coded dependencies. For example in Google's closure any module could directly reference another module with something like `var value = goog.math.someMathFunc(otherValue)` and if you're unlucky it will magically work where as with AMD style you'd have to explicitly include the math library otherwise the module wouldn't have a reference to it since there are no globals with AMD. On top of that dependency injection for testing becomes easy. None of the code in the AMD module references things by namespace so there is no hardcoded namespace paths, you can easily mock classes at testing time. Is there any other point to namespaces or is that something that C++ / Java programmers are bringing to JavaScript that arguably doesn't really belong?


title: What can I do about multiple coworkers who constantly question my knowledge?

text: At my current job, I have coworkers who still throw interview questions at me even though I've been working there for 6 months. I though it would end after I got hired but then it continued on and on. What is appalling is that it is precisely the ones who are poor programmers (the manager and couple other guys) who do this most. How should I handle this situation? P.S. I have certainly seen this at other worksites in the past, but usually there is just one jerk with a chip on his should who does it. Here, it is many people.


title: Do I need an equivalent for MAMP to work as a Ruby Server?

text: I am just starting to learn Ruby, and I want to do something that required a DB but I'm unsure whether MAMP would work or do I need something else?


title: Is it appropriate to make a User Story for removing small pieces of existing functionality?

text: For an area of an application that has been developed, the request has come in to remove an item from a menu. I know this is a small thing, but how do you treat it in Scrum? I'm used to using User Stories to add functionality, not to remove it. So my question is, should I create a user story for this, somehow phrased to do with removing the button? Or is there a better way or dealing with this? Thanks, Paul.


title: Is it safe in Haskell to save a data structure to a file using "show", and retrieve it using "read"?

text: Say I have the following types:               type EndsTup = (Int,Int)         -- (0-based index from start or end, Frequency)     type FreqTup = (Char, [EndsTup], [EndsTup])         -- (Character, Freqs from start, Freqs from end)     type FreqData = [FreqTup]         -- 1 entry in the list for each letter      Which I'm using to store data regarding the frequency of a character's position in a word. If I want to then save this to file, is it safe (as in guaranteed not to corrupt if it's written without error) to convert the structure to a string using show, and then read it using something like:               readData <- readFile filePath     let reconstructed = read readData :: FreqData      I'm just asking because that seems "too easy". Is this how it's typically done?


title: How to obtain an affordable electronic paper programmable kit or similar?

text: I'm really interested in playing around with the electronic paper technology, but I don't really want to program any commercial device (kindle or whatever). I have some ideas and I want to start. How do I get a screen of electronic paper, a chip and how to start programming for it (language, interface)


title: Where we should put validation for domain model

text: I still looking best practice for domain model validation. Is that good to put the validation in constructor of domain model ? my domain model validation example as follows:               public class Order      {         private readonly List<OrderLine> _lineItems;              public virtual Customer Customer { get; private set; }         public virtual DateTime OrderDate { get; private set; }         public virtual decimal OrderTotal { get; private set; }              public Order (Customer customer)         {             if (customer == null)                 throw new  ArgumentException("Customer name must be defined");                  Customer = customer;             OrderDate = DateTime.Now;             _lineItems = new List<LineItem>();         }              public void AddOderLine //....         public IEnumerable<OrderLine> AddOderLine { get {return _lineItems;} }     }               public class OrderLine     {         public virtual Order Order { get; set; }         public virtual Product Product { get; set; }         public virtual int Quantity { get; set; }         public virtual decimal UnitPrice { get; set; }              public OrderLine(Order order, int quantity, Product product)         {             if (order == null)                 throw new  ArgumentException("Order name must be defined");             if (quantity <= 0)                 throw new  ArgumentException("Quantity must be greater than zero");             if (product == null)                 throw new  ArgumentException("Product name must be defined");                  Order = order;             Quantity = quantity;             Product = product;         }     }      Thanks for all of your suggestion.


title: Legal Applications of Metamorphic Code

text: Firstly, I would like to state that I already understand the 'vx' applications for Metamorphic code. I am not here to ask a question related to any of those topics as that would be inappropriate in this context. I would like to know if anyone has ever used 'Metamorphic' code in practice, for purposes other than those previously stated, if so, what was the reasoning for using said concept. In essence I am trying to discover a purpose for this concept, if any, other than circumventing anti-virus scanners and the like.


title: Do developers on a team ever have a "personal" version control?

text: I'm assuming that after a while, many developers come to know/love a particular VCS. What happens if you find yourself on a team using an incompatible system - do you learn the new system and adapt your workflow to the team's, or do you keep your old system, and try to get both working in tandem? It strikes me that this is either a very common strategy, or a serious faux pas. I'm new to software development, so this question is strictly hypothetical for me so far. While my gut tells me that the decentralized structure and branch- happy nature of git/Mercurial would appeal to me more than the very centralized Vault set up my group uses, I do not know nearly enough about working with version control in general yet to prefer any one system to another, so I will be sticking with whatever the team is running for the foreseeable future. But it does lead me to wonder how common it is for developers faced with learning a new VCS to roll a kind of "hybrid" of both systems - using their preferred system locally to manage what they're working on, and really only using the team wide system to commit/update. This of course leads to other questions - is there a set pattern for working with two systems at once? How do you deal with the fact that your local repo doesn't have access to the full history of the project? Etc...


title: which is best technology to develop UI for Desktop application in java

text: I want to develop a Desktop Application using Java. I want to know which are the best technologies to develop User Interface like (swing, swt, etc.)?


title: Optimising news fetching

text: I have a web scraper for scraping news from different sources in wp7. My current appraoch for doing this is:   * load newspapers information from xml file.   * go to the specified sections and fetch the urls of the news items.    * go to each url and fetch headline, image, publisher.    * display using a MVVM architecture of windows phone. The whole thing takes place asynchronously...meaning as soon as url from a section of a newspaper is fetched it is added to the queue, and the second stage consisting of fetching headline, image etc starts... and as soon this is fetched even for one article, it is displayed. Later on as more articles are fetched, they are added on to the list. For the fetching purpose I am using a SmartThreadPool(http://www.codeproject.com/Articles/7933/Smart-Thread-Pool) for windows phone. My problem is that...even for fetching around 80 items (in total) from 9 publications, it is taking more than a minute. How can i speed up the procedure? Note: I have a two stage approach because many times the images are not available with headlines, and are only found in the article.


title: Should I choose C or C++ for an interview?

text: I know a bit of both C and C++. I am assuming that many people who know C++ also know C. I am wondering what language I should pick to code in during an interview. C, because it's faster to make a working program in C, because you don't have to worry about thinking what objects your system should have, etc, as in C++ (though many experienced C++ programmers can code their solution in C++ in just the same amount of time)? Or C++, because then you don't worry much about passing parameter by parameter and you can just pass around the object etc and you can leverage on existing string library, etc.?


title: Are frameworks necessary In PHP?

text: Are frameworks really necessary in PHP? What are the advantages and disadvantages of using one?


title: What to do as a new team lead on a project with maintainability problems?

text: I have just been put in charge of a code project with maintainability problems. What things can I do to get the project on a stable footing? I find myself in a place where we are working with a very large multi-tiered .NET system that is missing a lot of the important things such as unit tests, IOC, MEF, too many static classes, pure datasets etc. I'm only 24 but I've been here for almost three years (this app has been in development for 5) and mostly due to time constraints we've been just adding in more crap to fit the other crap. After doing a number of projects in my free time I have begun to understand just how important all those concepts are. Also due to employee shifting I find myself to now be the team lead on this project and I really want to come up with some smart ways to improve this app. Ways where the value can be explained to management. I have ideas of what I would like to do but they all seem so overwhelming without much upfront gain. Any stories of how people have or would have dealt with this would be a very interesting read. Thanks.


title: A Newbie .NET Developer Desperately Seeking for Advice

text: I am becoming a little desperate. I am 23 and for the last three months I've been working as a software developer for a British Company who develop a leisure management system. Prior this job, I was never a developer and just did some minor university projects and one ASP.NET project which I didn't complete. I was programming in C# but now I have moved to VB.NET, since most of the project in this company are VB-Based. I know my knowledge is very limited, in software design, development, databases and all. The responsibility here is quiet heavy for a newbie, I am the only developer who is developing the whole package (7 programs, all desktop applications) and the thing is while I am getting better at fixing bugs and adding tasks now I need to add a whole component to two of their systems and now I feel I am hopeless (We did a new release while I was working in this three months). I think I have weakness in Data Binding which is causing me the slow progress of adding that component! While I love coding and I wouldn't get tired of it at all (When I go home I have my home coding for fun too), it came to my mind maybe I am not intelligent enough for this job. Can experienced Developers help me on this issue and provide me some advise for getting better and better? What did youselves do at your first carrer in development? What were the problems?


title: How to make people new to programming stop asking me questions and distracting me?

text: I am at secondary school right now and I'm the only one in my class who is experienced with programming. Because of that, people are constantly distracting me while I'm writing code to ask me to solve a problem. Usually I reply with something like 'I don't know, I never use that' but I don't want to lie to people. Another problem is that I became so well known for this that even students from other classes are asking me questions. I find this damn annoying. Thirdly, if I solve a problem for them they don't learn anything from it. How can I stop people from asking me programming-related questions in a kind way?


title: What is the best idea to put available OS (linux) and Web application to client?

text: After a year programming a web based business management system, I got my idea divided into two differents ways to do what I'm doing... I will try to explain in follow lines: **First I will describe my enviroment:**   * Webserver: _apache, ngynx_   * Programming Language: _PHP, Shell Script, Java Script, SQL_   * Database: _Mysql_   * Operating System: _Linux, UNIX (All Distros) (If manually configured works on windows)_   * Authentication Server: _FreeRadius_ **First situation** I have my application running on this enviroment that I had just described before, as my application is a SaaS app, then I have my own server to run it all and customers pay to use it as a service accessed by webbrowser. **Second Situation** The same as before but with one big difference, everything (environment) is installed in the customer, then I need to cryptography all my codes (It includes PHP and Shell Scripts). I think this situation is most difficulty, but I would like to hear it from different points of view.


title: Examples of non open source projects on Bitbucket or Github

text: Need examples to show management that these are used for source control and effectively backup of projects. They will be concerned about having their source code off-site. If there are good examples I think that it may help in convincing them to consider this as an option.


title: PHP Riak in place update

text: From what I can see, when using Riak to update an object, I first need to load the object into PHP, then edit the object, then store the object back to the Riak database. I was wondering if there is a way to update a bucket without pulling it into PHP first. That way, it would save on the network I/O and latency of pulling it into the PHP script. Can objects be edited directly on the Riak side of things? Edit: Is there away to push data to the end of a raik object, so if i have an object that is numeric array can i make a push to add subject that i know its not there or no in place updates what so ever


title: Is a big name computer science degree worth the cost?

text: > **Possible Duplicate:**   >  Do I need to go to a big-name university? I'm currently in High School and trying to look into what I want to do after I graduate. I know that I will be going to college, and that I want a degree in Computer Science, however, I'm not entirely sure where I want to go (I haven't started the application process yet). I already have built up a decent amount of experience in programming (over the summers I have been hired to program at a local university), and I'm pretty capable of teaching myself most of the material I've come across through either books or web documentation. I'm interested in whether it is worth it to get a degree from a major, big- name computer science university for $50,000 each year, as opposed to going to a local state school for only $20,000. For my Bachelor's degree alone, this would be $120,000 _more_ than the state school. I've also heard that where you get your Bachelor's doesn't matter much if you plan to get a Master's degree. Many people recommend going somewhere like a state school for your Bachelor's, and then try to get into a more major school for your Master's. Has anybody found any truth in this? Basically, is going to a big name computer science school for a Bachelor's degree really worth the added expense?


title: Do I need to go to a big-name university?

text: As a soon-to-be graduating high school senior in the U.S., I'm going to be facing a tough decision in a few months: which college should I go to? Will it be worth it to go to Cornell or Stanford or Carnegie Mellon (assuming I get in, of course) to get a big-name computer science degree, internships, and connections with professors, while taking on massive debt; or am I better off going to SUNY Binghamton (probably the best state school in New York) and still get a pretty decent education while saving myself from over a hundred- thousand dollars worth of debt? Yes, I know questions like this has been asked before (namely here and here), but please bear with me because I haven't found an answer that fits my particular situation. I've read the two linked questions above in depth, but they haven't answered what I want to know:   1. Yes, I understand that going to a big-name college can potentially get me connected with some wonderful professors and leaders in the field, but on average, how does that translate financially? I mean, will good connections pay off so well that I'd be easily getting rid of over a hundred-thousand dollars of debt?    2. And how does the fact that I can get a fifth-years master's degree at Carnegie Mellon play into the equation? Will the higher degree right off the bat help me get a better-paying job just out of college, or will the extra year only put me further into debt? Not having to go to graduate school to get a comparable degree will, of course, be a great financial relief, but will getting it so early give it any greater worth?   3. And if I go to SUNY Binghamton, which is far lesser-known than what I've considered (although if there are any alumni out there who want to share their experience, I would greatly appreciate it), would I be closing off doors that would potentially offset my short-term economic gain with long-term benefits? Essentially, is the short-term benefit overweighed by a potential long-term loss? The answers to these questions all tie in to my final college decision (again, permitting I make it to these schools), so I hope that asking the skilled and knowledgeable people of the field will help me make the right choice (if there is such a thing). * * * **Also, please note:** I'm in a rather peculiar situation where I can't pay for college without taking out a bunch of loans, but will be getting little to no financial aid (likely federal or otherwise). I don't want to elaborate on this too much (so take it at face value), but this is mainly the reason I'm asking the question. * * * Thanks a lot! It means a lot to me. * * * **Edit:** Thanks to everyone for your wonderful responses! All thought-out and well-written, and I wish I had the time to write comments on all of them. Hopefully, I'll be able to when I get home from school and work later tonight... * * * **Edit 2:** Wow! Unbelievable that I've gotten this many helpful responses in such a short amount of time! I haven't had the time to properly sit down and respond to many of these, but I really appreciate the effort, and I will do so tomorrow. Big thanks to everyone who posted! * * * **Edit 3:** For those who are interested, I got into CMU, Cornell, and Binghamton, and decided on Binghamton. CMU and Cornell gave me no financial aid whatsoever, while Binghamton, being a state school costs less than $20,000 a year including room and board. When I got the admission letters, the decision was hard, but after visiting Binghamton and realizing just how good of a school it is (state schools are severely underrated in the United States; it's a terrible problem—for what it's worth, it turns out that Binghamton was even more selective than many of the private schools I applied to, not that that inherently means much, but just as a metric), I couldn't pass up. Besides, I visited on a terrible, rainy day, and was still impressed, so I knew it was the one. ;) Doing some actual financial analysis, I realized I would never be able to pay off the $60,000 a year required for CMU or Cornell, only making choosing Binghamton feel even better. While this question is specific to my case, I hope this can help someone else in my position. * * * **Edit 4:** I've recently been made aware that students in a similar position have been stumbling across this question, and I wanted to give a short update. I'm incredibly happy here at Binghamton, and if I had to go through the college process all over again, I wouldn't have chosen any other school. I think most students tend to be happy regardless of where they go, but for me, Binghamton has been a great experience. What I want to tell students is this: I know that it's hard to judge schools without paying attention to their names and reputations — I doubt Carnegie Mellon will ever be considered a _bad_ school for studying Computer Science — but don't ignore schools just because you've never heard of them! Don't be afraid to make **practical** choices. I know that Binghamton isn't a world- famous university, but from what I've seen, our curriculum is more rigorous, and lays down a better foundation than many top schools that I've heard of, and for much cheaper. We focus a lot on getting students internship, job, and research opportunities, and we have very strong connections to companies like Microsoft, Bloomberg, IBM, Lockheed Martin, and several others. We're a very _practical_ school — we might not be famous, but if you come here, you're going to get an excellent foundation for your career, and almost certainly an internship or a job. Plus, we're small enough that students can get to know their professors well (I have several friends who are first-name basis with their professors), which certainly helps if they're interested in doing research, which we do a _lot_ of at Binghamton. I didn't know any of this when I chose Binghamton, and it's one of those things you can only learn about a school once you go there — details like this won't be stressed on brochures and magazines, and you learn about it through experience. So, what I want to say is, don't go picking schools solely on whether you've heard of them or not, and consider state schools. The better ones, like Binghamton, are very good choices. Take this with a grain of salt: of course, if you're motivated, skilled, and hard-working, and if you push yourself to succeed, where you go doesn't matter as much because you'll be noticed wherever you are. I got very lucky with my internships and job opportunities, and my experiences have definitely been flukes, but if you are constantly improving your skills and apply yourself, you can further yourself much more than your school will ever be able to. If you're a student, and you have any questions about this topic, please don't hesitate to email me. I'd love to help answer your questions: itai@itaiferber.net


title: Resources for a New Programmer with a Math Background

text: I'm almost brand new to programming, but have a fairly strong background in mathematics (primarily algebra and logic -- e.g. universal algebra). I've always heard that there is a strong relationship between math and programming, but the intro programming books I've looked at don't seem to emphasise it. For reference, I started with Java, since that's what I need to be able to use for a job I'm at this summer. I imagine that most authors of these resources assume that if you don't don't have a programming background, then you won't have a math background. It makes sense to me though to use the background in math that I have to help the learning process. All that being said, are there any resources out there for a new programmer (hopefully related to Java) that also reference the mathematical concepts that are being introduced? Perhaps explaining things with analogies to math? Apologies if this question isn't appropriate. I tried searching for such a resource, or an answer to this question on this site already, but have had no luck.


title: How does public API designer come to the conclusion what shall be provided for future and what not?

text: Often working with various jars and exploring the features specially in corner cases, I often realize and think that how is that they thought that it might be a useful scenario somewhere in future that it might be used and an API is made handy. So, how do they come to the conclusion what shall be provided and what not? Other problem I faced once was that I was in need of a certain feature and it was missing from the list which struck me with immense drawback of using API's. Shouldn't it be that if some feature is missing then programmer should be able to program it himself rather than depending entirely on APIs all the time?


title: Zen Coding for Java?

text: I just saw a demonstration of Zen Coding. I think it's a great investment on productivity, however my work is 99% backend data processing via Java. So far I only know templates in Eclipse like sysout and foreach (then hit CTRL+SPACE in MS). Is there more Zen Coding for Java?


title: Why is it so hard to get employees to update the issue tracker?

text: I've always had this struggle to get folks to update their issues, both at my company and at work. I've had a few cases when people actually do it from the goodness of their heart, but ~70% of the time I have to be chasing people down. Being the one that generally does some or other form of management (I am firstmost a developer), the main reason I try to give is that I don't want to be chasing people down and interrupting to query on progress, but I don't think in the end people mind that much being asked. In some rare and extreme cases I end up updating their tickets (when I need to create reports). So, have you ran into this problem?, how have you encouraged developers to update the issue tracker frequently?, what degree of success have you had?


Can working with bad code erode your programming skills?


title: How to move away from hardcoded paths in our build processes

text: We have a set of Java tools that are built and run locally. Whenever one of the devs commits a change, everyone else (including non-developers) need to do an update and build the tools. Everyone uses windows machines so whoever designed the build processes decided to place everything in a folder called `C:\build` and dump all of the class files in the appropriate folders. For example, the folder might look something like               C:\build\firstTool\     C:\build\secondTool\     C:\build\settings.ini      We also have a huge library folder where all the jars go, and it's placed here               C:\lib\      As a result, many classes are simply assuming this is where the files are going to be stored and have hardcoded paths everywhere. What can I do to clean things up? I don't want users to have to build tools, nor do I want them to have to update any checked out repos on their end. Personally, I think developers should be the ones maintaining releases.


title: How can I feel more confident about my programming skills?

text: Programming isn't alien to me. I first starting doing markup (HTML, now please don't laugh at me) when I was 12 and a little bit of BASIC when I was 13 (I knew much about Flowcharts, Pseudocodes at this point), but then I was admonished into Biology in high school and hence missed out on "real" programming knowledge of languages such as C, Java, etcetera. I took up CS for my UG B.E. (similar to BS, but way more theoretical). I learnt C & C++ (to a lesser extent) on my own (my prof was a total pain and the class was filled with code-jocks (who had already learnt it in school, and hence paid no attention to class and didn't let lesser mortals like me to pay any attention to class either)) and could whip up an awesome addition or multiplication program (ones which now even kinder-gardeners' whip up with way more finesse) and a piss-poor knowledge of Java (which has even grown rusty in recent times). My main problem is that I've always felt inadequate and strangled by my limited programming skills and belittled by the code-jocks (believe me, I've come across this site ages ago, but could just now build up the courage to actually post a question) and have been at times even depressed over said inability. Most people say that Programming isn't necessarily about the language but the state of mind that the person has and the techniques they employ to solve problems/issues. I agree with such sentiments, but can I ever acquire such a "state of mind", and if such how should I approach "Programming/Coding", and if there are any set ways and steps one most go through to attain the "Zen of Coding". How do I do so? Also, it wouldn't hurt if some Saint wanted to mentor this downtrodden piece of $#!^. P.S. I would forever be grateful to any person who considers me worth their time, and as a bonus would name my first piece of Software I ship after them. (If I ever get to ship one, i.e.,) TL;DR: Never really learnt "Programming/Coding", can't solve problems even if I try to. Help me!


title: Who should define, assign, implement, and follow the tasks in Scrum?

text: Roles in scrum are Product Owner, Scrum Master, and Scrum Team. A user story should also break down into smaller pieces called tasks. A task seems to have four phases, namely, definition, assignment, implementation, and following. Who should do what in Scrum about tasks? Is it the responsibility of scrum master to update remaining hours of a task, or is it the responsibility of the developer (scrum team)? Should developers assign tasks to themselves or is it the responsibility of scrum master accompanied by product owner?


title: Why do we need different JS for different browsers

text: What exactly are different things we need to take care when writing different JS files, like arrays, variables etc., Is there a book or website explaining differences between different JS engines used for browsers? I was working on something in our application and bumped into a JS issue and was looking for solution and found out that we might need 2 different JS for different browsers to get my exact functionality. Why is that? Is that the browsers use different JS engines so they understand my JS in different ways?


title: Large teams with layered application

text: I work in a fairly large team (~15 developers) which is currently discussing our working methodology. The software we work on is quite feature-rich and expanding rapidly in terms of scope so the number of developers has increased lately and will continue to increase. At the moment the different developers have different focus areas which they happen to be good at. Some focus on user interface, some on business logic and some on backend. But a UI developer may add something to the backend if he feels like doing it. As the number of developers grow, we can no longer work in the same team (it's kind of hard to try to follow what 20 other people are doing). Multiple teams working in the same code base could get messy if people are changing "other peoples' code". We are discussing some alternative ways to divide our tasks, and different people argues for different ways:   * Some think that the current way of doing things is good enough. Sure, a guy who focuses on the UI could make changes to the backend business logic and potentially mess things up. But at the same time we trust him not to mess up too much. Reviews of changes could be enough to make sure that the quality stays good.   * Some prefer that a team is assigned to a specific layer. For example, a team (2-3 developers) could be assigned to work only business logic implementation in backend, while another team could be assigned to work on frontend and a third could focus on the persistence stuff. This would encourage people to be experts in their layer. The down side is that if a UI developer needs something in the backend, there's an overhead with planning if the person doing the backend is in another team.   * A third suggested way is to have teams with members knowing all layers. So one team would focus on a specific type of functionality, and then include members knowing about UI, business logic, backend, etc. This would give the benefit that a team won't need to wait for another team to finish to implement a new feature affecting all layers. The downside people see here is that this could lead to more split-focus between the developers, which could lead to lower quality. I'm not sure what I'm asking here, but if someone has experience, or know any about any good reading material about this subject it would be appreciated.


title: What classes to put exactly in a class diagram?

text: What classes must I put in a class diagram? Only classes used in Business Layer and associations between them? Or also other classes in the Data Access Layer, Service Layer, etc.?


title: Visual Studio DBProjects and problem with it running post-build SQL (file too big)

text: What I am doing is creating a DBProject.. importing a DB.. then creating scripts in the PostBuild that are DATA scripts for each table (so that the post build can populate the tables after the schema is generated.. Then problem is some of these tables containg 50,000 rows and when you put a 50,000 row insert into ONE .sql file for the post build it fails because it is too big.. so.   1. Is there a better way to achieve this ? (getting a schema and data of a DB created as part of a DBprojects Build/Publish)   2. If this way is valid.. Is the only thing to do is create another post build process that manually breaks the one big .sql file into smaller .sql files ? (so it can build/publish)


title: FFmpeg: Can I replace libx264 with OpenH264 in order to go LGPL?

text: I have some video processing to run and FFmpeg already contains much of what I need. However my videos are all compressed with H.264 video codec and libx264 is a GPL part of FFmpeg. On the other hand, the Constrained Baseline Profile is pretty enough for my application what means I could perfectly use OpenH264. So would it be possible both in theory and in practice to make this replacement?


title: Login on every page requires SSL on all pages

text: Our website has a login form that shows up in the header on every page on the website. This is what my boss wants however we need to get PCI compliant and it says any sensitive form (login/password) requires SSL. So does that mean the entire website has to be running under SSL while a user is not logged in? Another question related to that, we have third party security software scanning and testing our site and it sends HTTP post to the login form on all the pages and reports it is unsecured because it submit's it under HTTP. I am wondering how a company like say Godaddy does it because they have a login/password on their homepage yet I can access it via HTTP and submit my login information just fine. By that logic they are not secure because it allows me to do that right? I feel like I am missing something but not sure what. -EDIT- Some information that came from the security site: _**Description_** A vulnerability exists that allows an attacker to harvest sensitive information (login credentials, etc) that are thought to be SSLsecured. Specifically, a form was found on an HTTP (unencrypted) page that sends information to an HTTPS (encrypted) page. An attacker could leverage cache poisoning (DNS/DHCP/ARP/etc) or another vulnerability (e.g. XSS) to cause the HTTP page to send information to an attacker-controlled website instead of the legitimate HTTPS site. Furthermore, toolkits exist to automate the process of harvesting such credentials, connecting to the legitimate HTTPS site and establishing the attacker as a transparent proxy between the victim and the legitimate host where the attacker sees all information in cleartext (including login credentials, etc). Victim<\---------HTTP--------->Attacker<\---------HTTPS--------->Legitimate Site CVSS Score 2.1 _**Solution_** Do not allow any information you want SSL secured to originate from an unsecured page.


title: How to convince a client to switch to a framework *now*; also examples of great, large-scale php applications

text: I'm about to start working on a very ambitious project that, in my opinion, has some great potential for what concerns the basic concept and the implementation ideas ( _implementation_ as in _how this ideas will be implemented_ , not as in programming). The state of the code right now is unluckily subpar. It's vanilla php, no framework, no separation between application and visualization logic. It's been done mostly by amateur students (I know great amateur/student programmers, don't get me wrong: this was not the case though). The clients are really great, and they know the system won't scale and needs a redesign. The problem is, they would like to launch a beta ASAP and then think of rebuilding. Since just the basic functionalities are present now, I suggested it would be a great idea if we (we're a three-people shop, all very proficient) ported that code to some framework (we like CodeIgniter) before launching. We would reasonably be able to do that in < 10 days. Problem is, they don't think php would be a valid long-term solution anyway, so they would prefer to just let it be and fix the bugs for now (there's quite a bit) and then directly switch to some ruby/python based system. Porting to CI now will make future improvements incredibly easier, the current code more secure, changing the style - still being discussed with the designers - a breeze (reminder: there are database calls in template files right now); the biggest obstacle is the lack of trust in php as a valid, scalable technology. So well, I need some examples of great php applications (apart from facebook) and some suggestions on how to try to convince them to port soon. Again, they're great people - it's not like they would like ruby cause it's so hot right now; they just don't trust php since us cool programmers like bashing it, I suppose, but I'm sure going on like this for even one more day would be a mistake. Also, we have some weight in the decision process.


title: How do I find fun companies?

text: When looking for jobs, I'm not sure how to determine whether the company is fun to work for or not. I want to work in companies that are open, innovative, and make a good contribution to the world of computer science. For example, Dropbox looks like a very fun company and its existence is very important. How do I spot this in job advertisements? EDIT: I should note that I live in Australia, so many of the fun companies that I know does not have any office here. I know only a handful of fun companies in Australia – including Google in Sydney. But I don't know that many.


title: How can I display a diff result in a single file or document?

text: I'm reviewing my peer's code. I use SourceGear DiffMerge as my diff program, on a Windows environment. While I'm using the diff program, I can clearly see the code changes, etc. Is it possible to save the diff display somehow, with all its colorful rendering and strike-throughs so that I can send my comments by mail? In other words, is it possible to export the diff display to a single file (which includes all the relevant data) to be displayed without the actual need to save the two files separately? (Perhaps HTML is fit for this job). Can you recommend on a diff program that can export the diff as a single file? Thanks in advance!


title: How to find classes that use certain DB tables

text: **Problem:**   I'm asked to prepare a document where all our DB tables are listed and I'm supposed to list all Controllers that uses these DB tables for read and another list for Controllers that do write operations. Ex:                    +------------------------------------------+------------+          |            DB table                      | tbl_Orders |          +------------------------------------------+------------+          |Controllers that perform read operations  |    ??      |          +------------------------------------------+------------+          |Controllers that perform write operations |    ??      |          +------------------------------------------+------------+      We are trying to write some documentation for a **legacy** system built using Zend framework. The code is scattered everywhere. There is code in the Controllers, in the models and even in the views.   The application uses PROPEL as an ORM. What makes this really difficult is that the Controller may not be directly calling the table, but it may be instantiating a model class that calls that table. Is there an educated way to approach this crazy task? Note: Searching for the table name won't provide a solution because if a model uses that table I wouldn't know which Controller is using that model.