instruction
stringlengths
34
19.9k
One of the major advantages of software transactional memory that always gets mentioned is composability and modularity. Different fragments can be combined to produce larger components. In lock-based programs, this is often not the case. I am looking for a simple example illustrating this with actual code. I'd pref...
I occasionally worry that when I borrow snippets of code from websites, etc. there's at least the theoretical possibility that this will be copyright infringement. However, small pieces of code to accomplish common tasks may be too unoriginal for copyright and in practice this kind of sharing happens all the time. Wh...
These posts seem related, but my brain is starting to melt, trying to think this through :P My employer has just started using source control, primarily because before they hired more developers, the "repository" was the hard drive of the lone dev, who works mainly from home. All of the .NET code he'd written was check...
Just found out something rather interesting about Reddit's database schema: The way we’ve changed is we use an “open schema”. Sometimes it’s called “entity attribute value”. It’s basically a large key value store. We have two types of tables for every data type. There is a “thing” table, and then a “data”...
In licenses such as that of libjpeg and freetype, there are clauses like the following: (2) If only executable code is distributed, then the accompanying documentation must state that "this software is based in part on the work of the Independent JPEG Group". or: o Redistribution in binary form must provide a d...
How do you differentiate a web application from websites? It's language/platform agnostic.
I was wondering what would be the best method for creating a web end for interfacing with a C++ program on the server. At first I simply thought just using shell execution from the web server side language (like shell_exec() in PHP), but I was wondering if there is a "better" way. Maybe something more native or is this...
Does a web application have to live in a browser to be called a web application? Or is a thin client that uses a web service for most of it's functionality a web applicaiton?
i was working on a website with FF4 and while resizing an element with Firebug, FF4 just crashed my nVidia Display Driver. Fortunately Windows 7 was able to help me by recovering from this serious error and i was able to completely recover my work again. So my question is, should those browser developers get into low l...
There is an overhead associated with continuous integration, e.g., set up, re-training, awareness activities, stoppage to fix "bugs" that turn out to be data issues, enforced separation of concerns programming styles, etc. At what point does continuous integration pay for itself? EDIT: These were my findings The set-up...
Let us say I am writing a Facebook like application. I write code like below $this->get_user_friends(); then next morning the boss says that we don't want to call Friends friends anymore, we will call them Pal. Then all the templates are changed but what about the code above? After 2 years when some programmer will ...
This was my experience at a previous company. As it was a small startup company, some of the normal software development procedures were not followed strictly. One of my colleagues was a senior programmer with the company for 2 years. His skills were quite lacking. He would allocate his tasks to me and then take cr...
I've used some older languages before C# and I always felt the need to comment what I was doing so it is clear for anyone who reads the code. But now that I use C# decently, I often feel that it's a pain to write most of the comments because I feel like I state the obvious. So unless I do complicated formulas or algor...
Suppose I have a situation where I'm designing a website for a shoe reseller. They have different brands and kinds of shoes and of course, they want a really good search function. So there are different properties that shoes can have. They can have exclusive properties, such as size, width, gender, and children's/adul...
I think most web developers will agree that it is often easier getting something to work well in most browsers, but not as much in IE. I was wondering: When designing/developing a website, how important do you think IE-friendliness is? I mean, how worth it is it to bust yourself trying to make a website that works perf...
So when choosing what language to use for a project, in an ideal world the language is chosen because it's the right tool for the job. However, I often prefer to use a language that I am fluent in rather than one I would have to learn or that I am only conversational in. Of course language fluency also entails knowle...
I'm trying to think of a nice and easy way to do this, but I thought I'd run it past some people for a second opinion: Say you've got 8 clients (one project for each customer) and each project derives from a core project. If a bug is raised that has to be fixed in core, our current approach is to create a bug and clone...
As a newbie, I am overwhelmed by the amount of information out there and the amount of self-direction that one needs to develop as a programmer. How did you get oriented in the programming world? Are textbooks really the way to go? Or is it best to find a mentor? Was there some sort of guide or should there be some sor...
From a developer point of view which platform would you consider for a large social web application? If you could provide some details on what you consider to be the strengths of which alternative it would be great.
I am writing my first research paper on distributed storage systems. We also have a prototype working (partially). The project was a complete implementation based project where we envisage to take this project a step further and do some future development. So, my questions are: 1. How should I go about creating the "sk...
I've recently finished reading a couple of Gerald Weinberg books on Quality Software Management. In them, he strongly recommends that organizations distinguish between software failures (which we would call bugs) and software faults, i.e. coding errors. He also recommends than an organization keeps separately track of ...
This question relates to a one I asked earlier: https://stackoverflow.com/questions/5448574/under-what-conditions-could-we-justify-an-attempt-to-introduce-a-one-size-fits-al When re-reading "Domain-Driven Design: Tackling Complexity in the Heart of Software" by Eric Evans, I noticed that the possibility of achieving a ...
Why should I use this software instead of, say, Microsoft Project? What kind of level of familarisation with TFS does it demand? Is there anything similar I could use with SVN instead?
We wasted a lot of time on our last integration test on a bug that I think should have been found in unit testing. The problem was that an interface / service we called behaved different than we expected and the unit test didn't find this problem because we mocked that interface for the unit test and our mock was of co...
I have a number of machines running VS, and each has a slightly different config - display styles, installed plugins, source control extensions, project templates, service packs and so on. Not only is this annoying when moving from machine to machine but also I have no real way of wiping an install and starting again....
I have been in several software projects but not as a leader. In all the projects we all knew the tools and languages etc. before the project started. I am wondering if it is ok or is it a good practice to have a time for developers to familiarize themselves with tools and technologies after project kicks off (eg. Aft...
I'm working on a project that has very tight schedule. I don't have much time to code and test (even though I work more than 12 hours everyday, it's still delayed), and the result is very fragile. Its code is also very dilemma. This program is used by all offices in our customer's company, which is located in many coun...
I'm moving to a new company, with a new team lead. I find that this is a great time to set our mutual expectations from each other, to help us both start the role on the right foot. Do you have ideas what expectations I should set from him? In what areas should I determine his expectations from me?
I feel like a reasonably qualified programmer, but a lot of job postings I run into make me feel otherwise. Almost all of them separate qualifications into requirements and desirables, but even the requirements part can be daunting. I've seen a lot of postings that say they require several years (2 or more) experience ...
I read this in TCP/IP PROTOCOL SUITE second edition, written by Behrouz A. Forouzan and Sophia Chung Fegan. In traditional Ethernet, the minimum frame length is 520 bits, the transmission rate is 10 Mbps, the propagation speed is almost the speed of light, and the collision domain is almost 2500 meters. So what is tr...
On my current project we're using Jenkins to monitor our builds. Now they want me to write a Jenkins plugin to add some more monitoring parameters. I've taken a look at how the status monitor plugin works, and I can't figure some things out. I've tried to look for documentation for writing a plugin, but that seems to b...
Say you are designing a Square root method sqrt. Do you prefer to validate the parameter passed is not a negative number or do you leave it up to the caller to make sure the param passed is valid. How does your answer vary if the method/API is for 3rd party consumption or if it is only going to be used for the particul...
Most readers will be familiar with Bob Martin's famous dependency inversion principle, which states High-level modules should not depend on low-level modules. Both should depend on abstractions Abstractions should not depend upon details. Details should depend upon abstractions I believe I understand it all pretty ...
I am looking for links and advice on studies done on the breakdown of costs associated with Software development. In particular I am looking on what percentage of effort is testing vs programming, and how it changed with team sizes, duration of project and similar factors.
Hey, I have a question about programming style, because in my current code I am using a bigger function which calls some smaller functions and all of these need to be error-checked. So something like this: void bigFunction() { /* some computations */ if(smallFunction1() == -1) { free(mem1); ...
Is there any place on the web where can I join a team when they are just starting their project? Is there any place where developers can make groups for projects? I know there are some /dev/forums where you can have luck to find something interesting in some topic ... but the chances there are really low. I know that y...
I've been thinking on how I would go about designing the "perfect" range literal if I were to do design a language. For you that don't know know a range literal in a statement that represents a range of values, like 1-4. They're most commonly used in for/foreach loops There seems to a couple of issues one should take...
I have some experience in PHP4, but after learning the object-oriented parts of PHP, I'm having difficulty understanding how to use the Smarty template engine. The official documentation appears to require a level of knowledge I don't have yet so it doesn't seem like a good place to start. What do I need to know to j...
I am reading hibernate and I came across statements like "JDBC connections open across multiple requests is not a good thing because it is an expensive resource ". What is meant by expensive resource ? Edit : I am adding what user unknown has added as a comment below . If establishing a database connection is expensi...
Ok programmers, here's one for you. I'm writing an open source IM client/protocol as a learning exercise and to scratch my itch about some problems with current protocols. However, I'm poor. I do run a server but off the back of my own low-bandwidth residential connection (which I would rather -not- saturate by runnin...
It happens in my workplace that when a product is finished, and just some weeks before it is released and the project is closed, some business considerations remain about features that are wanted for future versions. A revision is made about the features when the project is closed, and the clients and stakeholders, alo...
How useful is UML if you are a developer working alone in a project?
I was having a small talk between teammates about how you choose a programming language for use in a project which lead me to think that there are many criteria to choose one in the beginning of a project but no real standard. Do you chose a programming language for the syntax and semantics? Or do you choose one becau...
I have been involved in a project and now it is coming to an end. The good news is the company will start to commercialize the software which is specific software to ISPs. As a programmer / developer of the project, I intend to still support the project, attend to new custommer customizations, basically the software w...
I've seen arguments for and against Systems Hungarian. For some years I've been working on a legacy project that uses this system by naming every variable, function with a prefix of the variable type eg (strName, intAge, btnSubmit etc) (I know the original Hungarian Apps prefixes by the kind of variable, not the type)....
I keep seeing in job postings that the applicant must have experience writing "scalable" applications. What makes an application scalable, and how do I know that my code can scale to millions of users? I guess a better way of phrasing this question is: How can I write my code with scalability in mind? So that the code...
How did you convince your manager to let you unit test? By "use", I mean being allowed to develop, check-in to source control and maintain the unit tests over time, etc. Typical management objections are: The customer didn't pay for unit tests The project does not allow time for unit testing Technical debt? What techn...
Possible Duplicate: Is a university education really worth it for a good programmer? I'm currently looking for a job as a web developer, and I have ~3 years experience in the field and know PHP and Ruby on Rails fairly well, and HTML/CSS like the back of my hand. I'm also well-versed in jQuery. I'm self-taught in al...
I am making a presentation that shows the differences between structural and object oriented programming and I want to illustrate why people need OOP with an example where applying OOP concepts will make coding much easier so that the audience really feel that they need OOP . Any Ideas ??
What tests should I use to unit test a CSV parser? I have a simple CSV parser in C#, and I want to be sure that I have good unit test coverage of all the common (and uncommon) edge cases. What tests should I use to identify potential problems and boundary cases?
Hello What's a good methodology for a small 2-person project? Ranges from 20-40hr. It's mostly small websites. I want to approach it as a developer, but Agile and other methodologies seems too large scale for what I'm after. Thanks
In Python, and most likely many other programming languages, common data structures can be found as an integrated part of the core language with their own dedicated syntax. If we put LISP's integrated list syntax aside, I can't think of any other languages that I know which provides some kind of data structure above th...
It's been 5 years since I worked with Java, but I'm in the job market again and there seem to be more Java positions than C/C++ where I live now. Are there any resources to quickly come back up to speed? The last Java I developed with was 1.3. Also what are the good resources for java technologies like springs and stru...
So I've been looking at furthering my knowledge into embedded and lower level hardware programming, however, every time I look for jobs that mentions "embedded" it's always high level stuff. To me, that doesn't make a whole lot of sense. So what exactly does "embedded" entail? When I think of embedded I think of lowe...
In the last few months, the mantra "favor composition over inheritance" seems to have sprung up out of nowhere and become almost some sort of meme within the programming community. And every time I see it, I'm a little bit mystified. It's like someone said "favor drills over hammers." In my experience, composition a...
Why should a programmer ever fork a library for inclusion in a widely used application? I ask this question because I was reading an article about why Chromium isn't packaged for many Linux distros like Fedora. Apparently its largely due to the fact that Google has forked a number of libraries, modified them, and inclu...
So, I was tasked by client to help him convert his wp menu to javascript dropdown. I did on my development server. He did see the change and I was paid. I deliver the code he deploy it. But, no change on his server. So, I have to spent hours debugging it on his server. It turns out, his other plugin is not compatible w...
Looking for a case study, or operational plan for setting up a "programmer/hacker dojo" in the United States. Here's an example of one, hackerdojo.com; it's possible this info is on their site, but I have been unable to find it. UPDATE (1): Wikipedia - http://en.wikipedia.org/wiki/Hacker_Dojo WSJ - Techies Get to ...
When speaking with a non-programmer friend, I happened to mention the concept of "beautiful code" and she wanted to understand what that meant, but I was at a bit of a loss as to how to explain it to someone who would have no context whatsoever. When all code looks like gibberish to someone anyways, how can you explain...
I was reading through the code of StackOverflow's new SQL Object Mapper. And I noticed at the bottom of the SqlMapper.cs there is some code that I had never seen before. After reading some of the documentation on MSDN and a tutorial on MSIL this feels a little over my head. As a professional .NET developer (6 years), s...
I'm looking for advice from people who have actually migrated a large system from WebForms to MVC. What are the things to watch out for? The literature says that both can co-exist for the same system but was it really that easy? Was managing authentication between the two seamless? Was maintenance easier/tougher after ...
I'm interested to know the implementation of the 'new message' in gmail for example. I know that ajax is used, but what else it is used on the server and client side. Can you explain me the scenario? Gmail is just a sample to sustain my question. I'm interested about the cheapest solution which allow to display new con...
I'm searching for an app that is cloning all my commands(mouse and keyboard) to a second window. Especially for Browsers. I'd like to test a web page and want to see the different behavior in two windows(different revisions of the page) directly. For example, in window 1 i click link3 and an a specific url opens. This ...
I'm interested in things a programmer should learn/know to provide extremely good application architecture design. As known any design can be regarded as good one for certain circumstances but when it comes to extending app feature set or providing some optimization and etc. it turns out that app was poorly designed o...
As I understand, in Java, stack memory holds primitives and method invocations and heap memory is used to store objects. Suppose I have a class class A { int a ; String b; //getters and setters } Where will the primitive a in class A be stored? Why does heap memory exist at all? Why can't we sto...
As an employee of a company, when you write code do you feel like you have an attachment to it? Do you feel that you have some ownership of the code? Or do you write it completely detached from it without any concern about what happens to it after you've moved onto something else? EDIT: I'm not talking about writing ba...
How do I go about improving my memory and recall as it relates to Programming? I have a tendency to cache API information short term and then immediately put it out of my head as I move on to something else. This sometimes makes me look bad as I can't recall API information on code I should be really familiar with. It ...
Programming languages often come with various bit operators (e.g. bitwise left- and right shift, bitwise AND, OR, XOR...). These don't get used though very much, or at least such has my experience been. They are sometimes used in programming challenges or interview questions, or the solution migh require them, e.g.: W...
Perceptrons, a simple form of supervised machine learning, must be trained with a set of known good inputs before they can "learn" by adjusting internal weights assigned to inputs, based on the accuracy of its results. Similarly, we know that reinforcement learning and unsupervised neural networks are able to learn wit...
As developers we constantly strive to solve problems of the masses. We also constantly look for new methodologies, languages and possibly organizations to help us further our ability to solve problems. I feel as if I've always been one of the top members on my team. I also feel that I look for ways to improve my work...
I have worked extensively in developing web applications using PHP and ASP.NET, but one of the questions that I'm constantly asked by customers is whether to move forward with a php website or an asp.net website. So naturally the first thing that comes to mind is to answer the question like this: PHP is open-source an...
What I mean is we always want to test something in the actual real world live production environment, regardless of any testing we do with any fake paypal credit card numbers or other sandboxed numbers. So instead of using our personal cards, I wonder if there is a credit company that will supply a fully feature credit...
As part of a review of all job descriptions, my company has decided to include the following as a key output: website development completed on time, within specification and error free Given that specifications regularly change, there is no formal change control process and environments are, shall we say, a littl...
My thinking is that a company who's primary business is making widgets groups developers with networking, support, etc because none of it is the business, it's support of the business. If your primary business IS selling software, then I would call the development group "Research and Development" or something similar. ...
In the absence of a written policy, what is the preferred email domain (corporate or personal) when contributing to an open source project that your employer sponsors? I'm interested in the programmer's preference assuming the company doesn't care either way.
What do people generally mean whenever you see XXX in a comment. Occasionally, I'll see a comment like this: # XXX - This widget really should frobulate the whatsit Of course, I can tell what the comment means, but what does the XXX generally mean? Is it saying "This is a hack" or maybe "Perhaps we should revisit th...
I understand the value of automated testing and use it wherever the problem is well-specified enough that I can come up with good test cases. I've noticed, though, that some people here and on StackOverflow emphasize testing only a unit, not its dependencies. Here I fail to see the benefit. Mocking/stubbing to avoid ...
Of course you can, I'm just wondering if it's rational to design in such a way. I'm making a breakout clone and was doing some class design. I wanted to use inheritance, even though I don't have to, to apply what I've learned in C++. I was thinking about class design and came up with something like this: GameObject -> ...
Edit: How do you manage individual tasks when working on multiple languages In day to day task handling, how many different programming languages do you work with? Do you make a mental shift when working on each language? Do you Prioritize them and keep each task per language separately. Do you code in stages based o...
I need to write an application which consumes a forum's content via a REST API and stores threads and posts. The application will act as a bridge layer between the forum and write data to a third application periodically - as close to 'real-time'as possible. The platform is PHP 5.3 / MySQL and probably Symfony with the...
It is good for a developer to work on a per-hour basis, but it's hard to explain the advantages of hourly rate to the customer. What are your arguments on the hourly rate for the customer? How do you explain him his benefits and how do you argue on "I want to know the exact cost of the project"?
I have the following classes : class Task { public void DoSomething() { var s = new Service(); s.First(); s.Second(); s.Third(); } } class Service { public void First() {}; public void Second() {}; public void Third() {}; } If I want to add logging, should I pu...
Following the below question on Stack Overflow https://stackoverflow.com/questions/5564610/fast-alernative-for-stringindexofstring-str I got to wondering why it is that java (6 at least) not use a more efficient implementation? Following is the code: java.lang.String#indexOf(String str) 1762 static int indexOf(char[...
Are frameworks really necessary in PHP? What are the advantages and disadvantages of using one?
I have a little problem. I'm writing a resource loading and caching system, in which user can request a resource, and set a callback to be called when resource is loaded (and/or wait for load to finish). This leads to code like this: var waitobj=Loader.RequestObject("foo"); waitobj.LoadFinished+=delegate{ Bar(); }; Ho...
I have heard some say it isn't but they never suggest an alternative. Is this true? UPDATE Is it possible to store this external from application and have it called?
I was asked by an employer about CRM in the context of C++ software development. The position I was applying for was C++ Software Engineer. I told them: As far as I know, CRM is an acronym that stands for Customer Relationship Management. It also refers to software tools that track the responses and actions of cust...
Currently I'm checking some client and server software and I wish to expand the testing coverage for it. Specifically I want to increase the quality of the load and stress testing that is performed so that it better reflects user usage. To this end I've been looking at JMeter, however I've encountered an issue. Unlike ...
What technology is used by sites like goanimate, xtranormal, and animoto? Especially the video compilation engine in the backend of animoto? Could HTML5 be used to do everything that's there?
I'm developing an application, in iOS, that is required to connect to my Windows Server to poll for new data, update, etc. As a seasoned C# developer, my first instinct is to start a new project in Visual Studio and select Web Service, letting my bias (and comfort level) dictate the service layer of my application. Ho...
So, today I looked at Arduino; seems very interesting. I still don't want to shell out the money just yet, as I have some questions, namely: Should I learn something about electronics? What and with what resources? What stuff should I buy? I have a limited, but not that small budget (probably up to 200€, but preferabl...
I understand what SOLID is supposed to accomplish and use it regularly in situations where modularity is important and its goals are clearly useful. However, two things prevent me from applying it consistently across my codebase: I want to avoid premature abstraction. In my experience drawing abstraction lines witho...
I've been a professional coder for a several years. The comments about my code have generally been the same: writes great code, well-tested, but could be faster. So how do I become a faster coder, without sacrificing quality? For the sake of this question, I'm going to limit the scope to C#, since that's primarily what...
I'm trying to wrap my head around different concurrency solutions to several threads iterating over the same collection but I'm having difficulty coming up with good realistic (but preferably easy to model) scenarios to code against. I'm looking for realistic scenarios for: A scenario where several threads can iterat...
I'm working at a project in one of the world's top 3 IT consulting firms, and was told by a DBA that company best practice's state stored procedures are not a "best practice". This is so contrary to everything I've learned. Stored procedures give you code reuse, and encapsulation (two pillars of software development),...
Well, the questions said itself. In my workplace those cases happen, but also, many Agile books promote working in the same workplace and being concentrated in the current project to become faster in the pace of work. Maybe i'm not that informed about the topic, maybe is not that strict but, that's why I wanted to know...
For a while I've been wanting to learn ERP. What I would like to do is set up a system, and then practice running a business doing things like generating invoices, raising purchase orders, producing monthly accounts, and keeping track of fixed assets. Then look at enhancing the system further by adding custom code. Is ...
It seems to me that buying and reading books is one of the most important investments a developer can make, and one of the most important investment a company can spend on a developer. There were a lot of times when I was confronted with a tricky problem, and what I did was to flip through an algorithm book and I would...
I am trying to implement Scrum and have some basic questions. I understand creating stories to implement end user functionality, but where does a "meta-task" like collecting requirements for the stories in the first place come from? Is this even before the story process begins? I guess I am struggling with the fact ...
In which respects "Just In Time" compilation is better than "Ahead Of Time" compilation? And vice versa.