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.
It's pointless to argue over these kind of things. Every major project/company has their own codified code style guide, and if you want to contribute/earn your salary then you must follow that style guide to the T. Here's the relevant quote from the Linux kernel coding style[0]: Do not unnecessarily use braces where a single statement will do. if (condition) action(); [0] https://www.kernel.org/doc/Documentation/Codi…
Git's initial commit
51–60 of 128 posts
Re: Git's initial commit
#52It's so short. The readme is the best explanation of git I've seen.
Re: Git's initial commit
#53Re: Git's initial commit
#54It's so short. The readme is the best explanation of git I've seen.
Does anyone know if the structure of git has changed much? I would like to read this thinking this is pretty close to the current implementation but I would have no idea. anyone?
-> % git cat-file -p 8c48d1a36c3d11db44c75a431d4f09cb0035222f
tree 288c2d5379768f685f391bdbffd31b8965318c63
parent 002ae35061beef02453b7fb1045a50fa2f7f30f8
author Denis Bilenko 1246939605 +0700
committer Denis Bilenko 1246939605 +0700
MANIFEST.in: include libevent.h and libevent-internal.h
-> % git cat-file -p 288c2d5379768f685f391bdbffd31b8965318c63
100644 blob 6e543dc13df1b556fd95530061ac0c77a9178309.hgignore
100644 blob 79c7beb2227ce149c7a71e58e2f7379071b7a189MANIFEST.in
100644 blob 0d05178544942a035a82599900bec27fbac1c9c5README.eventlet
040000 tree edb8f37fa622315dcf7bf4f7316d5e85c48cfdbdexamples
040000 tree 64cf252d77a4162099442bb0153985fc20ed5ba3gevent
040000 tree 261052e04b4aece469b2e767e394aafbc9d88a32greentest
100644 blob 488e805c563dfeeb6af5e7a1a8953b706d9676e3setup.py
-> % git cat-file -p 6e543dc13df1b556fd95530061ac0c77a9178309
syntax: glob
*~
*.pyc
*.orig
dist
gevent.egg-info
build
htmlreports
results.*.db
gevent/core.so
And yeah it's still very similar though it currently doesn't store the objects individually but rather packs them together.Re: Git's initial commit
#55Re: Git's initial commit
#56Earlier quoted context omitted.
How can something that isn't a programming language be self-hosting?
Overloading the term. The OP presumably meant that the source for git was under git source control.
Re: Git's initial commit
#57Earlier quoted context omitted.
I use a plugin called littlebrace for visual studio, which reduces brace lines to like 3 pt font. My C# code has started looking like Python :)
This sounds really neat. Can you drop a link? I browsed around but couldn't find anything.
Re: Git's initial commit
#58I've read so many git tutorials, I wish I had seen that README file before.
Re: Git's initial commit
#59Earlier quoted context omitted.
This sounds really neat. Can you drop a link? I browsed around but couldn't find anything.
https://github.com/lukesdm/little-braces looks like the one.
https://github.com/owen2/little-braces
Also, it is available from the online add-in manager if you search for "little braces." The VS2013 community edition is just in time :)
I couple it with the indent guideline plugin for best effect (braces are super small, light lines to track indent level, 2 space indent...).
Re: Git's initial commit
#60Is 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.
Most C-inspired languages (most popular programming languages) allow this. The only ones I've used that don't are Go and Swift. And I find it a little annoying. If you're worried about bugs, there are other things in C/C++ to criticize first ;)
if expression1 expression2
it can be fiendishly hard to determine the boundary between expression1 and expression2.