влияет на мировосприятие и воззрения его носителей, а также на их когнитивные процессы. Лингвистическая относительность широко известна как гипотеза Сепира — Уорфа. Выделяют две формулировки этой гипотезы: 1. Строгая версия: язык определяет мышление, и, соответственно, лингвистические категории ограничивают и определяют когнитивные категории. 2. Мягкая версия: мышление наряду с лингвистическими категориями определяет влияние традиций и некоторые виды неязыкового поведения. (спасибо, Википедия) 2
ElseIf othercondition Then ' condition is false and othercondition is true Else ' condition and othercondition false End If For i As Integer = number To 0 Step -1 ' loops from number down to zero Next 4
= 1 <- Error BC30288 Local variable 'I' is already declared in the current block. Параметров это не касается, так что особо проблем не доставляет Class Customer End Class Class Example Public Sub F(customer as Customer) End Sub End Class 5
access modifiers allowing inter-class but not inter-assembly reference, except for friend assemblies • Me vs this - a self-reference to the current object instance • MustInherit vs abstract - prevents a class from being directly instantiated, and forces consumers to create object references to only derived classes • MustOverride vs abstract - for forcing derived classes to override this method • MyBase vs base - for referring to the base class from which the current class is derived • NotInheritable vs sealed - for declaring classes that may not be inherited • NotOverridable vs sealed - for declaring methods that may not be overridden by derived classes • Overridable vs virtual - declares a method as being able to be overridden in derived classes • Shared vs static - for declaring methods that do not require an explicit instance of an object А ещё: • Function/Sub - for method signature • Structure vs struct - for declaring value types • Implements / Inherits - when implements interface / inherits class • etc. 6
том числе и бесплатных. Dim shape As Object Dim fileName = "FileName.jpg" If Word.WdWrapType.wdWrapInline = wrap Then shape = range.Document.InlineShapes.AddPicture(FileName:=image.GetFileName(), LinkToFile:=False, SaveWithDocument:=True, Range:=range) Else shape = range.Document.Shapes.AddPicture(FileName:=image.GetFileName(), LinkToFile:=False, SaveWithDocument:=True, Anchor:=range) End If shape.LockAspectRatio = True If shape.Width > shape.Height * 2 Then shape.Height = minsize ElseIf shape.Width * 2 < shape.Height Then shape.Width = minsize End If 7
богатая история, и масса людей, которые привыкли писать так, как писали много лет назад • компилятор, по умолчанию, будет делать ОЧЕНЬ много того, к чему в static typed языках не привыкли • и по умолчанию даже не будет говорить о ситуациях, который в C# были бы однозначной ошибкой 9
j = 1 If i = j Then 'Compiler does cast and compare between i and j MsgBox("Avoid using, but this message will appear!") End If Пример late binding: Dim test test = "Hello world" Console.WriteLine(test.length) test = 42 Console.WriteLine(test / 6) 10
Public Class MyExample Implements IExample End Class Public Sub Run(example as MyExample) End Sub Public Sub Test() Dim value as IExample = New MyExample() Run(value) End Sub End Class 11
в C#” в смысле работы с типами: Properties -> Compile -> Option strict -> On Либо, если проект перестанет от этого собираться - Custom & Notification Warning Стандартные рекомендации: Treat all warnings as errors 12