I’ve mentioned before in comp.lang.modula2, Oberon hasn’t a specific set of object-oriented techniques burnt into the language. Instead of this, Oberon provides you with all necessary features (namely type extension, type tests, procedure types and hidden record components) to adapt any interesting OO-technique. Surprisingly enough, the Oberon techniques in practise are much more powerful than common OO-models and OO-languages. As an example: C++ provides so many unnecessary features and so much more complex than Oberon but doesn’t provide type tests up to now.

https://groups.google.com/forum/#!topic/comp.lang.oberon/8Bmb20Ds8Cg

#Oberon #oop #c #c++ #1993 #type-extention #type-tests #procedure-types #libc #usenet

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

Consider C's hello.c, usually given as:

#include 
main() {
printf("Hello, world\n");
}

Very simple and clean, but why use printf if you aren't doing any % formats?

#include 
main() {
fputs("Hello, world\n", stdout);
}

But, wait, since we want the \n anyway, why use fputs?

#include 
main() {
puts("Hello, world.");
}

But, wait, why drag in stdio and make our binary bigger?

#define greeting "Hello, world.\n"
main() {
write(1, greeting, (sizeof greeting));
}

But, wait, what about 16-bit chars?

#define greeting "Hello, world.\n"
main() {
write(1, greeting, sizeof(char)*(sizeof greeting));
}

But, wait, what about setlocale()?

https://groups.google.com/forum/#!topic/comp.lang.oberon/8Bmb20Ds8Cg

#programming #usenet #1993 #oberon #c #libc #ulms-oberon-compiler #programming-languages #hello-world #write #printf #setlocale

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

The #libc is certainly not a good guide:

  • Buffer overruns are not ruled out by design: gets, sscanf etc.
  • Interface inconsistencies: gets vs fgets, fgets vs fscanf (note the position of the file stream parameter)
  • Bad interfaces like that of getchar() whose return code can be a character or an error code
  • Particularly bad buffering system which – ignores the block structure of underlying file systems, and – does not support bidirectional buffering
  • No provisions exist such that independent libraries can cooperate with each other in – signal handling, – setting up alarms, and – tracking childs.

(Please note that I do not want to bash Ritchie, Kernighan etc. The libc is #history and should be taken as such… It is time to abandon #C and the libc and it does not help to place other systems on top of this historic relic.) #programming-languages http://groups.google.am/group/comp.lang.oberon/browse_thread/thread/ffe11b45037375e0/e8b65d37114d4931?hl=hy&ie=UTF-8&oe=utf-8&q=andreas+borchert+c+interfaces#e8b65d37114d4931

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)