Code Monkey home page Code Monkey logo

Comments (4)

hollance avatar hollance commented on June 11, 2024

The Objective-C the property would be called visible even if the getter is called differently. But the existence of getter/setter methods is an implementation detail so it shouldn't really matter what they are called.

This is probably a relic from the days before dot notation. When Apple enabled dot notation, they already solved this problem by naming the property visible and not isVisible.

from swift-style-guide.

koljakube avatar koljakube commented on June 11, 2024

While it is true that the property can be accessed in two ways when using a custom getter, Adopting Modern Objective-C (in the section "Properties") still mentions the is-Prefix for Booleans.

But using the "is" in Swift looks a little weird, I'm all in favor of dropping the prefix.

from swift-style-guide.

icanzilb avatar icanzilb commented on June 11, 2024

Using different names to access the same backing storage is just incoherent and for our beginner users probably plainly confusing. Using the same property name for reading/writing is just simpler and more clear to understand.

from swift-style-guide.

koljakube avatar koljakube commented on June 11, 2024

Agreed. It's not what I was proposing and is also not possible in Swift. I just wanted to get some input on the matter, and thought that something like this might belong in a style guide. Which is what I got (the input), so thanks! I'll close this issue.

from swift-style-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.