Is there a reason there aren't any braces around single-line if statements? Is that a C thing? It seems kind of inviting to bugs to me.
Git's initial commit
21–30 of 128 posts
Re: Git's initial commit
#22Earlier quoted context omitted.
It's a C-style language syntax option. If it's only a single line in after the if, the braces are optional. I've also seen it in C++ and PHP. Whether or not it's sloppy is up for debate and just a matter of personal preference.
C# also has it, and i've heard Java has got it as well, but I've never tested it in the latter. I personally like being able to do it since it allows me to do away with the 2 extra lines auto indent puts in if i add brackets. That's a 50% reduction for a 4 line if. Maybe I should just buy a bigger monitor.
Re: Git's initial commit
#23Earlier quoted context omitted.
It's a C-style language syntax option. If it's only a single line in after the if, the braces are optional. I've also seen it in C++ and PHP. Whether or not it's sloppy is up for debate and just a matter of personal preference.
C# also has it, and i've heard Java has got it as well, but I've never tested it in the latter. I personally like being able to do it since it allows me to do away with the 2 extra lines auto indent puts in if i add brackets. That's a 50% reduction for a 4 line if. Maybe I should just buy a bigger monitor.
Re: Git's initial commit
#24Re: Git's initial commit
#25Earlier quoted context omitted.
It's a C-style language syntax option. If it's only a single line in after the if, the braces are optional. I've also seen it in C++ and PHP. Whether or not it's sloppy is up for debate and just a matter of personal preference.
C# also has it, and i've heard Java has got it as well, but I've never tested it in the latter. I personally like being able to do it since it allows me to do away with the 2 extra lines auto indent puts in if i add brackets. That's a 50% reduction for a 4 line if. Maybe I should just buy a bigger monitor.
Re: Git's initial commit
#26Why are there multiple main() functions? I've never seen this style before. Is it multi-process?
Re: Git's initial commit
#27Why are there multiple main() functions? I've never seen this style before. Is it multi-process?
Re: Git's initial commit
#28Why are there multiple main() functions? I've never seen this style before. Is it multi-process?
Re: Git's initial commit
#29Earlier quoted context omitted.
Given that the only way to reuse it is to duplicate the tree and commit metadata exactly, or find an sha1 collision, I think it's pretty safe. :) I wonder if there are any git sha1 collisions out there in aggregate, say across all of github. Would they even notice if there were?
>I wonder if there are any git sha1 collisions out there in aggregate, say across all of github. Despite the incredibly high number of all commits there must be, I think the chance of a collision is still very unlikely. 2^160 is a pretty big number.
Re: Git's initial commit
#30Earlier quoted context omitted.
>I wonder if there are any git sha1 collisions out there in aggregate, say across all of github. Despite the incredibly high number of all commits there must be, I think the chance of a collision is still very unlikely. 2^160 is a pretty big number.
The number of inputs before a likely collision is more on the order of 2^80. Which is still pretty large.