Relative Content

Tag Archive for data-types

Why does Java not do type inference?

I have always wondered why Java does not do type inference given that the language is what it is, and its VM is very mature. Google’s Go is an example of a language with excellent type inference and it reduces the amount of typing one has to do. Is there any special reason behind this feature not being a part of Java?

Should I put the datatype of a class attribute in its name?

Most of my system’s class attributes are just text, but in this case it makes more sense to place this particular class’s attributes into one single hash (from a “keep the source code pretty” aspect). Basically, a list of attributes is returned, and instead of writing a bunch of static attributes for each one, I just loop over them and collect them into a hash.

What are and how do (data-) types work?

What is a “variable”/data type? How does a compiler / interpreter handle types? My specific concern has to do with the different types in lower and higher level languages. For instance in Python, as list is really flexible. You can just define it and put in at runtime whatever you want. ints floats strings sets […]