3 ms·
In a funny twist of history, Kernighan is now writing a book on a language where the length of an array is part of its type: http://play.golang.org/p/jrbSgKFZ_1
by gnuvince 12y ago
In a funny twist of history, Kernighan is now writing a book on a language where the length of an array is part of its type: http://play.golang.org/p/jrbSgKFZ_1 http://play.golang.org/p/jrbSgKFZ_1
- nemo1618 12y agoTechnically true, but the point is that arrays were the only collection type in Pascal, whereas Go also has slices (which, in my experience, outnumber arrays 10-1 in most codebases).
- gnuvince 12y agoWhen did Pascal gain dynamic arrays?
- pjmlp 12y agoDepends which Pascal you mean. The Extended Pascal ISO standard which does include dynamic arrays is from 1990. Turbo Pascal and other Pascal dialects also had them.
- pjmlp 12y agoNot true, otherwise Wirth would have had an hard time to write "Algorithms and Data Structures".
- manacit 12y agoTo be fair, slices solve that problem completely: http://play.golang.org/p/56KlgWsxjR http://play.golang.org/p/56KlgWsxjR