Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Comparing Perl with C#, a simple templating example

by simon.proctor (Vicar)
on Oct 18, 2004 at 09:03 UTC ( #400098=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Comparing Perl with C#, a simple templating example
in thread Comparing Perl with C#, a simple templating example

C# even tries to beat Java with small things like how to define getter +s and setters.
Thats just syntactic sugar. You may be able to use "properties" but in essence they just get re-written to the underlying subroutines anyway. Of course if you use code completion incorrectly you can get bitten :). Here's some recursive property code just for fun.
using System; public class MyClass { private string person = ""; public string Person { set { this.Person = value; } get { return this.person; } } public static void Main() { MyClass app = new MyClass(); app.run(); } public void run() { string temp = "temp"; // Crash me this.Person = temp; } }
Though I confess writing your own array accessor for an object is nice.


Comment on Re^3: Comparing Perl with C#, a simple templating example
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-07-08 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls