language-features

Where can I find the Java features list

This may be super easy to solve but I can't find the correct "google search term" and I've got tons of pages and none with the answer I'm looking for. Does anyone knows or has a list of the available features of java as a language? For instance. Define classes: class Employee { } Define attributes private String name; Methods...

What features is lisp lacking?

I have read that most languages are becoming more and more like lisp, adopting features that lisp has had for a long time. I was wondering, what are the features, old or new, that lisp does not have? By lisp I mean the most common dialects like Common Lisp and Scheme. ...

With anonymous function in C# 4.0 why can't I define a delegate inline

What are the pro cons with having delegates having a reserved definition type. For example in c if I want to define a function that takes a pointer to a function I can simply define void F(bool (*pFn)(int)); In c# I have to take the extra step of first defining the delegate type similar if I had to create a typedef in c before I cou...

The written versions of the logical operators.

This is the only place I've ever seen and, or and not listed as actual operators in C++. When I wrote up a test program in NetBeans, I got the red underlining as if there was a syntax error and figured the website was wrong, but it is NetBeans which is wrong because it compiled and ran as expected. I can see ! being favored over not but...

Most useful or interesting new language features in Java 5 and 6?

I was looking through a code tutorial just now, and found something interesting -- the import static feature introduced in JDK 5: import static org.junit.Assert.assertEquals; public class AdditionTest { private int x = 1; private int y = 1; @Test public void addition() { int z = x + y; assertEquals(2, z); /* ^ this ...

What is the difference between "new Number(...)" and "Number(...)" in JavaScript?

In Javascript, one of the reliable ways to convert a string to a number is the Number constructor: var x = Number('09'); // 9, because it defaults to decimal Inspired by this question, I started wondering what is the difference between the above and: var x =new Number('09'); Number certainly looks better, but it seems like a sligh...

Can we get a canthrow statement in C# ?

As a good programmer and code reviewer, I am always cringing when I see a developer catch "Exception". I was going to suggest C# add the "throws" clause from Java, but after reading the Anders Hejlsberg interview (http://www.artima.com/intv/handcuffs.html) I see why it is not there. Instead, I would like to suggest the canthrow statemen...

How would one go about adding (minor) syntactic sugars to Java?

Suppose I want to add minor syntactic sugars to Java. Just little things like adding regex pattern literals, or perhaps base-2 literals, or multiline strings, etc. Nothing major grammatically (at least for now). How would one go about doing this? Do I need to extend the bytecode compiler? (Is that possible?) Can I write Eclipse plugin...

What's the next big thing after LINQ?

I started using LINQ (Language Integrated Query) when it was still in beta, more specifically Microsoft .NET LINQ Preview (May 2006). Almost 4 years have passed and here we are using LINQ in a lot of projects for the most diverse tasks. I even wrote my final college project based on LINQ. You see how I like it. LINQ and more recently P...

What programming language to choose

We need to write a script that needs to process movies (using C-based ffmpeg) and also update our databases. Also there would be some thread programming to accomplish with a worker-manager design. I am thinking of writing this in Ruby is there any good language to do this, if so what is its primary advantage for choosing? We are based o...

Nested class with hidden constructor impossible in c#?

I' ve been doing some programming lately and faced an issue which i found weird in c#. (at least for me) public class Foo { //whatever public class FooSpecificCollection : IList<Bar> { //implementation details } public FooSpecificCollection GetFoosStuff() { //return the collection } } I wa...

Protected Enum Not Possible In C#

I just want to understand why I cannot create a protected enum on C#? The compiler refuses to accept that Does anyone know why that may be? ...

What Java syntax elements would not directly translate to an equivalent Ruby syntax?

I asked a question a few days ago about representing public static final and private static final fields in equivalent Ruby code. It got me thinking about what other syntax elements in Java might not translate directly to Ruby. Generics and Annotations come to mind. Anything else that would not translate well if you tried to port some Ja...

Extensions methods and forward compatibilty of source code.

Hi, I would like solve the problem (now hypothetical but propably real in future) of using extension methods and maginification of class interface in future development. Example: /* the code written in 17. March 2010 */ public class MySpecialList : IList<MySpecialClass> { // ... implementation } // ... somewhere elsewhere ... MySp...

In which situation is the c++/c# namespace approach better than the Java approach?

The reason I ask this is that c# could easily have copied the java convention, or a variation of it, but opted for the more flexible approach of explicitly declaring namespaces inside files. As a Java programmer often there are things that I wish I could do differently, but namespaces is not one of them. The flexbility has a certain ove...

Looking for Programming Language that allows you to change true and false.

For my curiosity sake I'm looking for a dynamic object oriented language that allows you to change true to false and vice versa. Something like this: true = false, false = true; This should also affect any conditional statements, therefore 42 == 42 should return False. Basically, with this premise, nothing in the language would be sa...

Is it inefficient to access a python class member container in a loop statement?

I'm trying to adopt some best practices to keep my python code efficient. I've heard that accessing a member variable inside of a loop can incur a dictionary lookup for every iteration of the loop, so I cache these in local variables to use inside the loop. My question is about the loop statement itself... if I have the following class:...

Why is there no string interpolation in Scala?

This is not just an idle quip... I wonder if anybody knows if there's an actual design reason why Scala does not support interpolation similar to Groovy and other "syntactically better Javas"? e.g. var str1 = "World"; var str2 = "Hello, ${str1}"; ...

Design a GUI browser to view a tree

I have a large tree. I want to be able to visualize it using a GUI tool. I want the ability to pan and zoom the tree image so that i can focus on part of the tree. Is there an existing tool to achieve this? If not i would like to write a small tool for myself to be able to do this. what is the simplest way of doing this? what computer ...

java partial classes

Hello colleagues, Small preamble. I was good java developer on 1.4 jdk. After it I have switched to another platforms, but here I come with problem so question is strongly about jdk 1.6 (or higher :) ). I have 3 coupled class, the nature of coupling concerned with native methods. Bellow is example of this 3 class public interface A { ...