I remember how the professor said it was bad practice. But it makes going through code a lot less tedious. I just make out the comments about the pros and cons:
Friend Class MyClass Private isEmpty As Boolean Public Property IsEmpty() As Boolean Get Return isEmpty End Get Set(ByVal Value As Integer) isEmpty = value End Set End Property Public Sub MyMethod() ''//Is this more correct: If Me.IsEmpty() Then ''//Do something. End If ''//Is this bad practice?: If isEmpty Then ''//Do something. End If End Sub End Class
If you created a property to access the private member variable "isEmpty" than "yes", I would use the property inside the class itself if you have no reason to.
, , (, , ), , , .
Ed, IDE , , getter/seters, . VB, #/VS2008 . , , , , " " .
. , - , . , .
, , . .
Source: https://habr.com/ru/post/1756633/More articles:avrdude and atmega48pa - avrIn IIS, how to set environment variables for specific CGI scripts - windowsΠΠΊΠΎΠ½ΡΠ°Π½ΠΈΠ΅ ΡΠ°ΠΉΠ»Π° JavaScript ΠΈ .js, Π‘ΡΡΠΎΠ³ΠΎΠ΅ ΡΡΠ΅Π±ΠΎΠ²Π°Π½ΠΈΠ΅ Π΄Π»Ρ ΡΡΡΠ°Π½ΠΈΡ Ρ ΡΡΡΠ»ΠΊΠΎΠΉ Π½Π° Π²Π½Π΅ΡΠ½ΠΈΠ΅ ΡΡΡΠ»ΠΊΠΈ? - javascriptRandomly thrown IO exceptions in C # - c #ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ Π² ΡΠ°ΠΉΠ» PowerPoint - powerpoint-vbaΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΡΠΏΠΎΡΠΎΠ± Π·Π°Π³ΡΡΠ·ΠΊΠΈ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠΉ Π² PowerPoint Π½Π° ΡΠ°Π·Π½ΡΡ ΡΡΡΠ°Π½ΠΈΡΠ°Ρ ? - ms-officeJQuery UI modal dialog form using remote content - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1756636/mercurial-convert-clones-to-branches&usg=ALkJrhhRfp_t_AI-uP1hWxVXJynIuyylGgRecord of my first VB.NET class - classΠΠ΅Π»ΠΈΡΠ΅Π»Ρ ΠΊΡΡΠ° ΡΠΊΠΎΠΌΠΏΠΈΠ»ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΎΠ³ΠΎ Linq Func <> * Π±Π΅Π· * params? - c#All Articles