Ruby uses require, Python uses import. They're substantially different models, and while I'm more used to the require model, I can see a few places where I think I like import more. I'm curious what things people find particularly easy — or more interestingly, harder than they should be — with each of these models.
In particular, if y...
What are the performance issue of using while loop v/s foreach/for loop or vice-versa ?
Also is it always preferable to use foreach loop v/s while in php ?
...
Possible Duplicate:
What programming language should be taught in Computer Science 101?
My girlfriend hates feeling completely out of the loop when my friends and I talk about anything related to computers, so she asked me to teach her how to program. I'm pretty happy she asked, but I want to be able to teach her enough to know ...
Are there any strongly-typed programming languages for the Web? I program in PHP now, but often I wish it yelled at me when I tried to compare a number to a string. Functions in the standard library that can return either a bool or an integer don't make anything easier either.
I know there's .NET, but is it my only choice?
...
Just curious, is it possible to write a multi-platform program that is not writen in Java.
If true, could I do it by compiling two or three different programing languages (for each platform) together so that it would run on different platforms.
...
Don't have anything to add so, What languages other than Python have an explicit self?
[Edit]
Obviously all OO languages will have a this or a self for current instance. What I want to know is does any other ask you to explicitly pass this or self as all instance method arguments?
...
According to John C. Mitchell - Concepts in programming languages,
[...] Java guarantees that a
constructor is called whenever an
object is created. [...]
This is pointed as a Java peculiarity which makes it different from C++ in its behaviour. So I must argue that C++ in some cases does not call any constructor for a class ev...
Okay, so I've been doing web design for about a year or two, and I've decided that I want to learn a Programming Language, because I've figured out that's what interest me more.
I start out learning Python, got about about 1/4 of the way through Dive into Python, but then decided to go onto Ruby because in the nearer future for now I'm ...
Speed is an important part of choosing a programming language.
Apparently, C++ is(for most people) the undoubted ruler when it comes to speed.
Yet when asked with evidence to back this up, nothing can be offered.
Usual excuses include:
It's faster than Java
There are so many blogs saying it, it must be true.
It's the language I've le...
When looking at the history of C#, I found out that C# was seen as an update to C and/or C++. This came a bit as a surprise to me, as on the surface, I see much more common ideas between C# and Java (Garbage collection comes to mind). I don't write code in Java, but I have usually no problem following Java code, and routinely read books ...
Can a program be written in more than one programming language? The stuff I read on The Daily WTF seems to imply that big companies/organizations employ several different languages when building a large application. How does that work? I know from working with Django that dynamic web pages are often put together with a bunch of different...
I am a "self taught" PHP programmer. So I've never taken any Computer Science classes. I've been doing more things via the command line lately and I'd really like to automate this a little more.
The problem is, I don't even know where to start. I know PHP. I can create web applications. I know how to do stuff on the command line. But I ...
I have a program that has to declare a huge integer array of the size 1000000 in C (using GNU GCC compiler). I tried to declare the array in two different ways.
The two possible codes are :
#include <stdio.h>
int arr[1000000];
int main()
{
return 0;
}
and
#include <stdio.h>
int main()
{
int arr[1000000];
return 0;
}
The l...
Does anybody know of any research or benchmarks of how long it takes to develop the same application in a variety of languages? Really I'm looking for Java vs. C++ but any comparisons would be useful. I have the feeling there is a section in Code Complete about this but my copy is at work.
Edit:
There are a lot of interesting answers...
Amongst the programming languages I know and those I've been exposed to, C++ looks like the only one to have both pointers and references. Is it true?
...
While I love PHP I find its biggest weakness is that it allows and even almost encourages programmers to write bad code.
Is there a language that encourages good programming practices? Or, more specifically, a web-related language that encourages good practices.
I'm interested in languages who have either a stated goal of encouraging ...
Is there a general list of what different programming languages are used to solve different scenarios?
like C is also used in embedded programming,kernel programming,UI programming too(GTK).
C++ is also used for desktop/sever application programming and also business/enterprise applications which sit on the desktop/server or even the w...
I use ASM (some), C, js, lua, Python, Ruby, Perl, Objective-C, Java and a couple of shell variants on a daily basis.
I also know, or have looked into golang, C++, PHP and maybe others I forgot.
I have been coding for 15 years now, and I'm looking at something fun to learn, I don't mean something useful for business, but something inter...
speaking to a number of quants / hedgies, i came to the conclusion that a large number of them seem to be using their a homebrew or caml (for the most part). what many of them couldnt answer was why.
i can certainly understand why they wouldnt want to use c++ for the most part, but why is caml superior for these uses compared to other s...
I have a POJO that uses a service to do something:
public class PlainOldJavaObject {
private IService service;
public String publicMethod(String x) {
return doCallService(x);
}
public String doCallService(String x) {
if(service == null) {
throw new RuntimeException("Service must not be null...