Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
Is there any disadvantage of marking a variable or constant as private in terms of performance or something?

Is there any disadvantage in terms if performance or something by marking a variable as a private on a class or struct on Swift or view on SwiftUI?

I know about the encapsulation advantage you get when the variable is private, preventing access from other code outside the scope. My concern is about performance.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I can say (Flutter experience) it won't slow down your code or app. Its just usable from this one file... but you mentioned that earlier in your question.

But no this won't make your app slower.

over 4 years ago · Santiago Trujillo Relatório

0

Swift is usually a compiled language (interpreters may exist but they are definitely not common) and once the source code is compiled (which is not something the end user will have to sit through, anyway), there is no performance increase or decrease caused by access control. In fact, after the code has been compiled, there is no such thing as access control--the process is now represented as machine code and it will simply run the way it was written to run. Access control is there for the programmer, not the machine. And in terms of compilation performance, I've yet to come across any literature to suggest a compiler will perform better or worse because of access control.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda