programming-languages

What are the advantages and disadvantages of the require vs. import methods of loading code?

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...

Are there performance issue of using while loop vs foreach/for loop?

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 ? ...

So my girlfriend wants to learn to program

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 ...

Strongly-typed languages for web programming

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? ...

Is it possible to write multi-platform program that is not writen in Java

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. ...

What languages other than Python have an explicit self?

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? ...

C++ vs Java constructors

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...

How long should you focus on a programming language?

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 of programming languages then and now.

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...

How is C# inspired by C++ more than by Java?

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 ...

Writing a program in 2 languages?

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...

What language should I learn to create command line scripts and GUIs?

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 ...

Static allocation of huge amounts of memory inside the main function

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...

Development time in various languages

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...

Is C++ the single language that have both pointers and references?

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? ...

Is there a language that encourages good coding practices?

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 ...

Appropriate programming languages for different problems

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...

What language to learn as per curiosity?

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...

hedge funds / financial services: caml. why?

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...

Using Groovy MetaClass to overwrite Methods

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...