void new_function(int a) ---> void newFunction(int a)

Status
Not open for further replies.

topham

Ars Legatus Legionis
13,756
Subscriptor
Xavin":1366tc3q said:
300 files really is nothing.
I've had to adjust a heck of a lot more files than that for a project.
I'm not saying it's impossible, just a huge pain for no gain.

If it were less than 1000 files then I'd do it; particularly if the code base was continuing to grow and I wanted to go with a particular naming convention. Having code mixed between naming conventions can get ugly. (see PHPs library functions).
 

Wildbill

Ars Praefectus
3,327
Subscriptor++
Xavin":1sfbztbg said:
levine":1sfbztbg said:
Why are you doing this? It's almost certainly a waste of time.
This. Once a project has 300 files, you are past the point where changing naming styles makes sense, just go with the way it already is.

I suspect that it wasn't the OP's idea to make this change, but has become his responsibility.

If he's working in a small shop, it could be as simple as having a new prima donna lead assigned to the project, who has strong views about coding style. In a corporate environment, there's a hundred ways this could have come about. Working in any job, if you have a supervisor, you'll end up doing some stuff that varies between ill advised and insane. How much of it tends to be a good indicator of boss quality, though at any large corp, he too will often have his hands tied.

To the OP, here's another vote for perl.
 

stickboy

Ars Tribunus Angusticlavius
6,218
Subscriptor
Xavin":36o7bc9l said:
300 files really is nothing.
I've had to adjust a heck of a lot more files than that for a project.
I'm not saying it's impossible, just a huge pain for no gain.
It's only a huge pain if you're doing it in a non-automated way. It's not actually hard or even time-consuming to do.
 

ranald

Ars Scholae Palatinae
1,062
topham":qbcie32v said:
Xavin":qbcie32v said:
300 files really is nothing.
I've had to adjust a heck of a lot more files than that for a project.
I'm not saying it's impossible, just a huge pain for no gain.

If it were less than 1000 files then I'd do it; particularly if the code base was continuing to grow and I wanted to go with a particular naming convention. Having code mixed between naming conventions can get ugly. (see PHPs library functions).

Having multiple naming conventions coexisting in the same namespace is *always* unpleasant. You should have seen the collection of servers and apps I had to deal with 2 jobs ago... (there were at least 3 different server naming conventions that I could identify, stretching back into the misty depths of time)

In this case it's something you can fix in a couple minutes with a decent scripting language, so why not?
 
ranald":2m1m4abk said:
In this case it's something you can fix in a couple minutes with a decent scripting language, so why not?

I can think of 2 good reasons. It'll make your source control history less useful, and there's a good chance that the project contains both generic_func and genericFunc.

The cost may still outweigh the benefits, but it's not without cost/risk.
 

ranald

Ars Scholae Palatinae
1,062
ToLazyToThink":3fpnl43g said:
ranald":3fpnl43g said:
In this case it's something you can fix in a couple minutes with a decent scripting language, so why not?

I can think of 2 good reasons. It'll make your source control history less useful, and there's a good chance that the project contains both generic_func and genericFunc.

The cost may still outweigh the benefits, but it's not without cost/risk.

As to the source revision history being less useful, I just don't see it making that kind of difference- it certainly wouldn't with the source control systems I've used. And that sort of near-collision is to me an argument in favor of this project- that's something that ought to be rooted out as quickly as possible (yes it does make the project more difficult, but IMO more beneficial in the long run).
 

gnosis

Ars Tribunus Angusticlavius
8,339
How? Of all of the changes that happen in a codebase, foo_bar to fooBar is something I probably wouldn't even notice while reading commit logs.
It doesn't present a problem in the commit logs, but it presents a problem in diff. Say foo_bar -> fooBar occurs at revision 37; if a developer later wants to compare a file from revision 36 with a file from revision 38, they're going to wind up with a ton of noise. That said, I don't think it's a reason not to do foo_bar -> fooBar, if there's a compelling reason to do it.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
gnosis":19r3tdpa said:
How? Of all of the changes that happen in a codebase, foo_bar to fooBar is something I probably wouldn't even notice while reading commit logs.
It doesn't present a problem in the commit logs, but it presents a problem in diff. Say foo_bar -> fooBar occurs at revision 37; if a developer later wants to compare a file from revision 36 with a file from revision 38, they're going to wind up with a ton of noise. That said, I don't think it's a reason not to do foo_bar -> fooBar, if there's a compelling reason to do it.
Ok, the same argument applies equally to diffs too. I do all sorts of things that make following the history vastly more difficult all of the time.
 

gnosis

Ars Tribunus Angusticlavius
8,339
Ok, the same argument applies equally to diffs too.
I don't see how it does. 100 instances of foo_bar being changed to fooBar is going to show up in the diff as meaningless noise. Maybe I'm just not as adept at using tools like diff as I ought to be (which I'll concede is very possible), but I don't know of a way around that. Ignoring a single commit message isn't equal to ignoring hundreds of meaningless "differences" that have no consequence other than looking nicer to some developer.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
gnosis":1wa3thw5 said:
I don't see how it does. 100 instances of foo_bar being changed to fooBar is going to show up in the diff as meaningless noise.
As will every other change between A and X that yo're not interested in. Odds are good in a complicated codebase that at least one of those changes will be way more involved than a mere rename, but still be "meaningless noise" at the time.
 

gnosis

Ars Tribunus Angusticlavius
8,339
As will every other change between A and X that yo're not interested in. Odds are good in a complicated codebase that at least one of those changes will be way more involved than a mere rename, but still be "meaningless noise" at the time.
I think there's a difference in scale in the impact of the noise. We're talking about an entire cross-project style change in a single commit, composed entirely of meaningless noise in terms of functionality. Any diff of a revision before and a revision after that commit (including between the presumably meaningful commit before it and the presumably meaningful commit after it) will be littered with that noise, and huge swaths of files will probably show up as having been modified when no meaningful change was made. That's quite different than renaming a variable in a function or some other small-impact noise.
 

levine

Ars Tribunus Militum
1,986
gnosis":3duqrf7i said:
As will every other change between A and X that yo're not interested in. Odds are good in a complicated codebase that at least one of those changes will be way more involved than a mere rename, but still be "meaningless noise" at the time.
I think there's a difference in scale in the impact of the noise. We're talking about an entire cross-project style change in a single commit, composed entirely of meaningless noise in terms of functionality. Any diff of a revision before and a revision after that commit (including between the presumably meaningful commit before it and the presumably meaningful commit after it) will be littered with that noise, and huge swaths of files will probably show up as having been modified when no meaningful change was made. That's quite different than renaming a variable in a function or some other small-impact noise.
Don't you ever do cleanup or re-org commits to source control? This happens all the time; hard to believe anyone would have such a problem with it.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
gnosis":3979awxg said:
We're talking about an entire cross-project style change in a single commit, composed entirely of meaningless noise in terms of functionality. Any diff of a revision before and a revision after that commit (including between the presumably meaningful commit before it and the presumably meaningful commit after it) will be littered with that noise, and huge swaths of files will probably show up as having been modified when no meaningful change was made.
(emphasis mine) So then don't look at every last file. Presumably, if you're intentionally looking across multiple revisions in this fashion, you have some idea of what you're looking for and what files it's most likely located in. I can't think of any VCS tool that doesn't let me dissect changesets so I can look at them and the history on a per-file basis.
 

gnosis

Ars Tribunus Angusticlavius
8,339
levine":2cn6y360 said:
Don't you ever do cleanup or re-org commits to source control? This happens all the time; hard to believe anyone would have such a problem with it.
Sure, and I'll even quote myself: "That said, I don't think it's a reason not to do foo_bar -> fooBar, if there's a compelling reason to do it." That doesn't mean the problem doesn't exist or shouldn't be discussed as a potential issue.

LordHunter317":2cn6y360 said:
So then don't look at every last file. Presumably, if you're intentionally looking across multiple revisions in this fashion, you have some idea of what you're looking for and what files it's most likely located in. I can't think of any VCS tool that doesn't let me dissect changesets so I can look at them and the history on a per-file basis.
Well, now you've moved the goalposts—moving from dismissing the meaningless noise a developer will encounter in a given file in a diff that spans such a cleanup to dismissing the meaningless noise of that huge swath of files showing up modified—but I'll fault myself because the language I used invited you to do so. To revisit my earlier point, running a diff on a file's pre-cleanup version and a later post-cleanup version will show a lot of meaningless noise in itself. The answer to that isn't "don't look at it", if you're looking for changes besides the cleanup, so you're left to wade through the meaningless changes looking for meaningful ones. The broader point I made in my later post is that with huge swaths of files being modified in a project-wide cleanup of this sort, this raises that problem for every developer who has an interest in not every last file but any one of those files. And sure, of course any person with a functioning brain can do the work to wade through those changes, but my point is not that they can't but that they'll have to and it should be considered rather than dismissed.

Maybe you don't mind wading through hundreds of false positives looking for something of interest, but my time is pretty valuable and if I'm going to have to do that there should be a good reason for it. At the very least, I'd hope that whoever inflicted it on me had enough respect for my time to consider that rather than dismiss it.
 

levine

Ars Tribunus Militum
1,986
gnosis":he0be5tk said:
levine":he0be5tk said:
Don't you ever do cleanup or re-org commits to source control? This happens all the time; hard to believe anyone would have such a problem with it.
Sure, and I'll even quote myself: "That said, I don't think it's a reason not to do foo_bar -> fooBar, if there's a compelling reason to do it." That doesn't mean the problem doesn't exist or shouldn't be discussed as a potential issue.
If "the problem" you're referring to is the re-org commit to source control itself, and not the reasoning behind it, then yes, it absolutely doesn't exist and there's no reason to discuss it as a potential issue, because it's not really a problem and happens all the time as part of a healthy software maintenance lifecycle :confused:

If you're referring to the motivation to do the rename in the first place, then I agree, I guess.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
gnosis":1x3cippq said:
Well, now you've moved the goalposts
No, I haven't, I've simply dismissed absurd use cases. People don't look across multiple revisions (N>=2) on a whim. They are not, generally, looking at every last file that changed in those revisions. In general, they already know what file(s) they need to examine. The volume of noise in that case is no more than if you renamed functions within a single file. Which is as good as you can do.

The broader point I made in my later post is that with huge swaths of files being modified in a project-wide cleanup of this sort, this raises that problem for every developer who has an interest in not every last file but any one of those files.
Err, so? It's not compelling and frankly, I can't fathom why you think it is. We do not, in general, look at the whole repository at once when examining changes, especially when looking across multiple revisions. Even when we do, I can still think of things vastly worse than a global project rename, like importing 3rd-party sources. So even if I bought your argument as valid, it's still not compelling on its own merits relative to everything else we might do in a codebase.

And sure, of course any person with a functioning brain can do the work to wade through those changes, but my point is not that they can't but that they'll have to and it should be considered rather than dismissed.
And my point is that no one with a functioning brain will have to wade through these changes, because they'll identify the file(s) they need to examine before they even ask for the diff! As such, the number of files touched by the rename is irrelevant, because they're only going to be looking at one or two files.

Maybe you don't mind wading through hundreds of false positives looking for something of interest,
I do mind, but I work smarter, not harder, and don't just blindly ask for all changes in all files between revision X and revision Y in the first place, as a rule. Especially when Y - X >= 2.

At the very least, I'd hope that whoever inflicted it on me had enough respect for my time to consider that rather than dismiss it.
If you can't figure out how to ask for a diff such that most of the "noise", as you put it, isn't there to begin with, then there's no reason to have any respect for you.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
gnosis":3d399ouq said:
You don't consider wading through junk data a problem?
I consider the fact that you think examining all the changes in all files across multiple revisions in a single diff is a worthwhile endeavor a far bigger problem. And even if I didn't, renaming functions still isn't compelling in the face of things like 3rd party code imports or changes due to toolchain upgrades, or any other of a billion changes that are legitimate and have much bigger semantic ramifications.
 

audioSE

Ars Scholae Palatinae
994
LordHunter317":20jwckfi said:
Nevermind that if you're using a really modern VCS, like git or mercurial, you might be able to clone the repository and remove the change that made the rename entirely, correctly and safely.

Out of curiousity, would the clone just not have the change? Because that honestly scares me more, having files change with no revisions. Or does it somehow like, mash the rename changes into the last changelist before they occurred?
 

topham

Ars Legatus Legionis
13,756
Subscriptor
If it's feasible the simplest thing to do is to do the name change all at once with a single check-in, not spread over a couple of days, or a week. (Project size dependant of course).
Then is just becomes a singular event you need to look past. It isn't that big of a deal.

The biggest issue with such a change is regression testing, or validation that you haven't unintentionally changed anything that is actually significant. (I'd consider compiling it all without any debug, or other meta data, and compare the binaries.). Not sure it'll work these days though, too much extra crap gets included.

(Regression testing is easier if you already have unit testing in place; but if you don't then you better have full coverage from any other testing you do.)
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
audioSE":1gnmr9ql said:
Out of curiousity, would the clone just not have the change? Because that honestly scares me more, having files change with no revisions. Or does it somehow like, mash the rename changes into the last changelist before they occurred?
You'd use the transplant extension or something similar to remove the change entirely, within that clone. Effectively, it would be like that change was never made, like the revision never existed. The assumption is that when you're done doing your history browsing, you'd destroy the clone entirely.

At no point can you make a change that isn't recorded somehow, however.
 

technophile

Ars Legatus Legionis
23,768
audioSE":qkbh8qu4 said:
Being afraid of refactoring function names because it'll add revisions to source control is silly. You do label your checkins, right?
Especially if you're using a decent compare tool, one that does intra-line compares, so that you can immediately see that the only change was a rename of the function/variable/whatever.

If you're doing whole-line diffs, then yeah, it would be more annoying. That's more a reason not to use that diff tool than one to not refactor, though.
 

gnosis

Ars Tribunus Angusticlavius
8,339
People don't look across multiple revisions (N>=2) on a whim.
Who said anything about a whim? But let's bear in mind that for the use case in question (where N = N - 1 because one of those revisions contains no meaningful changes, and we know this from the commit log (which you said in your first post to this thread).

They are not, generally, looking at every last file that changed in those revisions.
Again, I never meant to say that was the use case I was discussing. Interestingly you responded to everything except my reiteration of that, so I can only assume you're ignoring it deliberately to win debate points, but it won't fly with me. Let me repeat, this time in bold: To revisit my earlier point, running a diff on a file's pre-cleanup version and a later post-cleanup version will show a lot of meaningless noise in itself. The answer to that isn't "don't look at it", if you're looking for changes besides the cleanup, so you're left to wade through the meaningless changes looking for meaningful ones.

The volume of noise in that case is no more than if you renamed functions within a single file. Which is as good as you can do.
First of all, that's plainly not true for a file which depends on any other resource in the project which has changed—if those changes aren't made in this hypothetical file, it will break the project. Second of all, that's still noise that should only be introduced if there's a good reason (which is what I said in the first place).

We do not, in general, look at the whole repository at once when examining changes, especially when looking across multiple revisions.
Please do me the favor of actually reading what you're responding to before you respond. "not every last file but any one of those files"

Even when we do, I can still think of things vastly worse than a global project rename, like importing 3rd-party sources.
Why would that be worse? I would simply ignore it but for where the third party sources become dependencies in the first party code. And even then I'd refer to the third party documentation before even bothering to look at the source in a diff.

So even if I bought your argument as valid, it's still not compelling on its own merits relative to everything else we might do in a codebase.
So far I'm not even convinced you understand (or have any intention to understand) my argument.

And my point is that no one with a functioning brain will have to wade through these changes, because they'll identify the file(s) they need to examine before they even ask for the diff! As such, the number of files touched by the rename is irrelevant, because they're only going to be looking at one or two files.
To repeat, I am not saying this only applies to looking at a diff of multiple files. The reason I brought up multiple files is because it means that there will be a greater surface area of false-positive diff changes, and increase the likelihood that looking at a diff of any given file will mean wading through such noise. How will knowing which file you want to see make the noise in that particular file vanish?

I do mind, but I work smarter, not harder, and don't just blindly ask for all changes in all files between revision X and revision Y in the first place, as a rule. Especially when Y - X >= 2.
I addressed this above, but evidently I need to repeat myself so here goes: I'm not discussing asking for all changes in all files, and Y = Y - 1 for the purposes of identifying meaningful changes when Y includes one revision which contained only meaningless changes.

If you can't figure out how to ask for a diff such that most of the "noise", as you put it, isn't there to begin with, then there's no reason to have any respect for you.
Well, aren't you sweet! Since I've already said that there may be a way to ignore such noise in diff but I don't know it, would you care to educate me? Or is your purpose in this forum only to mock others' ignorance rather than correct it? I'll note that I took a look at TFM before I posted that earlier, and I saw no way to automatically ignore changes like foo_bar -> fooBar. Maybe I missed it, please enlighten me.

I consider the fact that you think examining all the changes in all files across multiple revisions in a single diff is a worthwhile endeavor a far bigger problem.
To repeat, again, I don't.

And even if I didn't, renaming functions still isn't compelling in the face of things like 3rd party code imports or changes due to toolchain upgrades, or any other of a billion changes that are legitimate and have much bigger semantic ramifications.
That's just my point. Insofar as those changes introduce different functionality in your code, they aren't noise and their appearance in a diff is appropriate.

For the future, if your next response betrays that you obviously haven't read (or have deliberately misunderstood) this post, I won't bother responding. If you want to have an actual discussion, I'm down. If not, why bother responding?
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
gnosis":2zm8mkt2 said:
Again, I never meant to say that was the use case I was discussing.
Well, you're discussing it whether you intend to or not. You're discussing every time you talk about "other resources" or multiple files. Surely, you accept that if the noise is unacceptable in one file, then the change cannot be made at all, yes? Therefore, you must agree the noise is acceptable as long as we're talking about a single file. As such, I fail to see how you can be talking about anything other than cases involving multiple files, as we're in agreement in the single file case. And if we disagree there, the multiple file case is still irrelevant since we're not going to be making the change in the first place!

Interestingly you responded to everything except my reiteration of that,
No, I ignored it because you didn't say anything new and that's not the whole of your position, even if you believe it is. You're still talking about a use case that involves looking at a large number of files in a single diff across multiple revisions. The value of doing such a thing is not immediately obvious in the least. There's no need to respond to your summary when I've accurately addressed my issues with it in everything else.

First of all, that's plainly not true for a file which depends on any other resource in the project which has changed—if those changes aren't made in this hypothetical file, it will break the project.
What? How are other resources relevant when I'm looking at a diff that contains the changes made in a single file! :confused: :eek: Literally, even if the function rename edited 100 files, how does it matter when I run:
Code:
vcs diff file1.c@3 file1.c@7
?????????? That's what you're trying to tell me, and it's entirely fucking absurd. The only changes I see are in file1.c between revisions 3 and 7. Renames in other files will not show up in the diff. This is exactly to equivalent if the only file that was changed by the rename was 'file1.c'. As such, who cares whether the rename touched one file or 1 million? I never ever see more than the noise of changing one file, which we've necessarily agreed is acceptable. The only way to increase the noise above that threshold is to start looking at multiple files. If there is any other way, you're going to have to explain it to me.

Second of all, that's still noise that should only be introduced if there's a good reason (which is what I said in the first place).
Err, and? We've agree the noise is acceptable. If it's not, then we're not making the change at all, regardless of the number of files.

Please do me the favor of actually reading what you're responding to before you respond. "not every last file but any one of those files"
I did! It's still only an issue if I'm looking at more than one or two files at a time. If you were trying to say, "It means that you'll have to deal with this noise when examining any file, even one at time," then you were hardly clear and I still can't fathom why you think it's relevant. As long as we buy the argument the noise in a single file is acceptable, then the fact I've touched every file in the repository is irrelevant. If you don't find it acceptable, then the change is not acceptable at all.

Why would that be worse?
You answered your own question:
I would simply ignore it but for where the third party sources become dependencies in the first party code.
And I don't know about you, but much of our third party stuff is patched to at least some degree. That means time examining their changes and fixing our patches.

And even then I'd refer to the third party documentation before even bothering to look at the source in a diff.
I didn't realize third party documentation explained anything about your own code. Also, the presumption about documentation is rather cute.

To repeat, I am not saying this only applies to looking at a diff of multiple files. The reason I brought up multiple files is because it means that there will be a greater surface area of false-positive diff changes, and increase the likelihood that looking at a diff of any given file will mean wading through such noise. How will knowing which file you want to see make the noise in that particular file vanish?
Who cares? We consider the noise acceptable as long as we're looking a single file. The fact the noise is in every file doesn't matter when I'm looking at one file at time. How can it?

and Y = Y - 1 for the purposes of identifying meaningful changes when Y includes one revision which contained only meaningless changes.
Huh? This literally makes no sense whatsoever.

That's just my point. Insofar as those changes introduce different functionality in your code, they aren't noise and their appearance in a diff is appropriate.
You're still missing the point, though I guess I wasn't clear enough perhaps. Let's consider a simple application within a single file, with three steps of processing:
  • Read some input
  • Process the input (business logic)
  • Display some output.
Let's say the change history looks like this:
  • Initial Version
  • Change to business logic to make it faster
  • Change to input/output processing to better handle malformed input
  • Change to business logic that induces a bug
If my interest is in fixing the business logic, then the commit between the two changes that touched the business logic is entirely "meaningless noise" to me. Surely, the notion such a change has a bigger impact, both in terms of lines touched and semantic changes, yet is still noise as long as all I care about is the business logic isn't disagreeable? Nor the belief that changes like this happen all the time, nay, most of the time? This is why even if your argument is valid, it's non-compelling.

Signal consists only of what we're interested in. Anything else is something else, whether you call it noise, interference, whatever. The content of the hunks you don't care about is irrelevant.

For the future, if your next response betrays that you obviously haven't read (or have deliberately misunderstood) this post, I won't bother responding.
I've read everything you wrote and understood it just fine. You still haven't clearly explained the case you're interested in, and like it or not, you're continually talking about cases that involve multiple files, with no clear explanation to their impact when examining a single file nor their relevance in the first place. The single file case is simple: either the noise is acceptable or it isn't. If we're in agreement there, I fail to see how multiple files matter. And certainly, you've never given a reason why the noise is unacceptable in the single file case that isn't hinged on multiple files in some fashion.
 

THBMan

Ars Legatus Legionis
18,256
Subscriptor
I'd be concerned about doing a simple search and replace clobbering things other than just function names. At least more paranoid that the people saying it would only take a few minutes. OTOH, I would have also had a style guide in place at or near the beginning to prevent needing to rename things en mass. Why are you doing this? Unless you happened to be using this function for a while and it went against the prevalent style (or generally not using a style and naming however you want), wouldn't it be easier to simply continue with this style?
 
Status
Not open for further replies.