[Info-vax] OpenVMS system programming language

Lawrence D'Oliveiro ldo at nz.invalid
Mon Feb 24 21:22:06 EST 2025


On Mon, 24 Feb 2025 20:33:07 -0500, Arne Vajhøj wrote:

> But I think it is good code.

I think it is bloody long-winded code.

In C++ I could write things like

    typedef std::map<std::string /*section*/, SectionParams>
        SectionTable;
    typedef std::pair<std::string, SectionParams>
        SectionTablePair;
    typedef SectionTable::const_iterator
        SectionTableLister;

but Java doesn’t give you the option.

And then there’s the long-windedness of code like

    static final java.util.Map<Integer, String> TypeNames;
      /* mapping from sensor type codes to symbolic names */
    static
      {
        TypeNames = new java.util.HashMap<Integer, String>();
        TypeNames.put(Sensor.TYPE_ACCELEROMETER, "accelerometer");
        TypeNames.put(Sensor.TYPE_AMBIENT_TEMPERATURE, "ambient temperature");
        TypeNames.put(Sensor.TYPE_GRAVITY, "gravity");
        TypeNames.put(Sensor.TYPE_GYROSCOPE, "gyroscope");
        TypeNames.put(Sensor.TYPE_LIGHT, "light");
        TypeNames.put(Sensor.TYPE_LINEAR_ACCELERATION, "linear accel");
        TypeNames.put(Sensor.TYPE_MAGNETIC_FIELD, "magnetic");
        TypeNames.put(Sensor.TYPE_ORIENTATION, "orientation");
        TypeNames.put(Sensor.TYPE_PRESSURE, "pressure");
        TypeNames.put(Sensor.TYPE_PROXIMITY, "proximity");
        TypeNames.put(Sensor.TYPE_RELATIVE_HUMIDITY, "relative humidity");
        TypeNames.put(Sensor.TYPE_ROTATION_VECTOR, "rotation");
        TypeNames.put(Sensor.TYPE_TEMPERATURE, "temperature");
      } /*static*/

because the language doesn’t provide expressions that evaluate to
common structure types like dictionaries/maps.



More information about the Info-vax mailing list