Click here to Skip to main content
16,006,378 members
Home / Discussions / C#
   

C#

 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BobJanova21-Aug-11 22:49
BobJanova21-Aug-11 22:49 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 2:07
mveDave Kreskowiak22-Aug-11 2:07 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
BillWoodruff22-Aug-11 3:28
professionalBillWoodruff22-Aug-11 3:28 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 4:10
mveDave Kreskowiak22-Aug-11 4:10 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Shameel22-Aug-11 4:22
professionalShameel22-Aug-11 4:22 
GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Dave Kreskowiak22-Aug-11 5:57
mveDave Kreskowiak22-Aug-11 5:57 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
PIEBALDconsult22-Aug-11 2:45
mvePIEBALDconsult22-Aug-11 2:45 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro PinPopular
Luc Pattyn22-Aug-11 3:09
sitebuilderLuc Pattyn22-Aug-11 3:09 
in C# a method may or may not have a return type (other than void), and when it does you may or may not be interested in it.
The same idea has existed ever since C and C++ came to be; and it is different from the Basicy function/subroutine dichotomy.

So there is no error whatsoever.
However, there is one particular case where a warning message would be extremely welcome:
string text="...";
text.Insert(0, "aha");


since strings are immutable, string methods like the one shown are returning strings, ignoring the return value does not make much sense (unless you really want to test for valid parameters and dealing with a possible exception).

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Shameel22-Aug-11 4:52
professionalShameel22-Aug-11 4:52 
AnswerRe: two use-cases that do not (surprise) cause a compiler error in VS 2010 Pro Pin
Shameel22-Aug-11 4:27
professionalShameel22-Aug-11 4:27 
Questionwindow services in VS2008 [modified] Pin
Aisha sharma21-Aug-11 21:12
Aisha sharma21-Aug-11 21:12 
AnswerRe: window services in VS2008 Pin
Richard MacCutchan21-Aug-11 21:38
mveRichard MacCutchan21-Aug-11 21:38 
AnswerRe: window services in VS2008 Pin
Paul E Davies21-Aug-11 22:07
Paul E Davies21-Aug-11 22:07 
GeneralRe: window services in VS2008 Pin
Aisha sharma22-Aug-11 0:29
Aisha sharma22-Aug-11 0:29 
GeneralRe: window services in VS2008 [modified] Pin
Paul E Davies22-Aug-11 2:56
Paul E Davies22-Aug-11 2:56 
QuestionXML to Excel parsing Pin
yoni.kess21-Aug-11 4:15
yoni.kess21-Aug-11 4:15 
AnswerRe: XML to Excel parsing Pin
Not Active21-Aug-11 6:47
mentorNot Active21-Aug-11 6:47 
GeneralRe: XML to Excel parsing [modified] Pin
yoni.kess23-Aug-11 9:31
yoni.kess23-Aug-11 9:31 
GeneralRe: XML to Excel parsing Pin
Not Active23-Aug-11 9:53
mentorNot Active23-Aug-11 9:53 
GeneralRe: XML to Excel parsing Pin
yoni.kess24-Aug-11 21:06
yoni.kess24-Aug-11 21:06 
QuestionPass object from an app to another Pin
mehrdadc4820-Aug-11 23:50
mehrdadc4820-Aug-11 23:50 
AnswerRe: Pass object from an app to another Pin
#realJSOP21-Aug-11 2:56
professional#realJSOP21-Aug-11 2:56 
AnswerRe: Pass object from an app to another [modified] Pin
Manfred Rudolf Bihy21-Aug-11 3:32
professionalManfred Rudolf Bihy21-Aug-11 3:32 
GeneralRe: Pass object from an app to another Pin
Keith Barrow21-Aug-11 9:23
professionalKeith Barrow21-Aug-11 9:23 
GeneralRe: Pass object from an app to another Pin
Manfred Rudolf Bihy21-Aug-11 20:50
professionalManfred Rudolf Bihy21-Aug-11 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.