代码中的空格会影响代码的执行时间或性能吗?
我的问题很简单,在运行代码时有一个执行时间,所以如果代码中有空格,我的意思是空格而不是字符串或任何内容中的空格,执行时间将相同或不同,或者会增加
My question is simple ,that on running of a code there is an execution time ,so if there are blank spaces in code , I mean blank spaces not spaces in string or anything ,the execution time will be same or not or it will increase
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,编译器会忽略代码中的空白(空格),编译器会在编译代码时跳过它们。这也适用于评论。
空格只会影响源代码的大小。
No, Whitespaces (blank space) in your code are ignored by the compiler, which just skips over them while compiling the code. This also applies to comments.
Spaces will only effect the size of your source code.
空格对性能没有任何影响。在你的代码在机器上执行之前,已经完成了大量的处理,并且不必要的空间已经被去除。
明智地使用空格使您的代码尽可能具有可读性!
Spaces do not have any effect on performance. Before your code executes on the machine, a lot of processing has been done and unnecessary spaces have been stripped away.
Use whitespace wisely to make your code as readable as possible!