A question about certain language features
- Posted by Ed Davis <ed_davis2 at yahoo.com> Feb 11, 2002
- 652 views
I've been reading the Euphoria documentation, and I have a few questions about certain features of the language. I assume that the author made certain choices because he felt that this encouraged a better way of programming. I don't want to start (or continue) an argument about this per se, but I would like to try and understand the reasoning. For instance, without debating their merit, I can understand the author leaving out the goto statement, as abuse of goto can lead to hard-to-read and hard-to-prove-correct code. Of course, the converse is possibly true too. The features I have questions about as to why there were implemented that way are: 1) Variables can not be initialized when declared, but rather, must be initialized via an assignment statement. Based on other languages, this seems like one of those convenience type issues. Is there some programming philosophy that says that an initialization in a declaration is a 'bad thing'? What is the 'bad thing'? I also note that standard Pascal does not allow variables to be initialized when they are declared. 2) No support of call by reference. I understand that call by reference can lead to unexpected side-effects, but since changing global variables in a subroutine seems to essentially cause the same problem, I don't understand this omission. 3) No support for local constants. Again, I'm not trying to start a debate, I'm just trying to understand why these features/omissions are desirable. Thanks for any information!