• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Uc-not-first suggestiion

#11
(02-22-2016, 02:59 PM)mtvee Wrote:
(02-22-2016, 02:48 PM)Narf Wrote: Less naming patterns to cover means less code (and less error-prone as well), which in turn means better performance and easier maintenance, at the very least.

Saying that this brings nothing and that there's no reason for it is pure ignorance.

You do realize that if you build or deploy on windows that this naming convention is blissfully ignored? Which makes the convention not cross-platform which in turn, i would say, is more akin to pure ignorance. But whatever, it's a small, sad and pathetic patch to make this work as it should.

Yes, I do realize that. You however don't realize that it is the convention that allows cross-platform operation.

Would you still complain if you had named your files in tHiS pAtTeRn on Windows and then it doesn't work on UNIX-bases OSes? If you're a reasonable person - you wouldn't, but if you insist that having a single convention is bad - it's really the same thing.

What's sad and pathethic is that you've spent your whole day ranting about this instead of writing a small script to rename your files. Especially if you're willing to patch the Loader instead, which I can only hope you're actually overriding via MY_Loader instead of monkey-patching.
Reply

#12
(02-22-2016, 03:39 PM)kilishan Wrote:
(02-22-2016, 02:59 PM)mtvee Wrote: You do realize that if you build or deploy on windows that this naming convention is blissfully ignored? Which makes the convention not cross-platform which in turn, i would say, is more akin to pure ignorance. But whatever, it's a small, sad and pathetic patch to make this work as it should.

And you do realize that Windows isn't the only OS that runs web sites? Just because Windows and Mac are case-insensitive, doesn't mean you can blissfully ignore the fact that the *nix devices - which power a good majority of websites out there - ARE case-sensitive. That means the framework has to either a) check for all possible case combinations, or b) set a standard. That's why a standard has to be in place. I'm glad your chosen OS is case-insensitive, as is the one I develop on. But the framework has to work for everyone.

You've said that you were previously able to choose the case of your files, and I don't recall that being correct, though I haven't looked at CI2 internal code in quite a while. However, the docs did use all lowercase in the examples which caused many of us (myself included) to simply use lowercase file names.

But the bigger part here is that the change that made it standardize to ucfirst has been in the code for several years and now that 3.x has been released for several months it's a little late to have this discussion.

For the record, I wasn't involved at the time, so I cannot answer WHY the particular case-combo was chosen. However, if you look around at the wider PHP community, there's a large chunk of it that does use ucfirst, or camelcase to work with the different autoloading systems in place. So, while it's something we're not used to and sounds like a bit of a pain in your particular case, it's not as silly and pointless as it might appear.

Haha, I am well aware that *nix exists Smile Thank you for your response. I also appreciate that the bed has been made, as it were. I appreciate though that you have considered my point. As a scenario, it is quite simple the develop on windows with a controller in a file called 'wElCoMe.php' and have it work just fine as it is with the 3.x code. Of course when you go to deploy on *nix you are well and truly pooched. The convention I have always used with all my sources in any language is all lowercase for files. This is the first time I have encountered this problem. I don't what other frameworks do nor am I really all that interested. I have never encountered a scenario where I was forced in any language to have a certain case file so this is quite jarring, not to mention the thought of changing and testing the pile of sites I have deployed. Seriously, as bad as it is from theoretical level, I feel more comfortable patching 5 lines in the Loader than I do changing thousands of file names. It seems like the lesser of two evils forced upon me, and forgive me for saying so, but for no good reason.

Anyway, thanks again for responding Smile Best regards!
Reply

#13
(02-22-2016, 03:43 PM)Narf Wrote:
(02-22-2016, 02:59 PM)mtvee Wrote:
(02-22-2016, 02:48 PM)Narf Wrote: Less naming patterns to cover means less code (and less error-prone as well), which in turn means better performance and easier maintenance, at the very least.

Saying that this brings nothing and that there's no reason for it is pure ignorance.

You do realize that if you build or deploy on windows that this naming convention is blissfully ignored? Which makes the convention not cross-platform which in turn, i would say, is more akin to pure ignorance. But whatever, it's a small, sad and pathetic patch to make this work as it should.

Yes, I do realize that. You however don't realize that it is the convention that allows cross-platform operation.

Would you still complain if you had named your files in tHiS pAtTeRn on Windows and then it doesn't work on UNIX-bases OSes? If you're a reasonable person - you wouldn't, but if you insist that having a single convention is bad - it's really the same thing.

What's sad and pathethic is that you've spent your whole day ranting about this instead of writing a small script to rename your files. Especially if you're willing to patch the Loader instead, which I can only hope you're actually overriding via MY_Loader instead of monkey-patching.

Haha, thanks Big Grin
Reply

#14
(02-22-2016, 03:15 PM)kenjis Wrote: @mtvee has a point. Generally speaking, breaking BC is not good. And I don't see enough reason to drop non-capitalized files.

Having 2 files with the same name is not enough reason. Because it is okay that we have a priority rule.
For example, if there is `Welcome.php`, CI chooses it. If there is not, CI searches for `welcome.php`.

But personally, I like that the file name and case matches that of the class it holds.
So I'm satisfied with the current implementation.

When you have a lot of files, it is not hard to change the filenames. I wrote a tool.
https://github.com/kenjis/codeigniter3-filename-checker
But if I had 1000 file running site, and it does not have enough test code, I would not be happy.

Thank you Smile
Reply

#15
If you think this is an issue, then you oughta try using namespaces and a PSR type autoloader.

Also, if you have 1000s of files that need to be changed, how about write a script to do all the work for you. No matter the OS, you for sure have a terminal / command line. We are, after all, supposed to be devs/programmers, no?
Reply

#16
(02-23-2016, 12:39 AM)skunkbad Wrote: If you think this is an issue, then you oughta try using namespaces and a PSR type autoloader.

Also, if you have 1000s of files that need to be changed, how about write a script to do all the work for you. No matter the OS, you for sure have a terminal / command line. We are, after all, supposed to be devs/programmers, no?

Thanks for the reply. I guess what no one seems to want to own up to here is that this hasn't created something, it has changed something that already existed and changed it in a way that breaks for no good reason other than it looks prettier. Esthetics is not a good reason to leave people in the dust imho but alas, I am but one dissenter and the people have spoken. Thank you for the offer nonetheless Smile Best regards!
Reply

#17
(02-23-2016, 10:15 AM)mtvee Wrote:
(02-23-2016, 12:39 AM)skunkbad Wrote: If you think this is an issue, then you oughta try using namespaces and a PSR type autoloader.

Also, if you have 1000s of files that need to be changed, how about write a script to do all the work for you. No matter the OS, you for sure have a terminal / command line. We are, after all, supposed to be devs/programmers, no?

Thanks for the reply. I guess what no one seems to want to own up to here is that this hasn't created something, it has changed something that already existed and changed it in a way that breaks for no good reason other than it looks prettier. Esthetics is not a good reason to leave people in the dust imho but alas, I am but one dissenter and the people have spoken. Thank you for the offer nonetheless Smile Best regards!

You know why I replied to this thread at all? Because you kept repeating that there's no reason for this change and that it brings no benefits. You are now doing the same thing and ignoring what I said:

(02-22-2016, 02:48 PM)Narf Wrote: Less naming patterns to cover means less code (and less error-prone as well), which in turn means better performance and easier maintenance, at the very least.

Saying that this brings nothing and that there's no reason for it is pure ignorance.

It's fine if you don't care about performance and best practices, but you've no right to say anybody isn't owning up to anything if you'd be ignoring everything that's being said.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.