Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda