Tagged Questions
81
votes
11answers
20k views
What backs up the claim that C++ can be faster than a JVM or CLR with JIT? [closed]
A reoccurring theme on SE I've noticed in many questions is the ongoing argument that C++ is faster and/or more efficient than higher level languages like Java. The counter-argument is that modern JVM ...
69
votes
16answers
9k views
Do the young minds need to learn the pointer concepts?
Why did the C master Dennis Ritchie introduce pointers in C? And why did the other programming languages like VB.NET or Java or C# eliminate them? I have found some points in Google, and I want to ...
62
votes
16answers
6k views
How much freedom should a programmer have in choosing a language and framework?
I started working at a company that is primarily C# oriented. We have a few people who like Java and JRuby, but a majority of programmers here like C#. I was hired because I have a lot of experience ...
49
votes
12answers
5k views
Did the developers of Java consciously abandon RAII?
As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom:
using (var ...
47
votes
11answers
52k views
For what reasons should I choose C# over Java and C++?
C# seems to be popular these days. I heard that syntactically it is almost the same as Java. Java and C++ have existed for a longer time. For what reasons should I choose C# over Java and C++?
46
votes
11answers
3k views
I don't understand how TDD helps me get a good design if I need a design to start testing it
I'm trying to wrap my head around TDD, specifically the development part. I've looked at some books, but the ones I found mainly tackle the testing part - the History of NUnit, why testing is good, ...
41
votes
8answers
4k views
Why a static main method in Java and C#, rather than a constructor?
I’m Looking for a definitive answer from a primary or secondary source for why (notably) Java and C# decided to have a static method as their entry point, rather than representing an application ...
40
votes
5answers
6k views
Why was C# made with “new” and “virtual+override” keywords unlike Java?
In Java there are no virtual, new, override keywords for method definition. So the working of a method is easy to understand. Cause if DerivedClass extends BaseClass and has a method with same name ...
39
votes
8answers
3k views
Can modern OO languages compete with C++'s array store performance?
I just noticed that every modern OO programming language that I am at least somewhat familiar with (which is basically just Java, C# and D) allows covariant arrays. That is, a string array is an ...
36
votes
6answers
6k views
Good example of complex code using TDD [closed]
What would be a good example of the use of TDD in large, real-life, complex, projects? All the examples I've seen so far are toy projects for the purpose of a book or a paper...
Can you name an ...
33
votes
3answers
1k views
Does Java development typically involve more subclassing than C#/.NET?
I've recently started looking at Android development. This has brought me back into the world of Java software development. The last time I worked with Java, I'll admit, I didn't understand OOP nearly ...
31
votes
11answers
15k views
Java vs. C# - Productivity perspective [closed]
If you have a number of years experience in working with Java and a number of years experience in working with C# and .NET, I would value your opinion on software development productivity differences ...
31
votes
10answers
2k views
Difference between Idiom and Design Pattern?
What is the difference between idiom and design-pattern? It seems that these terminologies overlap somewhere; where exactly, I don't know. Are they interchangeable? When should I use what?
Here is a ...
28
votes
7answers
5k views
Is there any benefit by switching from C# to Java? [closed]
I've been a .NET developer for about six years. In those six years, I've worked at exactly one .NET shop that followed any kind of actual design pattern or industry best practice. That realization has ...
27
votes
3answers
1k views
What are the benefits and disadvantages in the approaches of C#, Java and Scala to Closures/Lambdas/…?
I wonder what the technical implementation differences between C# and Scala are and how both solutions compare to the implementation ideas and concerns voiced in the email Peek Past lambda by Brian ...
23
votes
6answers
2k views
How do you encode Algebraic Data Types in a C#- or Java-like language?
There are some problems which are easily solved by Algebraic Data Types, for example a List type can be very succinctly expressed as:
data ConsList a = Empty | ConsCell a (ConsList a)
consmap f ...
23
votes
4answers
1k views
Why do C# and Java use reference equality as the default for '=='?
I've been pondering for a while why Java and C# (and I'm sure other languages) default to reference equality for ==.
In the programming I do (which certainly is only a small subset of programming ...
22
votes
4answers
2k views
How many days is it normal for a new hire programmer to take to get up to speed? [duplicate]
I have just landed a role as a C#/Asp.Net developer at a large software house. I have previously worked at a much smaller software house for about two years but it was a varied/mixed role there, and ...
20
votes
6answers
2k views
A programming language that allows you to define new limits for simple types
Many languages like C++, C#, and Java allow you to create objects that represent simple types like integer or float. Using a class interface you can override operators and perform logic like checking ...
20
votes
5answers
2k views
Why can't Java/C# implement RAII?
Question:
Why can't Java/C# implement RAII?
Clarification:
I am aware the garbage collector is not deterministic. So with the current language features it is not possible for an object's Dispose() ...
19
votes
3answers
14k views
what is message passing in OO?
I've been studying OO programming, primarily in C++, C# and Java. I thought I had a good grasp on it with my understanding of encapsulation, inheritance and polymorphism (as well as reading a lot of ...
19
votes
12answers
2k views
How to teach Exception Handling for New Programmers?
How do you go about teaching Exception Handling to Programmers. All other things are taught easily - Data Structures, ASP.NET, WinForms, WPF, WCF - you name it, everything can be taught easily.
With ...
19
votes
3answers
11k views
Which is a better practice - helper methods as instance or static?
This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well.
Anyway, ...
18
votes
11answers
4k views
Why hasn't C# gained much traction within the opensource community?
I'm not expecting C# to be on par with say Java or Python in the open source community, but it still surprises me just how far behind it is.
'Multi language' open source repos like google code or ...
18
votes
11answers
7k views
Which Continuous Integration framework do you use and why? [closed]
There are quite a few different Continuous Integration (CI) frameworks out there and I'm wondering which is the most popular. Which frameworks have you used at firms where you work?
Is there any ...
18
votes
3answers
2k views
Why isn't the Stab language more widely used? [closed]
I am wondering if there are technical reasons that make Stab an unsuitable alternative to Java.
Stab borrows heavily from C#, bringing many C# features to the JVM:
Less verbosity
type inference ...
17
votes
9answers
3k views
Will Java catch up with C#? [closed]
Today I posted a question asking about which language C# or Java would be better for me to study. I had some great answers. One thing that came up was that perhaps Java is now rather behind C# with ...
15
votes
3answers
917 views
Does the state Pattern violate Liskov Substitution Principle?
This image is taken from Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
This is the class diagram for the State Pattern where a SalesOrder can have different states during ...
14
votes
10answers
7k views
Should we choose Java over C# for a new project? [duplicate]
We have a team of .NET developers (C#) with a range of experience from 2 to 6 years. Over the last few years we have been developing Silverlight, ASP.NET MVC, and WPF applications. However, there is a ...
14
votes
5answers
891 views
Why isn't java used as a build language?
If Java is a general purpose language, and building a program is something that can be described using the Java language, why isn't this the best way to write build files and instead we use tools like ...
13
votes
9answers
4k views
Are too many if-else statements for validation bad? [duplicate]
From the book Professional Enterprise .Net, which has 5 star rating on Amazon that I am doubting after having a read through. Here is a Borrower class (In C# but it's pretty basic; anyone can ...
13
votes
6answers
408 views
Expected behavior when an request for a collection will have zero items
Let's say you are given the following...
List<Thing> theThings = fubar.Things.All();
If there were nothing to return, what would you expect fubar.Things.All() to return?
Edit:
Thanks for the ...
13
votes
2answers
1k views
What is the best approach for inline code comments?
We are doing some refactoring to a 20 years old legacy codebase, and I'm having a discussion with my colleague about the comments format in the code (plsql, java).
There is no a default format for ...
13
votes
2answers
1k views
Which of these 3 languages is easiest to convert to Delphi? [closed]
I am intending to purchase some source code for my Delphi program. It is not too big an algorithm, but it is not available in Delphi and I'll have to translate it to Delphi.
However, I have not ...
10
votes
10answers
1k views
What's more important: To write programs fast or to write fast programs? [closed]
What's more important: To write programs fast or to write fast programs? According to: http://math.stackexchange.com/questions/17478/how-quickly-with-better-tool it is better to write fast programs, ...
10
votes
2answers
701 views
How can I use my coding skills for good?
By this autumn my two small websites should be generating around a total of $1200 a month with minimal/zero input which is enough to for me to live on comfortably enough.
Rather than embark on ...
10
votes
4answers
4k views
What is platform independence? Are cross-platform and 'platform independence' same?
What is the platform independence really mean?
What are the criterion to call a language platform independent ?
Are cross-platform and 'platform independence' same?
(This may be a question for self ...
9
votes
4answers
2k views
Learning path for web developer .NET or Java [closed]
I am interested to know how many real world web application servers are hosted by windows?
I am going to learn C# and ASP.NET and want to convert my self from an embedded developer to a web app ...
9
votes
9answers
443 views
Studies on code documentation productivity gains/losses
After much searching, I have failed to answer a basic question pertaining to an assumed known in the software development world:
WHAT IS KNOWN:
Enforcing a strict policy on adequate code ...
9
votes
6answers
690 views
Is there an infinite amount of knowledge in a programming language?
I can program in Java, C#, C, Scala, and Javascript fluently. I'm comfortable with Objective-C, but I don't remember the conventions used for memory management. I can read Python and Ruby and I've ...
9
votes
6answers
4k views
Should I learn java for mobile application development or will C# just do?
I'm looking forward to delving into the .NET framework but most mobile applications seem to be developed in Java. I'll most probably be targeting the less pricier phones like Nokia and motorolla not ...
9
votes
8answers
591 views
Past If statements Arrays, loops… Now what?
I gave up on programming a little over a year ago when I kept hitting this wall. I am revisiting the subject because I want to create basic Android application. But I feel that my limited knowledge ...
8
votes
7answers
2k views
Difference between Pattern and Principle
What is the difference between Object Oriented Design Patterns and Principles? Are they different things? As far as I understood both of them try to achieve some common goal (e,g. flexibility). So can ...
8
votes
4answers
4k views
Would scala be a good choice instead of Java?
We will be starting a new project which will involve training all the .net developers in Java (frameworks/ECO system etc). We have a lot of code written in C# and it seems that all of this will be ...
8
votes
4answers
503 views
What can and can't the Garbage Collector do?
Will the GC take care of all memory management issues (memory leaks) ?
Is there any case where you don't want the GC to take control of some part of your code ?
8
votes
5answers
886 views
“Programming error” exceptions - Is my approach sound?
I am currently trying to improve my use of exceptions, and found the important distinction between exceptions that signify programming errors (e.g. someone passed null as argument, or called a method ...
7
votes
4answers
417 views
Warn about 3rd party methods that are forbidden
Note: This question refers to code written in Java or C#.
I am managing a couple of large projects where we have discovered issues (not necessarily bugs) with some 3rd party/SDK methods and have ...
7
votes
4answers
364 views
How would a new language look if it was designed from scratch to be easy to TDD?
With the some most common languages (Java, C#, Java, etc) it sometimes seems that you are working at odds with the language when you want to fully TDD your code.
For example, in Java and C# you will ...
7
votes
5answers
11k views
Best way to load application settings
A simple way to keep the settings of a Java application is represented by a text file with ".properties" extension containing the identifier of each setting associated with a specific value (this ...
7
votes
8answers
820 views
how could I interview for a C# position if I master Java [duplicate]
Possible Duplicate:
Interviewing a developer who's skilled in a language you don't know
I must interview people for a C# position we have. I work on the java side of the project, ...