it depends on exactly what you mean by buffer overflow.
unless he was accessing that string through a pointer or something similar then i don't think the standard operators would LET the string grow beyond its maximum length
on the other hand in C you can run off the end of the buffer with no checking whatsoever and start overwriting stuff beyond it. It is this that leads to buffer overflow exploits.
as one of the submitters of the article i'd just like to say this discussion has been a pleasire. Its been very nice to have a chance to discuss pascal with a community as vibrant as the slashdot community and there was surprisingly little trolling.
i really expected to see "netcraft confirms it pascal is dieing" as the subject of at least one post mind you;).
lets see 1: some people read but didn't post or posted as AC for a long time before getting an account (i know i did) 2: low user ids can be purchesed on ebay 3: some people may get an account and then forget about it for ages before using it again
Pascal had many limitiations, however, many production versions of the language had useful but nonstandard work arounds. of which borlands have become the de-facto standard;)
there are essentially 3 ways to get oxegen in space.
1: CO2 or water (ie what the astronaughts breethe out). Nice idea but expensive in terms of energy and complexity.
2: Send up liquid oxegen from earth. Ok but its difficult to store and handle safely.
3: oxygen candles which make oxegen by chemical reactions. Expensive in terms of materials here on earth but almost certainly easier to handle than liquid oxegen especially as a reserve supply.
if you can get at the lilo boot prompt you can also pass init=/bin/bash to the kernel which will dump you at a bash shell (as root) with nothing else running from which you can make your edits.
afaict strength of C generally reffers to the ability to get down and dirty where needed. (ie pointer aritmetic possiblly asm,cast between any two types of the same size etc.
it usually also includes native code compilation.
the term is usually used contrast to crippled languages (vb, arguablly most bytecode languages) bytecode languages (.net java etc) and scripting languages (perl python etc)
most borland style pascal variants allow for this.
delphi style object pascal has refcounted strings which basically let you treat strings like a primitive.
It also has a concept of component owners which can save the need to manually free a lot of stuff in many cases.
i can see how GC is easy to become addicted too but with some reasonable design care you don't really need it and it has issues of its own (like suddenly everything stopping because the GC wants to run)
well i should have been a little more precise. Range checking and array bounds checking are actually seperate options. This thread was about array bounds checking but i said range checking by mistake.
range checking is a pita when trying to write emulation code or similar but otherwise shouldn't be too much of a big deal.
as for array bounds checking, If i'm dealing with a fixed size array its not a huge amount of use anyway and if dealing with heap memory it just won't work since you basically have to give your array type a dummy size which will either always trigger bounds checking or never will.
newer versions of the language have dynamic arrays but i don't tend to use theese as i want my code to compile with delphi 3 (i'd use delphi 2 if i could find my delphi 2 developer cd) to produce small binaries;).
Delphi's indent size seems to be random sounds like you've had a run-in with the smart tabs feature without understanding how its supposed to work.
basically you indent/whatever the first line by hand using the spacebar and then use the tab key on subsequent lines and it lines it up with what you did in the first line.
there is an option to turn this feature off though i dunno if your collage's setup will let you change it. (it sounds like it won't).
the reason for the unusual taskbar menu is that the taskbar button in delphi was made independent of any particular form it just exists as an app global entity (and has its own window handle etc).
afaict the reason why they did it this way was for the delphi IDE itself. try loading the delphi 1 ide on a version of windows with a win95 like shell and you will get a flood of taskbar buttons. The one taskbar button approach worked better for thier ide and presumabbly for other apps that used forms in a similar way.
you don't need makefiles for normal pascal apps due to the units system but you sure as hell do need them to build something as complex as the rtl with the correct options etc.
it depends on exactly what you mean by buffer overflow.
unless he was accessing that string through a pointer or something similar then i don't think the standard operators would LET the string grow beyond its maximum length
on the other hand in C you can run off the end of the buffer with no checking whatsoever and start overwriting stuff beyond it. It is this that leads to buffer overflow exploits.
as one of the submitters of the article i'd just like to say this discussion has been a pleasire. Its been very nice to have a chance to discuss pascal with a community as vibrant as the slashdot community and there was surprisingly little trolling.
;).
i really expected to see "netcraft confirms it pascal is dieing" as the subject of at least one post mind you
lets see
1: some people read but didn't post or posted as AC for a long time before getting an account (i know i did)
2: low user ids can be purchesed on ebay
3: some people may get an account and then forget about it for ages before using it again
etc
out of interest how much did you pay for the T1 and what were the details of the setup? (ie full or fractional pure data or voice and data etc)
I think he was reffering more to horses on the roads....
horses may live in fields but when being used for transport they ususally used the roads which have now been taken over by cars.
finally if you wan't/need to drive accross fields you can buy a land rover or a jeep or similar.
i'm sure you could run xvnc on the mac and make an X display that was totally independent of the mac desktop without too much trouble
i imagine it would be considerablly harder to do the same for a mac type desktop though.
right......
one thing gives away totally that he either doesn't have a clue or is trying to be funny.
he advocates self modifying code. This is basically impossible on some modern processors and extremely slow on others.
Pascal had many limitiations, however, many production versions of the language had useful but nonstandard work arounds. ;)
of which borlands have become the de-facto standard
whilst i haven't used modula-2 myself it apparently shares quite a bit in common with the borland dialects of pascal.
borland pretty much monopolised the pascal compiler market and so thier dialect is what others (freepascal TMT pascal etc) cloned.
mmm apparently it supports freepascal too
guess its win32 only though
there are essentially 3 ways to get oxegen in space.
1: CO2 or water (ie what the astronaughts breethe out). Nice idea but expensive in terms of energy and complexity.
2: Send up liquid oxegen from earth. Ok but its difficult to store and handle safely.
3: oxygen candles which make oxegen by chemical reactions. Expensive in terms of materials here on earth but almost certainly easier to handle than liquid oxegen especially as a reserve supply.
i'm pretty damn sure that delphi will let you use begin for unit initialization code
nice story but its not true
p
http://www.snopes.com/business/genius/spacepen.as
yeah the gba cart bus is horriblly crippled by the fact that it had to work over a connector with the same pin count as a standard gameboy cartridge.
if you can get at the lilo boot prompt you can also pass init=/bin/bash to the kernel which will dump you at a bash shell (as root) with nothing else running from which you can make your edits.
afaict strength of C generally reffers to the ability to get down and dirty where needed. (ie pointer aritmetic possiblly asm,cast between any two types of the same size etc.
it usually also includes native code compilation.
the term is usually used contrast to crippled languages (vb, arguablly most bytecode languages) bytecode languages (.net java etc) and scripting languages (perl python etc)
most borland style pascal variants allow for this.
you can put large datastructures in your code easilly enough in borland style pascal.
b ewareserv/bewareserv/channelcommands.pas?rev=1.17
for example look at the code in http://cvs.sourceforge.net/viewcvs.py/*checkout*/
delphi style object pascal has refcounted strings which basically let you treat strings like a primitive.
It also has a concept of component owners which can save the need to manually free a lot of stuff in many cases.
i can see how GC is easy to become addicted too but with some reasonable design care you don't really need it and it has issues of its own (like suddenly everything stopping because the GC wants to run)
isn't kylix kind of dead in the water and hard to make run on recent distros?
well i should have been a little more precise. Range checking and array bounds checking are actually seperate options. This thread was about array bounds checking but i said range checking by mistake.
;).
range checking is a pita when trying to write emulation code or similar but otherwise shouldn't be too much of a big deal.
as for array bounds checking, If i'm dealing with a fixed size array its not a huge amount of use anyway and if dealing with heap memory it just won't work since you basically have to give your array type a dummy size which will either always trigger bounds checking or never will.
newer versions of the language have dynamic arrays but i don't tend to use theese as i want my code to compile with delphi 3 (i'd use delphi 2 if i could find my delphi 2 developer cd) to produce small binaries
Delphi's indent size seems to be random
sounds like you've had a run-in with the smart tabs feature without understanding how its supposed to work.
basically you indent/whatever the first line by hand using the spacebar and then use the tab key on subsequent lines and it lines it up with what you did in the first line.
there is an option to turn this feature off though i dunno if your collage's setup will let you change it. (it sounds like it won't).
the reason for the unusual taskbar menu is that the taskbar button in delphi was made independent of any particular form it just exists as an app global entity (and has its own window handle etc).
afaict the reason why they did it this way was for the delphi IDE itself. try loading the delphi 1 ide on a version of windows with a win95 like shell and you will get a flood of taskbar buttons. The one taskbar button approach worked better for thier ide and presumabbly for other apps that used forms in a similar way.
you don't need makefiles for normal pascal apps due to the units system but you sure as hell do need them to build something as complex as the rtl with the correct options etc.
freepascal is far slower on win32 than on *nix. iirc this is mainly due to the mingw linker it uses.
and ofc if you want to store integers just cast them to the relevent type so the structure will store them directly ;)