Do not use the This keyword in global functions A global function is essentially a static method of a class. Although the PowerBuilder compiler does not prevent you from using the This pronoun in a global function, the C# compiler does not allow this.
Do not change an event's signature The PowerBuilder compiler does not prevent you from changing the signature of an event defined by its super class, but .NET does not allow this. For example, suppose the w_main class contains the following event:
Event type integer ue_update(int e)
The subclasses of the w_main class should not change the parameters or the return type of the event.
Do not change the access modifier of an inherited function to public If your application contains a class that inherits from another class, do not change to public access the access modifiers of functions whose access level in the parent class was protected or private. The PowerBuilder compiler does not prevent you from changing the access modifier of a function in an inherited class from protected or private to public, but if you attempt to deploy a .NET target that contains such a function, you receive an error indicating that a private or protected function cannot be accessed.
Do not code Return statements in Finally clauses PowerBuilder allows you to code a Return statement in the Finally clause of a Try-Catch-Finally-End-Try statement, but C# does not support Return statements in Finally clauses. If your code includes such statements, the compiler returns the error “Return statement cannot be used in finally clause.”
Do not cast to object without inheritance relationship The PowerBuilder compiler allows you to cast an object to classes that are not ancestors of the object you are casting, such as sibling object classes. However, this is not considered good coding practice, and is not allowed for .NET targets.