git vs. svn & variable declaration

git vs. svn & variable declaration

Postby whitfield » Tue Jun 30, 2009 11:46 am

Hello Bob,

I have had brief conversation with others - neither of my questions have been resolved to satisfaction. In setting up a development environment, I have come across an alternative to SVN version control. Git claims to reduce complication in setup and branching typically faced with SVN. Git also claims to build its versioning around a non-linear development cycle. From what I gather, you make changes at will and they are automatically versioned/saved to the repository; everyone connected to a Git-based project also has a full copy of the repository. Given the latter, I interpret the "distributed" architecture to mean a given "revision" is precipitated by the change-owner.

  • What contexts are better suited for Git?
  • Can you recommend any frontends built around Git (e.g. Tortoise SVN)?
  • Aside from all users having the full repository, do you see any other negatives to working with Git?
  • Off-hand, do you know how long Git has been around and do you foresee future growth?
  • Are there any alternatives similar to Git?
One person I talked to seemed to indicate he found use with Git for local version control; SVN maintained Git-versioned files in a more definite state for use on his team-based project. Does this sound right?

In university, I was scolded at by a professor who found my variable declarations nested at random inside a function definition. He insisted that declaring all variables at the beginning of a function definition was a much clearer way of writing code. Today, I am certain of his argument, but I draw upon a hazy memory that somewhere along the way, I learned this style of variable declaration also posed advantages for execution efficiency.
  • What are the advantages of declaring all variables immediately following the function header aside from clarity?
    - Does it offer a speed advantage and, if so, how much would such a convention affect execution speed?
    - What, if any, differences occur when you declare/define variables after a arithmetic/branch operation (assuming variable declarations are simply classified as load/store operations)?
  • Do these advantages apply only to compiled languages?
    - If so, how does an interpreted language like PHP resolve the same set of problems?
Feel free to answer these questions in any depth you want. I figured based on your knowledge of software engineering and more recent plunge into computer architecture, you were the right person to ask.

Thanks a lot,
Site Admin
Posts: 29
Joined: Tue Dec 12, 2006 1:15 pm

Re: git vs. svn & variable declaration

Postby Bob » Tue Jun 30, 2009 12:28 pm

Ill get in here quickly and say that variable declaration is more than clarity.

In ASM it is only possible to reserve local variables on the stack at the beginning of a function. You can of course edit the stack directly, but the variables aren't named in that instance, and ASM is not compiled =) When you do it in C it serves the purpose of lightening the weight on the compiler, converting your C code into ASM and being miscommunicated or hard to read. I don't think it makes much difference in terms of performance. Memory is memory from what I understand.

So called scripting languages are compiled (or at least interpretted), even if you don't see them do it. There are optimizations there as well, moving variables around in memory and data alignment may come into play, but it comes down to your language and its implementation.
Site Admin
Posts: 252
Joined: Mon Nov 20, 2006 12:24 am
Location: San Jose California

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests