language-agnostic

Generating An Amortization Schedule

I have been tasked with creating a program that will generate an amortization schedule. I have only done a bit of research so far, but I need to calculate out payments, interest per payment and principal per payment. Can any one point me in the right direction to figure this out? While I will be writing this in RPG, I am sure others coul...

What should coding guidelines do, and are there any good examples of guidelines?

What are some good examples of coding guidelines. I'm not really looking for anything specific to a single language. But what should I be doing/evaluating as I write coding guidelines? Such as how flexible should the guidelines and how much should decisions be left to the programmer or to someone else or even pre-decided by the guidelin...

Reaching Intermediate Programming Status

I am a software engineer that's had positions programming in VBA (though I dare not consider that 'real' experience, as it was trial and error!), Perl w/ CGI, C#, and ASP.NET. The latter two are post-undergraduate, with my entrance into the 'real world'. I'm 2 years out of college, and have had 5 years of experience (total) across the ...

Best place to start decoupling objects

This is a C# question, but really could be language-agnostic I have inherited a large object model (100+ types), with a hierarchy of objects that 'own' 0..n of other typed objects that all share a base (where there is a 'relatively' strict type hierarachy). I want to start decoupling these objects though inheritance to put together an ...

What's a good algorithm to determine if an input is a perfect square?

Closed as Exact Duplicate: Fastest way to determine if an integer’s square root is an integer What's a way to see if a number is a perfect square? bool IsPerfectSquare(long input) { // TODO } I'm using C# but this is language agnostic. Bonus points for clarity and simplicity (this isn't meant to be code-golf). Edit: T...

What kind of working agreements do you have in your team?

In this book I've read a lot about working agreements. But since we don't have any in our team, or at least none that are plain for everyone to see, I'd like to ask you if you have such agreements in your team. And of course what kind of agreements? ...

Ball to Ball Collision - Detection and Handling

With the help of the Stack Overflow community I've written a pretty basic-but fun physics simulator. You click and drag the mouse to launch a ball. It will bounce around and eventually stop on the "floor". My next big feature I want to add in is ball to ball collision. The ball's movement is broken up into a x and y speed vector. ...

What would be more productive? Converting VAX PASCAL into GNU PASCAL or port it to perl or some other language.

I have this legacy code base (Compaq PERL), about 1500 lines of code, that I need to port to windows. I wanted to use gnu PASCAL (which I have installed and have working). I have already got our assembler (HP 64000 8051) off the VAX and on to Windows (KEIL 8051). The director of Software engineering would like to get all products off the...

Application Frameworks - Buy, Build, or Assimilate?

I was curious as to what other shops are doing regarding base application frameworks? I look at an application framework as being able to provide additional or extended functionality to improve the quality of applications built from it. There are a variety of out of the box frameworks, such as Spring (or Spring.NET), etc. I find that ...

Is it wrong to decompile code?

I was just wondering if it was wrong to reverse engineer code? I understand that with languages such as C# it is a pretty easy thing to do. Is it was something that programmers use as a tool in their box of tricks? ...

What would be a good second language to learn (for a C# programmer)

I've been doing C# for quite a while now (2.5 years) professionally after having dabbled in Java and PHP while in college. Now I really want to improve myself as a developer and want to learn a second language. What would be a good choice and most importantly why; What will learning that language add to my skillset (besides the syntax ob...

Algorithm for best suiting people's choices from a definite list of items where there is only one of each available?

Ladies and Gents, My best friends and I do a "Secret Santa" type gift exchange every year, this year I've been trying to think of a couple of ways to make it interesting. There are six of us involved and I want to design a small program that allows the six of us to rank their preferred gift-recipients from 1 to 5 as well as their prefer...

How do I fix my output for floating-point imprecision?

Hi, I am doing some float manipulation and end up with the following numbers: -0.5 -0.4 -0.3000000000000000004 -0.2000000000000000004 -0.1000000000000000003 1.10E-16 0.1 0.2 0.30000000000000000004 0.4 0.5 The algorithm is the following: var inc:Number = nextMultiple(min, stepSize); trace(String(inc)); private function nextMultiple(...

Optimally assigning tasks to workers

I've been working on a comprehensive build system that performs distributed builds on multiple machines for quite some time now. It correctly handles dependencies and seemed to scale reasonably well, so we've added more projects and more machines, but it looks like it could perform better. The problem I have is one of resource allocatio...

What "bad practice" do you do, and why?

Well, "good practice" and "bad practice" are tossed around a lot these days - "Disable assertions in release builds", "Don't disable assertions in release builds", "Don't use goto.", we've got all sorts of guidelines above and beyond simply making your program work. So I ask of you, what coding practices do you violate all the time, and ...

Create, sort, and print a list of 100 random ints in the fewest chars of code

What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying. I'm interested in seeing the answers using any and all programming languages. Let's try to keep one answer per ...

Why is reflection called reflection instead of introspection?

What is the origin of the term reflection? It seems more like introspection. Why isn't it called that? Introspection: A looking inward; specifically, the act or process of self-examination. Reflection: the act of reflecting or the state of being reflected. an image; representation; counterpart a fixing of the thoughts on something;...

How much of the compiler should we know?

In order to write better code, is it worth to know deeply what the compiler does? Just how much would be enough? I'm not a bit scrubber, but I was thinking that knowing how the compiler operates would make me a better programmer. Am I wrong? If so, what resources would you recommend? ...

Cultural coding differences

I've always been wondering if there are differences between the way to code, let's say, in Germany and in India. Of course, human relationships are completely different and fit the social context. Hierarchy, management, pay amount, working time or religious practices entirely change a lot of things. But does this affect the way you cod...

Functional programming: state vs. reassignment

I need help getting my head around the difference between my current OOP notion of state, and the way it would be done in a functional language like Haskell or Clojure. To use a hackneyed example, let's say we're dealing with simplified bank account objects/structs/whatever. In an OOP language, I'd have some class holding a reference ...