All Questions
53 questions
11votes
8answers
2kviews
What stops C from being compiled/interpreted/JIT'ed?
Java is often praised for its amazing portability, which I presume is because of the JVM. My question is what stops C from being being compiled/interpreted/JIT'ed.., if so, C can also be write once ...
6votes
2answers
649views
When the stack frames become computationally expensive
I've been experimenting with different data structures and algorithms in Python, Java and C to see in what circumstances function/method inlining could bring meaningful gains in terms of the execution ...
2votes
3answers
525views
IOC container & accessing Implementation from the container
Background As mentioned in this article, Inversion of Control can be achieved through various mechanisms such as: Strategy design pattern, Service Locator pattern(SLP), Factory pattern, and ...
18votes
5answers
8kviews
Undefined behaviour in Java
I was reading this question on SO which discusses some common undefined behavior in C++, and I wondered: does Java also have undefined behaviour? If that is the case, then what are some common causes ...
-2votes
1answer
124views
What should I use to graphically represent an object's position on a fixed path using python(preferred)?
Consider 2 roads merging into one(This map is supposed to remain fixed). The program will not generate this map. The program will read this map and plot positions on it on its own. The python program ...
0votes
2answers
2kviews
Why are some languages called platform dependent if I can always share the source code?
I was reading about erlang when I read that it is platform-independent, using BEAM as the VM, now I understand that a VM compiles the byte code to machine code and this makes that language machine-...
43votes
3answers
17kviews
Why is the logical NOT operator in C-style languages "!" and not "~~"?
For binary operators we have both bitwise and logical operators: & bitwise AND | bitwise OR && logical AND || logical OR NOT (a unary operator) behaves differently though. There is ~ for ...
27votes
6answers
27kviews
How to solve the problem of nested comments
It appears in not just one language that comments can't be nested. Do you have a good solution for this problem? One workaround in C/C++ and Java is to only use the single-line comment but it becomes ...
2votes
1answer
2kviews
Why did Java and C sharply dip in popularity around 2017 in the TIOBE index? [closed]
The TIOBE Programming Community Index shows Java and C dramatically falling in popularity between late 2016 and mid 2017 before rebounding by mid 2018. What is the cause of the volatility? Source: www....
92votes
16answers
21kviews
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 ...
30votes
9answers
25kviews
Why was Scala not implemented with C or C++
Does anybody know why was Scala implemented in Java and .NET instead of C or C++? Most languages are implemented with Cor C++ [i.e Erlang, Python, PHP, Ruby, Perl]. What are the advantages for Scala ...
-2votes
1answer
349views
Problem on recursion
void function(int x){ if(x<=0) return; function(x--); } This is a recursion function which is called with the value of x = 20. The Recursive call will take place in this way ...
7votes
1answer
11kviews
Difference between header files and interfaces
I wanted to know whether the header files in c and c++ have same function as that of interfaces used in Java? If not what is the difference between header file and interface?
6votes
10answers
4kviews
Is segfault always the programmer's mistake?
Is a segfault (array index out of bounds) always the programmer's mistake or could it be misuse from the user?
4votes
3answers
2kviews
How useful is JNI in android?
In java/android we can call code written in the c/c++ language for execution speed advantage. I have heard of Ahead Of Time compilation which (as far as i know) compiles the entire application to ...