What factors could determine whether Clojure, Scala or Haskell will gain traction?

On the top of my head: good IDE support (with refactoring) stable enough specifications clear policy about backward compatibility (in term of sources, binaries and behavior) frameworks and tools around the language (like code static analysis, code coverage, …) Scala, for instance, is still evolving and moving “too fast” to be “largely” used even though … Read more

Main method code entirely inside try/catch: Is it bad practice?

Wrapping any piece of code in a try/catch block without a good reason is bad practice. In the .NET programming model, exceptions should be reserved for truly exceptional cases or conditions. You should only try to catch exceptions that you can actually do something about. Furthermore, you should should hardly ever catch the base System.Exception … Read more

Which programming languages (besides Smalltalk) are image based? [closed]

Images Images are basically memory dumps. Typically a Lisp development system starts a runtime plus an image. The user then makes changes and later can write a new image. Sometimes this is a feature used by the developer, sometimes it’s also used during the development of the Lisp system itself. Many Lisp systems are using … Read more

How to write a self reproducing code (prints the source on exec)?

Aside from cheating¹ there is no difference between compiled and interpreted languages. The generic approach to quines is quite easy. First, whatever the program looks like, at some point it has to print something: print … However, what should it print? Itself. So it needs to print the “print” command: print “print …” What should … Read more

About first-,second- and third-class value

Oh no, I may have to go edit Wikipedia again. There are really only two distinctions worth making: first-class and not first-class. If Michael Scott talks about a third-class anything, I’ll be very depressed. Ok, so what is “first-class,” anyway? Well, it is a term that barely has a technical meaning. The meaning, when present, … Read more

What’s the difference between an “engine” and a “framework”? [closed]

These terms, and others, do seem very similar. They’re named from a conceptual standpoint, and so could be defined as follows: A “framework” is a “foundation” or “support structure” around which you build your actual application. The .NET Framework includes not only a foundation (the CLR) but a series of libraries that provide standardized functionality … Read more

What is the purpose of the unsigned right shift operator “>>>” in Java?

The >>> operator lets you treat int and long as 32- and 64-bit unsigned integral types, which are missing from the Java language. This is useful when you shift something that does not represent a numeric value. For example, you could represent a black and white bit map image using 32-bit ints, where each int … Read more

What is the difference between covariance and contra-variance in programming languages? [closed]

Covariance is pretty simple and best thought of from the perspective of some collection class List. We can parameterize the List class with some type parameter T. That is, our list contains elements of type T for some T. List would be covariant if S is a subtype of T iff List[S] is a subtype … Read more

Is there a programming language with built-in state machine construct?

Ragel is a state machine language. IOW, it’s not a language that also supports state machines, it’s a language that only supports state machines. Which obviously means that it’s not Turing-complete, but who needs that? More precisely, Ragel is a state machine compiler, which takes a description of a state machine in a regexp-like language … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)