[fpc-pascal] Question about interfaces

Jonas Raoni Soares Silva jonasraoni at gmail.com
Sat Mar 19 15:09:03 CET 2005


On Sat, 19 Mar 2005 09:26:18 +0100, Jonas Maebe <jonas at zeus.ugent.be> wrote:
> Until someone else has to read your code, who attached entirely
> different meanings to those symbols in his own code...

I agree, pascal is one of the most clean, intuitive and easy to read
languages... While updating it, the developers must keep its
simplicity, or it wont be pascal anymore... Add new ideas and usable
development patterns, but don't change the language concept ;]

I like both strange codes and the pascal way, in my opinion pascal
should even be used instead of C on companies, since it's easier to
mantain...

If you transform pascal into a c-like language, soon you'll have codes
like this one that I've made in javascript, i like it, but it's a kind
of write-only code... The language itself should obligate or at least
help the programmer on making the right things, free-hands can make
unuseful things...

	getBits = function( rawData, start, length ){
		if( start < 0 || length <= 0 || start + length >  8 * rawData.length )
			throw 'getBits::bits out of range';
		for( var offsetLeft, offsetRight = start % 8, curByte =
rawData.length - ( start >> 3 ) - 1, lastByte = rawData.length - -( -(
start + length ) >> 3 ), diff = curByte - lastByte, sum = ( ( rawData[
curByte ] >> offsetRight ) & ( ( 1 << ( diff ? 8 - offsetRight :
length ) ) - 1 ) ) + ( diff && ( offsetLeft = ( start + length ) % 8 )
? ( rawData[ lastByte++ ] & ( ( 1 << offsetLeft ) - 1 ) ) << ( diff--
<< 3 ) - offsetRight : 0 ); diff; sum += rawData[ lastByte++ ] << (
diff-- << 3 ) - offsetRight );
		return sum;
	}


-- 
"Invente, Tente!!! Faça um código eficiente" (Jonas Raoni)

Jonas Raoni Soares Silva
---------------------------
Desenvolvedor de aplicações
jonasraoni at gmail dot com
http://www.joninhas.ath.cx:666




More information about the fpc-pascal mailing list