Original post can be found here...
A collection of my uncategorized thoughts as a Software Developer
Original post can be found here...
Posted by ramil at 1:00 AM View Comments Links to this post
WebsiteSpark Program Details Microsoft® WebsiteSpark™ is designed to ignite the success of professional Web developers and designers. The program enables you to get software, support and business opportunities from Microsoft at no upfront costs for 3 years or exit from the program. Program Benefits WebSiteSpark provides access to a technology offering for development and production hosting of websites. Once enrolled, you can download the following software from Microsoft: * For design, development, testing and demonstration of new websites – for a total of up to three users per Web design and development company: read more...
Labels: .NET, ASP.NET, microsoft, SQL, WebsiteSpark
Posted by ramil at 4:37 AM View Comments Links to this post
A few days ago I have found out for myself about one more difference between PHP and C# OOP impelentations. Look at the following code snippet in PHP: What do you expect it to show – ‘Parent’ or ‘Child’? The PHP manual says the result will be ‘Child’. And it seems quite logical to me as I would expect public property to be overridden. Now rewrite the same code to C#: Run the code and you will get ‘Parent’… Change access modifier of First thing to mention is that unlike PHP, public identifiers cannot be overridden in C#. Calling To make C# behavior similar to PHP you should either add a method with the same signature and with override keyword to Child class and mark parent method as virtual: or use overridden public properties to access the 01.class ParentClass {02.public $val = 'Parent';03. 04.public function GetValue()05.{06.echo $this->val;07.}08.}09. 10.class ChildClass extends ParentClass {11.public $val = 'Child';12.}13. 14.$a = new ChildClass();15.$a->GetValue();01.class Parent {02.public string val = "Parent";03. 04.public void GetValue() {05.Console.WriteLine(this.val);06.}07.}08. 09.class Child:Parent {10.public string val = "Child";11.}12. 13.Child child = new Child();14.child.getValue();val to private in the parent class. Now both PHP and C# outputs the same – ‘Parent’. Why?GetValue(),this points to parent object and returns “not overridden” value of val as a result. Private identifers inside parent are not accessible for the child and therefore are not overridden so everything becomes clear.01.class Parent {02.public string val = "Parent";03. 04.public virtual void GetValue() {05.Console.WriteLine(this.val);06.}07.}08. 09.class Child:Parent {10.public string val = "Child";11. 12.public override void GetValue() {13.Console.WriteLine(this.val);14.}15.}val value. This will work correctly as unlike public fields, public properties can be overridden.01.class Parent {02.private string privateVal = "Parent";03.public virtual string val04.{05.get { return privateVal; }06.}07. 08.public void