discussion

How to create the first administrator user of an application?

Consider a simple web application that accepts user logins. Each user can have a profile (read-only, normal, administrator etc) and each profile dictates the user’s rights (he can only look at data, he can modify data but only if it is its own, he can do everything if he is an administrator etc). Only an administrator can create other u...

What is the fastest sorting algorithm in C++?

If I need to sort 150,000 entries what would be the fastest way for a beginner in C++ to sort that data? All I have learned so far is bubble sort and I know that isn't that efficient. thanks nmr ...

Casting ints to enums in C#

There is something that I cannot understand in C#. You can cast an out-of-range int into an enum and the compiler does not flinch. Imagine this enum: enum Colour { Red = 1, Green = 2, Blue = 3 } Now, if you write: Colour eco; eco = (Colour)17; The compiler thinks that’s fine. And the runtime, too. Uh? Why did the C# te...

When does technical documentation violate the DRY principle?

We had a project where things got in a bit of a mess a while ago because of inexperienced developers. The main issue was the fact that the programmers rushed directly into writing the code after they have read the functional requirements. They did not stop for a moment before and think how they might implement the stuff, so they coded ...

Where best to place alert/notifications on a website?

What do I mean by alert/notification? Example is an instant-messaging application, on the event when a user/friend comes online, you receive an alert that they are online - this alert is what I'm talking about. How is this done on the desktop? On desktop applications pop-up alerts/notifications appear bottom-right corner on Windows an...

To what extent can optimisation replace Macros, Stack allocation ... ?

There is a lot of discussion about the lack of macros in some languages, and the inefficiencies that can arise. Perhaps the most common example is the guard before a log statement. To what extent can current & future optimisation be relied upon to do the right thing and obviate the need for a macro. In this example and in general? // ...

State of Ruby on Rails Community and Framework

As an exercise I have spent the past 2 months learning Ruby on Rails. In learning RoR I relied heavily upon Agile Development with Rails. This book was an invaluable resource. From a learning perspective the 37Signals sponsored site Learn All About Ruby on Rails was also a great jumping off point. The issues that I ran into that were no...

Should I put custom code inside Microsoft's BCL/FCL namespaces?

A .NET programmer is allowed to wrap code inside namespaces and also to use a namespace already defined, even those defined by Microsoft in the Framework or Base Class Library. For example if I were to use System.Windows.Forms to outline this idea: Reference in assembly System.Windows.Forms.dll // This is my own C# source code file. u...

Do we consider this as a bug?

Hello All, There is a table in the page which is pre-populated. The table has a check box to approve/reject each row item and there are buttons (SAVE, CANCEL) in the page to save the changes and to cancel the changes. A BUG saying "if there are no data in the table, then the SAVE and CANCEL button should be hidden" is raised. Is this ...

Python, PowerShell, or Other?

What are the advantages of Python, PowerShell, and other scripting environments? We would like to standardize our scripting and are currently using bat and cmd files as the standard. I think Python would be a better option than these, but am also researching PowerShell and other scripting tools. The scripts would be used to trigger pr...

Your thoughts on "Large Scale C++ Software Design"

Reading the reviews at Amazon and ACCU suggests that John Lakos' book, Large-Scale C++ Software Design may be the Rosetta Stone for modularization. At the same time, the book seems to be really rare: not many have ever read it, and no pirate electronic copies are floating around. So, what do you think? ...

Why hasn't a faster, "better" language than C come out?

With all the new "modern" languages out today, how is it that C is still heralded as the fastest and "closest to the machine"? I don't really believe in there ever being only one correct way to do things, and C has been around for a really long time (since the 60's!). Have we really not come up with anything better than something written...

Person vs PersonData – To inherit or not to inherit?

I have a Person class which contains information like: personId; firstName; lastName; birthDate; identityCardNumber; address (contained Address object); ... a lot more data about the person. Whenever I need to perform operations on a person’s data, an object from this class provides all the info I need. Now, I also have a page w...

GAC and Assembly Versioning

hi guys, i have to deploy few assembly to GAC. I just had a few questions about (my) understanding of GAC. really confuses me. I want to know which versions to change assembly and file version. What are possible combinations in which GAC dll will be replaced by installing application. and basic management for GAC files. I will ex...

What effects does legacy code cause on a developer’s skills?

Edsger Dijkstra once said that "the use of COBOL cripples the mind...". How about working on legacy software? Do you, as a developer, get crippled by that? As an employed programmer, I have spent most of my time maintaining and fixing legacy systems. In my free time I constantly try to learn new techniques, languages or frameworks, but...

Common Compile/Runtime Errors in ASP.NET MVC

What are some common errors that programmers face in ASP.NET MVC when compiling or running their application? Example The incoming request does not match any route Please include the solution with the error, or if there isn't one set solution, what developers should look for when encountering these errors. ...

Why aren't students taught to use a debugger?

There's a lot of homework questions here on SO. I would guess that 90%+ can be solved by stepping through the code in a debugger, and observing program/variable state. I was never taught to use a debugger. I simply printed and read the GDB manual and stepped through their examples. When I used Visual Studio for the first time, I reme...

What is the reason of _tcs prefix for common string functions in Visual C?

Visual C++ CRT has several _t prefixed functions for both unicode and Ansi compatibility in the same source. So strcmp becomes _tcscmp, which I could never remember easily. So what is the hungarian notation meaning of _tcs and why Microsoft choose the way it is now instead of just simple prefixing, like strcmp -> _tstrcmp ? ...

.NET RIA Services - work with custom data layer

There is a web-application that works with Business Logic Layer (BLL). The BLL gets data from the Data Access Layer (DAL). The DAL gets data from DB through and does custom mapping. At the moment it is required to add into the web application some functionality that will be Silverlight-based. It is planned to use .NET RIA Services for t...

Where is Java used the most?

I have no experience with Java, but I understand it's one of the most used languages. What areas use Java the most? What are real world applications using Java as a solutions platform? Related: Why do people use Java? ...