Tag Info

New answers tagged

0

First of all, have you tried to ask your co-worker what would be the benefits of his approach ? From my point of view, the only advantage of having a singleton (and basically object methods) is to ensure that later on, you will be able to extend those functions (or to mock them), and change the behavior of code that relies on it. This is especially useful if ...


6

What allows the some languages to do this and others to not? Why not keep a uniform system of adding the semicolon to the end? Robert gave a good answer regarding Swift, I'll try to add bit more about parsing in general and why to use or not semicolons. When you compile the program, there are several steps before your source file is turned into ...


7

Line breaks are used instead of semicolons to delimit the end of a statement. In Language guide: The Basics it says: Unlike many other languages, Swift does not require you to write a semicolon (;) after each statement in your code, although you can do so if you wish. Semicolons are required, however, if you want to write multiple separate statements on ...



Top 50 recent answers are included