instruction
stringlengths
34
36.1k
C# allows the use of #region/#endregion keywords to make areas of code collapsible in the editor. Whenever I do this though I do it to hide large chunks of code that could probably be refactored into other classes or methods. For example I have seen methods that contain 500 lines of code with 3 or 4 regions just to mak...
Is it advisable to create multiple classes within a .cs file or should each .cs file have an individual class? For example: public class Items { public class Animal { } public class Person { } public class Object { } } Dodging the fact for a minute that this is a poor example of g...
I've done some programming in a more-or-less functional style, but I've never really studied pure functional programming. What is the bare minimum needed to implement a functional language? As far as I can tell, you need: The ability to define a function The ability to call a function parameter substitution Some kind ...
Possible Duplicate: Should I keep investing into data structures and algorithms? I'm a CS student. I want to become a really great programmer, what do I need to do to be come a great programmer? Other then writing lots of code, I've heard that studying algorithms and theory (logic!) is help. What do you recommend to...
I'm a 25 year old data consultant who is considering returning to school to get a second bachelors degree in computer science or engineering. My interest is data science and machine learning. I use programming as a means to an end, and use languages like Python, R, C, Java, and Hadoop to find meaning in large data sets...
The site I work on is almost entirely in Javascript, it just goes back (via Ajax) to the server for authentication, database access, things like that. My boss would like me to add blogging, forum, and commenting capabilities. I don't want to implement it from scratch and I certainly don't want to integrate some HTML-...
I've just released my application to the public, and I'm working on an updated version, but I really think I should keep track of ALL the code changes. In case some functionality suddenly starts failing, with a history of all the changes I made it would be a lot easier to figure out where I messed it up, in case the pr...
Does anyone out there have any experience porting a large Powerbuilder client/server application to a Java application (or another language)? By large I mean something on the order of 2 million lines of code and literally hundreds of database tables. How did you do it? How long did it take and how much did it cost? Wha...
In Java world, there are some scenarios where I see developers used to load the class rather than instantiation. What is the difference between instantiating and loading a class?
Esoteric languages are intriguing and can make you go 'Hmmm...', but what can we really learn from them? Is there a benefit to spending more than 5 minutes trying to write an application in an esoteric language? Have you tried one, and if so, what did you learn?
I mean did you ever reluctantly adopt a less than ideal solution because management told you that "customer is always right"? I'll go with mine first. A few years back, me and my team developed a website of quizzes. Users create quizzes, answer them, rate/tag/vote/share etc. If a quiz had more than 10 questions in it, ...
In my application, I have a listing of information that is deducted from a query that combines information from several entities. In itself, a very common situation. Now, the corresponding repository method should return a list that contains items of an appropriate type. Clearly, choosing an entity is not appropriate b...
After doing a bit of programming, I've become quite curious on language design itself. I'm still a novice (I've been doing it for about a year), so the majority of my code pertains to only two fields (GUI design in Python and basic algorithms in C/C++). I have become intrigued with how the actual languages themselves a...
I am looking for more information on a gradual release process - that is when you release new version of a software only to certain set of end users, mostly geographically limited (or limited by a reach of particular server). Google seems to be blind to this term - that indicates that's not how it's called. What's the ...
Do you use both Client-side and Server-side validation techniques side by side when validating input from a user, e.g. via a contact form? If so, is it really necessary? Are you over engineering?
I have a Maven project consists of around 100 modules. I have reason to decompose the project to so many modules, and I don't think I should merge them in order to speed up the build process. I have read a lot of projects by other people, e.g., the Maven project itself, and Apache Archiva, and Hudson project, they all ...
In an embedded device, during the initializing of memory locations, is there any convention that are being practiced. I mean, say setting every byte to zero or 0xFF or any other value.
I've often seen such comments be used: function foo() { ... } // foo while (...) { ... } // while if (...) { ... } // if and sometimes even as far as if (condition) { ... } // if (condition) I've never understood this practice and thus never applied it. If your code is so long that you need to know what...
Every time I've finished a project, there is always something that I've learned (otherwise I don't find it very motivating). But I can't remember everything, and much later I may stumble across the same problem that I encountered in a previous project but no longer how I solved it (or at least what attempts I made). So...
Project Managers/Technical Leads sometimes tend to be over enthusiastic when it comes to software. But during code reviews if instead of functionality of the code the only complain one hears is about formatting/spacing and similar trivial things, when there are far better things to discuss (Among other things I have no...
Possible Duplicate: Would you allow your programmers to use Messenger and social networks like Facebook? A manager may believe that using IM clients in the office is not acceptable, but many programmers use them for legitimate purposes, for example in order to easily contact one another. Do you think the IM chat pro...
If I am localizing a piece of software that uses an external API, how should I handle error messages that originate in this API? I do not control the API, I only consume it. The error responses are not very structured: some contain error codes, some contain verbose details in the text, others almost nothing. Some error...
So, before I came to my current place of employment, the windows OutputDebugString function was completely unheard of, everyone was adding debug messages to string lists and saving them to file or doing showmessage popups (not very useful for debugging drawing issues). Now everybody (all 6 of us) is like "What can I s...
Developers, managers, or customers? I was recently involved in a situation where I felt like the customers were arbitrarily demanding for more developers on a team which already had too many developers. They were scared the project was going to be late (and it probably will be). Personally, I was scared we were going t...
I am planning to be traveling through eurasia and asia (russia, china, korea, japan, south east asia...) for a while and, although there are plenty of marvelous things to see and to do, I must keep on working :(. I am a python developer, dedicated mainly to web projects. I use django, sqlite3, browsers, and ocassionaly...
Interested in peoples opinions of Cuda vs openCL following NVidia's Cuda4 release. I had originally gone with openCL since cross platform, open standards are a good thing(tm). I assumed NVidia would fall into line as they had done with openGL. But having talked to some NVidia people, they (naturaly) claim that they wil...
I have recompiled a plugin (making changes before they are accepted upstream) for the gstreamer media framework. I did not recompile the whole library -- just a plugin. If I want proprietary python code to use this plugin -- am I running afoul of the LGPL license? My code never directly links to the modified plugin. ...
From different comparisons among C++ templates and C#/Java generics like this one- https://stackoverflow.com/questions/31693/what-are-the-differences-between-generics-in-c-and-java-and-templates-in-c/31929#31929 I got a perception that, C++ templates are implemented by some kind of preprocessing(plain text replacement ...
Idea I had this idea for a language feature that I think would be useful, does anyone know of a language that implements something like this? The idea is that besides inheritance a class can also use something called "imprinting" (for lack of better term). A class can imprint one or several (non-abstract) classes. When...
Certainly it is a productivity killer when a developer is constantly interrupted by other workers, bosses, etc - but it is even worse when the developer is constantly interrupted by his or her own tools and equipment. For example, if a developer must wait 10 minutes for each build he makes - so that he can iteratively ...
I have read most of the major threads on WPF vs. WinForms and I find myself stuck in the unfortunate ambivalence you can fall into when deciding between the tried and true previous tech (Winforms), and it's successor (WPF). I am a veteran Delphi programmer of many years that is finally making the jump to C#. My fellow...
Does anyone know anything about slidedeck's business model (see link below)? These guys are a javascript component that they sell online. As the tech savvy know - It's very difficult to sell javascript online, because it's pretty much like selling source code. But check out: http://www.slidedeck.com/pricing-b/ These gu...
I'm just starting to learn C#. Coming from a background in Java, C++ and Objective-C, I find C#'s Pascal-casing its method-names rather unique, and a tad difficult to get used to at first. What is the reasoning and philosophy behind this? I'm guessing it is because of C# properties. Unlike in Objective-C, where method ...
And why is it often talked about? Like I know what OO programming is obviously... but people always say "Oh OO reuse is the biggest programming myth ever". What exactly does this mean?
Is there any existing in-use, or even just conceptual attempts at creating a markup or programmatic expressions for designing the layouts of websites other than HTML/CSS? If there are others out there and they do not appear to be in heavy use. Why is this?
I spotted a bug today in a web application that I develop and maintain for a client. I let the client know that I had spotted a problem and after a short time I fixed it and reported back the full details to them. In cases like these do you always tell your client? Even though it would be possible to fix the problem an...
I'm looking for your best "quick answer" technical interview questions. We are a 100% Microsoft shop and do the majority of our development on the ASP.NET web stack in C# and have a custom SOA framework also written in C#. We use a combination of Web Forms, MVC, Web Services, WCF, Entity Framework, SQL Server, TSQL, jQ...
Swing is an integral part of the Java API. It is also the most popular GUI framework for Java. I still wonder, should every Java programmer still know, or at least be pretty familiar with, Swing (possibly excluding web developers)? There are alternatives (e.g. SWT), but they are not very widely used (compared to Swing)...
I've recently been in an argument with a colleague about technical questions in interviews. As a graduate, I went round lots of companies and noticed they used the same questions. An example is "Can you write a function that determines if a number is prime or not?", 4 years later, I find that particular question is qui...
I'm a PHP programmer, and until now I have not needed to learn algorithms... Now I'm start learning Python (a real programming language), because I need to use matplotlib. Does it make sense to start by reading a Python algorithm book and then learn matplotlib and numpy or should I jump to matplotlib and numpy? Best Re...
I'd like to get into web development using C++ as the "scripting language" on the server-side. My server infrastructure is *nix based, so doing web development in C++ on Azure is not applicable and C++/CLI ASP.NET is also not applicable. Separate from legacy CGI applications, can web development be done using C++ ?
My team does a lot of internal tooling and infrastructure work - you can think of us as a small scale version of the teams Facebook, Etsy, Netflix, etc. who build all the infrastructure for scaling their services up to thousands/tens of thousands of servers and supporting millions of users. Lately, we've been running f...
I use OOP programming with inheritance, but I've not yet used interfaces.I want to learn how to use design patterns, but I'm finding them very difficult to learn. Is there is any way to learn design patterns easily? I searched quite a bit, but I was not able to find useful information.
I have a Business layer (BL) and a Data layer (DL). I have an object o with a child objects collection of Type C. I would like to provide a semantics like the following o.Children.Add("info"). In the BL I would like to have a static CLASS that all of business layer classes uses to get a reference to the current dat...
As long as the code in the base library is as loosely coupled as splitting it up into separate libraries, what's the problem? In general, having a lot of assemblies composing a .NET solution is painful. Plus, when code in one solution needs to be shared, it can just be added to the common library, rather than deciding ...
During my 5 years in IT as a software developer, I've noticed that developers have a strong distaste towards doing any documentation. The act of taking screenshots and creating documentation seems to be a painful and time consuming experience. In one company I worked for, we had a technical documentation team with two ...
I've found, what I personally believe to be a bad habit that a lot of developers seem to have adopted. Code in various places in the applications I have seen are commented out (lots of it) and checked into the mainline. Now, I don't have a problem with people doing this with their own branches, but is it a good idea to...
This is actually a question I should've asked a while ago(as in, I don't even work at this job) but I thought it to be an interesting question nonetheless. Our team was basically just 1 developer(me!). The manager also developed sometimes, but was mostly just business. He thought we should have some sort of bug tracke...
I'm a hobbyist programmer (with no formal education) looking to start doing small freelance jobs. One of the things that hobbyist programmers can get away with that those with a "real" job can't is lack of documentation. After all, you wrote it so you know how it works. I feel a little silly asking because it seems lik...
I work on a team that has been flat organizationally since it's creation several months ago. My manager is non-technical and this means that our whole team is responsible for decision-making. My manager is beginning to realize that there are several benefits to having a lead developer, both for his sake (a single poin...
Today, One of my colleague and I have a debate about "Should we put the specification documents in source control system such as SVN?". In my opinion, It should be. Everything relate to developing project should be controled carefully with source control system. Is it a wrong concept in software development process?
Obviously something as simple as int i = 0; or for (int i = 0; i < 10; i++) can't be copyrighted, but an entire function could be. Where is the line between copyrightable and uncopyrightable?
One of the most intriguing items in the recently released Visual Studio 2010 Feature Pack 2 is the ability to create and edit UI tests in Silverlight. Here is an example of a coded UI test. I haven't had much time to use it yet, but for people who have, I am curious as to what your thoughts are. Is this something yo...
As a freelancer working on both paid and personal projects, I'm always splitting my time between a huge number of small and large projects/tasks/fine details. I've developed a small custom-coded solution to organizing my time and tasks. What is the best solution to organizing and managing your projects, tasks and to-d...
There is a developer, let's call him John (currently on probationary period) in company(pretty small company approx. 10 persons, 3 developers, one of them works long in this company know business process around and can be consider as Team leader) who didn't want to use any IDE at all(he is using some text editor). Ap...
We are trying to figure out the best practice for working with very large DBs in Java. What we do is a kind of BI (business Intelligence), i.e analyzing very large DBs, and using them to create intermediate DBs that represent intelligent knowledge of the DBs. We are currently using JDBC, and just preforming queries usi...
I paid for a web site for my motel business, then due to my landlord actions I was placed in a position to file for bankrupcy. I asked my IT manager and web developer to close down the web site for the business. He has since then sold my web site to the new owners. I took all the photos myself and I am in at least 4 o...
I have an app that works with a list of objects so has one central keyed list. The main window has a tree containing these object with some information, which is easy enough to populate as a one off event after loading. Now, the complicated part, any part of the application can add, remove, and more importantly change ...
I was wondering if anyone had the same need and why (if possible). My problem is: I can't create a model in EF using two tables from different DBs without some weird workarounds. For my scope that is very much necessary. Did any of you ever needed to do this? What did you do? And, like me, do you think MS should add ...
I start a job this summer doing work in ASP.NET 4 (C#). I plan on working with some legacy code as well as MVC. I want to get a running start. I have good understanding of HTML/CSS/Javascript, and pretty good understanding of C# itself, Design principles, Design Patterns, and understand masterpages, basic MVC2, and cod...
This statement suggests that statically typed languages are not ideal for web sites: I’ll contrast that with building a website. When rendering web pages, often you have very many components interacting on a web page. You have buttons over here and little widgets over there and there are dozens of them on ...
This question made me think that there was a better question to ask. What did you learn in school that you didn't care about at the time, but turned out to be useful or you had to relearn in the workplace because you had it in school, but didn't retain the information and you needed it? (I mean for software related job...
When building an API for a customer, the public javadoc has to contain just what you want to show the customer. Which is a shame, as it the javadoc is also, in some ways, the obvious target for some kinds of internal design documentation. One might imagine a custom doclet or some other trickery to allow the two types o...
Imagine you have implemented the creation of a nice path-based star shape in Lisp. Then you discover Processing and you re-implement the whole code, because Processing/Java/Java2D is different. Then you want to tinker with libcinder, so you port your code to C++/Cairo. You are (re)writing a lot of boiler plate code, wh...
I have a small project (3000 lines in Python) that I wrote myself; it has no known bugs and has some decent parts, but is largely a mess because of my lack of time. Unfortunately, I have to be the one who continues writing and maintaining the code. Is it a good idea to hire a highly experienced developer, explain to th...
Coding is only one aspect to professional programming. My job requires me to code, but it also requires me to do other things for extended periods – sometimes days or weeks go by when I'm not just coding. I fear letting hard-won programming skills atrophy while I sit in meetings, draw architecture diagrams and annotate...
I spend a lot of time working in javascript of late. I have not found a way that seems to work well for testing javascript. This in the past hasn't been a problem for me since most of the websites I worked on had very little javascript in them. I now have a new website that makes extensive use of jQuery I would like ...
I write software that involves the use of measured quantities, many input by the user, most displayed, that are fed into calculation models to simulate various physical thing-a-majigs. We have created a data type that allows us to associate a numeric value with a unit, we call these "quantities" (big duh). Quantities ...
I'm developing a software to program a device. I have some commands like Reset, Read_Version, Read_memory, Write_memory, Erase_memory. Reset and Read_Version are fixed. They don't need parameters. Read_memory and Erase_memory need the same parameters that are Length and Address. Write_memory needs Lenght, Address and D...
I'm about to write the company guidelines about what must never appear in logs (trace of an application). In fact, some developers try to include as many information as possible in trace, making it risky to store those logs, and extremely dangerous to submit them, especially when the customer doesn't know this informat...
I have a little program that I wrote for a local group to handle a somewhat complicated scheduling issue for scheduling multiple meetings in multiple locations that change weekly according to certain criteria. It's a niche need, but I wouldn't be surprised if there are other groups that could use software like this. ...
I have been working on learning as much as I can before starting college to change my career, and I noticed on the w3schools site that there is now html and html 5, css and css 3. Do I need to go back and learn those newer languages before moving onto PHP and MySQL?
So I know HTML5 is the "replacement" for Flash...however it's obviously not mainstream just yet......but what else is it supposed to replace. I ask this because web-dev has always been a secret kinda side-passion of mine (even though I a firmware programmer mostly doing C/Java stuff). And anyway I want to pursue a side...
Anecdotally, I've visited many .aspx website that require a significant amount of load time for each page. Is my experience unique? If not, why might an ASP.Net website load slowly? Edit: It's now about 7 years later (12/29/2017). The good news is I don't see this problem much anymore, maybe because Google started pena...
This is my first question on stackoverflow, so please bear with me. I'm trying to stay away from any form of trolling or flame baiting as i have a tremendous respect for both languages. I'm a python programmer (though not an expert) and i love it. My first language was C++. My line of work (web development) is pushing ...
My experience with developing dynamic websites is limited mostly to Java servlets. I've used Tomcat to develop various Java servlets, and I wouldn't hesitate to say that I'm reasonably proficient with this technology, as well as with client-side HTML/CSS/Javascript for the front-end. When I think "dynamic website", I ...
I've been programming for a while on different languages. I never really studied programming at school nor worked on a team of more than two people (me included). Still, I've been a professional developer for over three years. Last year, I took over my first C# project and it ended up being fine. I can't help but think...
I recently started working on a personal project where I was connecting to a database using Java. This got me thinking. I have to provide the login information for a database account on the DB server in order to access the database. But if I hard code it in then it would be possible for someone to decompile the progr...
In the Web development world, what exactly do backend/server-side programmers do? I guess I don't really understand the whole concept. I've done the HTML/CSS layouts and website design and a little bit of SQL with PHP (still enhancing my skills, it's more of a side project for me). I've also done a small amount of Ja...
A long-time client has asked us to help screen their work machines for pornography. They're worried about liability if sensitive materials were found. Their main concerns (for obvious reasons) are video, audio, and image files. If possible, they'd also like to scan text-based documents for inappropriate content. They h...
I'm looking for a library that I can use to help mock a program component that works only intermittently - usually, it works fine, but sometimes it fails. For example, suppose I need to read data from a file, and my program has to avoid crashing or hanging when a read fails due to a disk head crash. I'd like to model ...
Given a standard windows procedure function: LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); Where do the names wParam and lParam come from and what the history behind them?
I have been asked to work in a Java web application that is very very poorly designed. In the name of "making this easy", they have come up with their own "framework" to make things extremely difficult to understand. I am struggling to figure out the control flow. Do you have any such experience? What do you do in suc...
My problem is simple : when I'm programming in an OO paradigm, I'm often having part of a main business process divided in many classes. Which means, if I want to examine the whole functional chain that leads to the output, for debugging or for optimization research, it can be a bit painful. So I was wondering : is the...
I'm wondering if you could suggest me any way to implement "user roles" in GWT applications. I would like to implement a GWT application where users log in and are assigned "roles". Based on their role, they would be able to see and use different application areas. Here are two possible solution I thought: 1) A possibl...
Inspired by this question, I started wondering - is there or has there ever been such a thing as a "well designed application"? One where the architecture would be perfect and no refactoring would ever be needed; code would be easy to read and understand even for someone new to the project; changes could be done with a...
I am still getting mature as a software engineering/designer/architect, as you may want to call. At this point in time, I am getting small projects, private projects and so on. What I noticed is that even though I think about the SW structure, design some diagrams, have they really clear in my mind when I start coding,...
PHP stands for: PHP: Hypertext Preprocessor This a recursive loop, if I'm not mistaken. Did the creator of PHP have this in mind when he named PHP? Is this the only language where the name has some sort of spurious grammar, spelling or phonetic?
As a panelist for technical interviews, you often come across candidates who have all the requried educational qualifications, skill sets and experience level on resumes, but struggle to answer even the most basic questions. Ideally, technical interviews should try to check different aspects of a candidate and test th...
A couple recent questions focused on "well designed applications" and "poorly designed applications". Looking at the responses it appears to me that it might be easier to recognize and define poor code and poorly designed applications than it is to define what good code and good/correct application design is. What do y...
We're looking at a replacement for our CMS which runs on Oracle. The new CMSes that we've looked at can in theory run on Oracle, but most of the vendor's installs run off of MySQL vendor supports install of their CMS on MySQL, and a "theoretical" install on Oracle the vendor's dev shops use MySQL none of them develop...
I now program in C# for a living but before that I programmed in python for 5 years. I have found that I write C# very differently than most examples I see on the web. Rather then writing things like: foreach (string bar in foo) { //bar has something doen to it here } I write code that looks like this. foo.ForEa...
I have a bit of experience with SVN as a pure programmer/developer. Within my company, however, we use SVN as our Configuration Management (CM) tool. I thought using SVN for development at the same time was OK since we could use branches and the trunk for dev, and tags for releases. To me, the tags were the CM part, an...
This question got me thinking about how comapnies deal with newly-hired graduated. Do experienced programmers expect CS graduates to write clean code (by clean I mean code easily understandable by others — maybe that is too much to expect?) Or do significant portion of graduates at your place (if any) just end up test...
I thought about this, and have been trying to come up with solutions on how to fuzzy search a database, if for say example a user types a spelling mistake. Any glaring problems with the logic behind this? Will it work and has it been done before? Our table we wish to search: **tblArticles** Body - Soundex_Body - Cha...
I've read online on multiple occassions that MySQL is a bad database. The places I've read this include some threads on Reddit, but they never seem to delve in on why it's a poor product. Is there any truth to this claim? I've never used it beyond a very simple CRUD scenario, and that was for a university project durin...
I am looking into an alternative for the combined utilities of SVN, as both a development tool and configuration management tool. Instead, I would like to investigate the approach of having a dedicated Configuration Management (CM) tool and a separate development tool. The reason for this is that I work in a company w...
If you have to explain the concept of multi-threading to a seven year old kid how would you do it? I recently got this question in an interview. I came up with a story using jobs (the task to be done) and workers (the threads) but it was not entirely convincing (considering the kid is too young). If you were asked to d...
So, I'm working with an open source project, and I'm making some significant changes to a small module of the project. The project uses SVN as its version control, and I need access to this repository, since there is a lot of active development, and I need to be able to get the updates. At the same time, I don't want t...
I am planning a project to develop and enhance an information architecture for a website. This will include navigation structures, content classification, metadata etc. Where is the best place to start planning this? What software can be used to create this (apart from MS Word?) Any tips on how to go about designing a...