|
Or SQRT ( 4 ) returns { 2 , -2 }
|
|
|
|
|
Can't wait to make recursive calls on this one:
SQRT(SQRT(SQRT(SQRT(4)))) = { ... };
|
|
|
|
|
That function will probably just use the first return. You normally have a special way of dealing with multiple return values.
Example (Scheme):
(define (mv) (values 1 2))
(call-with-values mv +) => 3
xacc.ideIronScheme a R5RS/R6RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
Xiangyang Liu wrote: it will return { True, False, NotSure, WhateverAnswerYouWant }
No, not an enumerated value, actually two or more values; like MatLab
(x,y) = getXandYvalues();
A good language allows a programmer to *quickly* convert the ideas in their mind to simple, easy to understand language constructs (lines of code), while enforcing enough "discipline" to keep the programmer out of trouble. Yes, a programmer can always go declare a struct or class to return multiple values, but I have found over the years that this is a real roadblock to creative thinking. I have to stop what I'm doing, go find a good place in the code to declare the new struct (give it the proper scope), think of a good descriptive name for it (and make sure it doesn't clash), worry about "what happens if someone uses this for...", i.e. I have to start building constructors and destructors, etc. All in all, by the time I'm finished with the struct to return more than one value, I've forgotten why I wanted it in the first place!
To paraphrase an old adage; I just wanted to know what time it was, but the language forced me to build a watch!
David
---------
Empirical studies indicate that 20% of the people drink 80% of the beer. With C++ developers, the rule is that 80% of the developers understand at most 20% of the language. It is not the same 20% for different people, so don't count on them to understand each other's code.
http://yosefk.com/c++fqa/picture.html#fqa-6.6
---------
|
|
|
|
|
Xiangyang Liu wrote: IsUserLoggedOn which returns True or False
Or
{ True , ::LoginTime:: , ::Workstation:: , ::SnackPreference:: , ::CoffeeIsGettingLow , ::PleaseSendMasseuse:: , 42 }
|
|
|
|
|
I personally would also like to have a good IDE too to support such a language.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
modified on Tuesday, December 18, 2007 4:32:43 AM
|
|
|
|
|
Nibu babu thomas wrote: good IDE too to support such a language
Not necessarily. As a matter of fact, sometimes IDE makes people lazy to think out of the box. At least with respect to the career arena of Chennai, if you pick up a handful of them and ask a few questions like the following:
1) How to refer a Web Service in C# application?
You may end up getting weird responses like 'Right Click -> Add Web Reference' instead of 'using WSDL.exe'.
Nevertheless IDE makes a rapid development effort cutting short of the time required for the development but I would say at least for beginners, there should be a restriction on IDE and more emphasis on use of the various tools that ship with the framework etc. What do you say?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Vasudevan Deepak K wrote: What do you say?
For beginners this could be an option, but when advanced development comes in we need to have an IDE.
Well I started learning .Net by typing code in a notepad but that was just for adding two numbers, displaying prime numbers(just for getting a hold of things) and then moved on to VS, so yes it helps to know how things work behind the scenes.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Nibu babu thomas wrote: advanced development comes in we need to have an IDE.
Could you explain more please? I know some pretty serious developer who use nothing but vi and the command-line.
regards,
Paul Watson
Ireland & South Africa
Andy Brummer wrote: Watson's law:
As an online discussion of cars grows longer, the probability of a comparison involving the Bugatti Veyron approaches one.
|
|
|
|
|
Paul Watson wrote: Could you explain more please? I know some pretty serious developer who use nothing but vi and the command-line.
Well advanced development means the scale of the project, for small scale projects it's ok maybe not to have an IDE.
VS is a quite helpful to me in the sense that it provides some real nice features which supports development in VC++. For eg: resource editor, source browsing, project dependencies, intellisense, some shortcuts for indentation, matching braces, debugging etc.
As you said there are side effects too if asked to work in a project without intellisense I will take some time to get used to it, though I try not to use it too much but time is a problem.
But the bottomline is that these are tools to help us in development and to save time.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Fair enough but I think "need to have an IDE" is too strong a phrase. Nobody needs an IDE. It is a helpful tool at times but no project and no programmer should be dependent on one.
I still do know programmers who work on large projects with just vi and a command line. They have command line tools that allow them to work very quickly.
I am not at their level but I work on reasonably sized projects using a text-editor and the command line. I find IDE UIs to be slow, buggy and often distracting. Using the command line tools provided by the framework and the OS is proving to be sufficient. A few terminal windows open and you have all the multi-tasking tools you need.
(Just to reiterate: I used VS for a good many years and went through the "IDEs rock!" phase too. I've swung the other way now and will probably swing back a bit into a mid-stream position in a few years. They are useful tools but not absolutely required.)
regards,
Paul Watson
Ireland & South Africa
Andy Brummer wrote: Watson's law:
As an online discussion of cars grows longer, the probability of a comparison involving the Bugatti Veyron approaches one.
|
|
|
|
|
Paul Watson wrote: Fair enough but I think "need to have an IDE" is too strong a phrase. Nobody needs an IDE. It is a helpful tool at times but no project and no programmer should be dependent on one.
Well the reason being that I am quite addicted to VS(currently using VC6). I personally also like that all required files be open in one parent window and I can move between these windows easily. Also some pretty nifty features like last opened files, projects, macros which saves time and helps too.
I agree to what you said that everybody doesn't need to have an IDE for development(quite a blanket statement from my part).
I remember writing programs in vi and then going back to command line to compile, link, debug. I was not comfortable, but got used to it, but quickly moved back to VS.
But don't agree to IDE UI's being slow, VC6 UI is fast enough for me. I've got about 44 sub projects, at a time about 15 to 20 sub windows open, and it works well for me.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Nibu babu thomas wrote: I personally also like that all required files be open in one parent window and I can move between these windows easily. Also some pretty nifty features like last opened files, projects, macros
Oh absolutely, I use TextMate which isn't an IDE but does offer those bits. I couldn't go all the way and use stripped down vi.
I found in my waning days of VS usage I used it mainly as a text editor. I avoided all the built-in framework helpers, the designers and on-the-fly checkers etc. Once I got to that point I realised a faster, cleaner text editor would do as well.
regards,
Paul Watson
Ireland & South Africa
Andy Brummer wrote: Watson's law:
As an online discussion of cars grows longer, the probability of a comparison involving the Bugatti Veyron approaches one.
|
|
|
|
|
Nibu babu thomas wrote: I personally would also like to have a good IDE too to support such a language.
Ever since moving away from .NET and Visual Studio to Ruby and a text-editor I have come to realise the evils of IDEs.
You become so dependant on the IDE. It is a useful tool to have around but it is good to be able to code, compile, deploy, debug etc. without one.
regards,
Paul Watson
Ireland & South Africa
Andy Brummer wrote: Watson's law:
As an online discussion of cars grows longer, the probability of a comparison involving the Bugatti Veyron approaches one.
|
|
|
|
|
Paul Watson wrote: It is a useful tool to have around but it is good to be able to code, compile, deploy, debug etc. without one.
Without doubt. This is a definitive requirement at least when the product is going for release and we can not expect Visual Studio in client systems.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
1. Full continuations (not just outward like Exceptions).
2. Proper lexical scoping (amazing how many languages cannot do this, including C#).
3. Proper tail recursion.
4. Syntactic abstraction.
Of course, Scheme offers all of these
xacc.ideIronScheme a R5RS/R6RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
You sick, twisted, LISP ing perverts and your parentheses.
Software Zen: delete this;
|
|
|
|
|
From the R6RS, Appendix E.
- Matched square brackets can be used synonymously
with parentheses.
xacc.ideIronScheme a R5RS/R6RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
leppie wrote: 2. Proper lexical scoping (amazing how many languages cannot do this, including C#).
It doesn't? Well, I guess I can agree with that. However I suspect it's not that it couldn't, but that "they" decided to compromise.
|
|
|
|
|
And it leads to stuff like this:
<font color="Teal">Func</font><font color="DarkBlue"><</font><font color="Blue">int</font><font color="DarkBlue">,</font> <font color="Blue">bool</font><font color="DarkBlue">></font> odd <font color="DarkBlue">=</font> x <font color="DarkBlue">=></font>
<font color="DarkBlue">{</font>
<font color="Teal">Func</font><font color="DarkBlue"><</font><font color="Blue">int</font><font color="DarkBlue">,</font> <font color="Blue">bool</font><font color="DarkBlue">></font> oddi <font color="DarkBlue">=</font> <font color="Blue">null</font><font color="DarkBlue">;</font>
<font color="Teal">Func</font><font color="DarkBlue"><</font><font color="Blue">int</font><font color="DarkBlue">,</font> <font color="Blue">bool</font><font color="DarkBlue">></font> eveni <font color="DarkBlue">=</font> y <font color="DarkBlue">=></font> y <font color="DarkBlue">==</font> <font color="Red">0</font> <font color="DarkBlue">?</font> <font color="Blue">true</font> <font color="DarkBlue">:</font> oddi<font color="DarkBlue">(</font>y <font color="DarkBlue">-</font> <font color="Red">1</font><font color="DarkBlue">)</font><font color="DarkBlue">;</font>
oddi <font color="DarkBlue">=</font> y <font color="DarkBlue">=></font> y <font color="DarkBlue">==</font> <font color="Red">0</font> <font color="DarkBlue">?</font> <font color="Blue">false</font> <font color="DarkBlue">:</font> eveni<font color="DarkBlue">(</font>y <font color="DarkBlue">-</font> <font color="Red">1</font><font color="DarkBlue">)</font><font color="DarkBlue">;</font>
<font color="Blue">return</font> oddi<font color="DarkBlue">(</font>x<font color="DarkBlue">)</font><font color="DarkBlue">;</font>
<font color="DarkBlue">}</font><font color="DarkBlue">;</font>
<font color="Teal">Console</font><font color="DarkBlue">.</font>WriteLine<font color="DarkBlue">(</font>odd<font color="DarkBlue">(</font><font color="Red">10</font><font color="DarkBlue">)</font><font color="DarkBlue">)</font><font color="DarkBlue">;</font>
xacc.ideIronScheme a R5RS/R6RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
Automatic memory management is nice, but I think it's important that a language provide help in managing other resources as well.
Nathan
|
|
|
|
|
Nathan Holt at EMOM wrote: Automatic memory management is nice, but I think it's important that a language provide help in managing other resources as well.
Hear, hear!
|
|
|
|
|
Not survey items, but two things none the less:
I am unable to find the vote page. My usual link (that used to work) now fails:
http://www.codeproject.com/script/survey/feedback.asp
So, thing one is 'how do I get to the survey voting page?
Thing two is, at least, relevant. In this case, I'm glad I didn't get to the vote page. For a change, when given a chance to think before voting (no, I didn't vote for "W" - ever) I realized that I'd never really considered what I want in a programming language. I moved from R-M Fortran to MS QuickC because I needed graphics routines, but that's part of almost every package these days.
Primarily, it's more a crude thought: will the language do what I want to do when I want to do it? In the good old days, C gave me absolute access to everything. Now, this is no longer a 'given'. I've sold even more of my soul by embracing .NET. So many paradigms of old have faded: speed, efficiency, size of executable image have been usurped by the paradigm of eye-candy.
But the audience has changed so much - perhaps this is as it should be. I'll simply accept my fate and fade off into a forgotten past. Endlessly mulling over just what is it that causes me to prefer one language over another - and what would induce me to switch.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
|
|
|
|
|
Is "Industry acceptance as a "standard" language", considered a feature of a language?
Why?
And what this option has to do with the rest options of that survey?
All the rest seem strictly technical to me.
So, there are two views into those survey options:
A marketing view, represented by that single "acceptance" option
and a technical view represented by the rest of the options.
That is a) find a job and b) do the job (lol)
Just my thoughts
Regards
Theo
--------------------
Theo Bebekis
Thessaloniki, Greece
|
|
|
|
|
Theo Bebekis wrote: Is "Industry acceptance as a "standard" language", considered a feature of a language?
Why?
Yes. Primarily for reuse, and retraining issues. Do you write in Slip? have you even heard of Slate? Sloop? Spitball? SpeakEasy? There have been hundreds of languages and they come and go like the seasons. Why? Because they don't get the industry support. A language that gains industry standardization gets widespread use, gains training advantages, and support advantages. The reasons to have a standards compliant language is exceedingly large. But, primarily, from a future perspective, you protect the investment of your own time and money by using industry acceptance and standards compliance based languages.
And remember: "Sail" your way around problems, be "Sure" of your language choices and throwing "Sticks&Stones" may not achieve what you "Hope" to do.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|