fundamentals

What is the Liskov Substitution Principle?

I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use? ...

What is the fastest way to learn LaTeX basics?

I am completely new to LaTeX. I know, it is not very complicated. But there are always some basics that one need to be taught before going into the autonomous exploration stage. Currently, I have installed MiKTeX, but I can't even figure out how to compile a dummy example. Can you help me? Update Found a nice helpful article on how to ...

C101: the best way to fill an array from user input?

I'm having a hard time understanding and therefore managing arrays and indexes manually in C. These are my two classic approaches but they doesn't seem to work as they keep looping when the condition is reached: #include<stdio.h> #define MAX 255 int main(){ int arr[MAX]={0}; int idx=0; /* Approach #1 */ printf("Ente...

Teaching: Field, Class & Package Relationships

In general I think I can convey most programming related concepts quite well. Yet, I still find it hard to summarise the relationship between Fields, Classes and Packages. How do You summarise "Fields", "Classes" and "Packages" and "Their Relationship" ? ...

What is the best way to check for an empty string in JavaScript?

I saw this thread, but I didn't see a JavaScript specific example. Is there a simple string.Empty in JavaScript, or is it just checking for "" ? ...

What is the difference between a method and a function

I am a long-time Applescript user and new shell scripter who wants to learn a more general scripting language like Javascript or Python for performance reasons. I am having trouble getting my head around concepts like object orientation, classes and instantiation. If someone could point me to a pithy explanation of methods vs. functio...

C# keyword usage virtual+override vs. new

What is the difference between declaring a method in a base type "virtual" and then overriding it in a child type using the "override" keyword as opposed to simply using the "new" keyword when declaring the matching method in the child type? ...

Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?

double r = 11.631; double theta = 21.4; In the debugger, these are shown as 11.631000000000000 and 21.399999618530273. How can I avoid this? ...

Don't understand how Axis works if I haven't installed it?

Forgive my ignorance - still learning here. I am using Eclipse Ganymede (Java 1.5) and have been experimenting with web services - I have mangaged to get a simple web service up and running and the nice wizard you get in Eclipse generates all the necessary bits and pieces e.g. wsdl file etc - and you can test the service and everthing e...

What does 'Polygon' mean in terms of 3D Graphics?

An old Direct3D book says "...you can achieve an acceptable frame rate with hardware acceleration while displaying between 2000 and 4000 polygons per frame..." What is one polygon in Direct3D? Do they mean one primitive (indexed or otherwise) or one triangle? ...

Method Overloading. Can you overuse it?

What's better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods? For example. If I have some Products and I'm pulling from a database explicit way: public List<Product> GetProduct(int productId) { // return a List } public List<Product> G...

References Needed for Implementing an Interpreter in C/C++

I find myself attached to a project to integerate an interpreter into an existing application. The language to be interpreted is a derivative of Lisp, with application-specific builtins. Individual 'programs' will be run batch-style in the application. I'm surprised that over the years I've written a couple of compilers, and several dat...

Is there a widespread lack of knowledge of maths, CS & engineering fundamentals in the IT industry?

If you think there is, do you see it as a real problem affecting organizations? If the answer to both question is yes: What are the root causes? Is the problem not just a lack of knowledge but obliviousness as well? Who has the ability to effectively address this issue? What are possible solutions? ...

What are the best programming articles?

Part of being a good software developer is keeping current with what people are saying in the community. There are many good articles out there on the Internet about the wide subject of computer programming. What articles have you found worth your time? Please provide the article's title, author and a link if possible. ...

StringBuilder and StringBuffer in Java

What is the main difference between StringBuffer and StringBuilder? Is there any performance issues when deciding on any one of these? ...

Questions every good .NET developer should be able to answer?

My company is about to hire .NET developers. We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question is: What questions do you think should a good .NET program...

Is args[0] guaranteed to be the path of execution?

This is a fundamental question, but an important one none the less... When starting a C++ program whose main method has the following common signature: int main(int argc, char* args[]) { //Magic! return 0; } is args[0] always guaranteed to be the path to the currently running program? What about cross platform (since I am in ...

What are the advantages of using an ORM?

As a web developer looking to move from hand-coded PHP sites to framework-based sites, I have seen a lot of discussion about the advantages of one ORM over another. It seems to be useful for projects of a certain (?) size, and even more important for enterprise-level applications. What does it give me as a developer? How will my code di...

Explaining to my boss what can and can't be done with a computer...

My boss and his boss have both been coming to me regularly over the past few weeks with feature suggestions. The majority of these are very impractical, and I tell them (politely) that they are possible but there's little or no ROI. Stupidly, yesterday, I suggested a meeting where I explain to them briefly how computers and programming l...

Where to start (self-)learning C, or should I learn I learn a different language?

Lately, I discover more and more that it's good to have extensive knowledge of programming fundamentals. Sadly, I am (one of the many) self-taught PHP developers and have no regrets choosing that path. However, I still think I should extend my knowledge to some "real" programming languages starting from zero and build up my knowledge fr...