473,785 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Breaking backwards compatibility - good or bad?

If you have any PHP scripts which will not work in the current releases
due to breaks in backwards compatibility then take a look at
http://www.tonymarston.net/php-mysql...verything.html and see if
you agree with my opinion or not.

Tony Marston
http://www.tonymarston.net

Dec 20 '05
150 6585
On 22 Dec 2005 01:51:24 -0800, to**@marston-home.demon.co.u k wrote:
In order to determine if two strings match entirely based on case you
have to take a lot of things into consideration. It's no longer
sufficient to say A-Z maps to a-z.
You are talking about the *contents* of variables, whereas I am talking
about the *names* of variables. There is a BIG difference between the
two.


Umm, no I'm not. All languages are written in English and ASCII.
Java, for example, is written in Unicode (UTF-8).
That is what I have been used to for decades, and I see absolutely no
advantage in being forced to switch.


So you're main argument is that it's not what you're used to -- so it
should be changed. Isn't that the attitude that your entire article
was arguing against??

Dec 22 '05 #41
On 22 Dec 2005 01:21:40 -0800, to**@marston-home.demon.co.u k wrote:
Ask Dennis Ritchie.


No, I'm asking you. What problem existed in the case-insensitive world
that could ONLY be solved by introducing case-sensitivity?


Many many years ago it was done for compiler performance reasons. It
does require lots of extra cycles to lower-case every single
identifier in a large C application.

Might seem like a poor reason now, but as a COBOL/Mainframe programmer
should appreciate it -- It was only 2 extra bytes to store the entire
year but somebody decided that was too much.

Dec 22 '05 #42
Chung Leong wrote:
Oli Filth wrote:
I agree, it's a widespread success, but its also a big sprawling heap of
hacks, afterthoughts, inconsistent function names and parameter lists,
function aliases, issues with references that no-one really knows how to
deal with, version incompatibiliti es, nonsense like magic quotes, ...
That's what I was hinting at.
Aesthetics. Aesthetics. Perhaps one of these days you will come to grip
with the nature of this world. The ugly win because they do what it
takes to win, while the beautiful disappear into oblivion.


In the 21st Century, where programming is as much about team-based
development and code maintenance planning as it is about knocking out
lines of code, aesthetics *are* massively important, IMO. Code that's
more consistent and easier to read is easier to understand, and easier
to hand over to another team member.
Note that despite the stance I appear to be taking, I definitely don't
agree with all the changes between 4 and 5, nor the proposed changes in
6. I see no advantage in changing constructor names to __construct,
changing the name of $this, continually changing string indexing syntax
back and forth, nor adding polymorphism of statics, for instance.

Incidently, I say the same thing to my historian friend, who, despite
all empirical evidence to the contrary, thinks that the principled
politician would always carry the day.
I wish it were true...!

I wasn't referring to "critics" in the sense of academics, but to
real-world programmers who might have wanted to use PHP if it weren't
such a mess (compared to other languages).


Let them use whatever language they were using then. What's this crazy
obsession with needing to "convert" people?! PHP is not a religion--it
is a tool.


It's not a matter of trying to "convert" people, no-one's going to go
"oh, I've seen the light, PHP is better than C++, what have I been doing
all these years". But a large user-base (and incoming users with skills
and techniques from a different language) will benefit the PHP community
and existing users. A more focused language with better OO support and
less inconsistency will benefit existing users doing new development.

From an engineer's point of
view you wouldn't alter a product to suit the desires of people who
aren't even using it--because it's goddamn stupid.


Umm, if you were trying to sell a product and there was an untapped
market, of course you would try to make future versions of your product
more attractive to them. Now obviously, PHP isn't being made for money,
but the developers probably have much the same goals as if they were
indeed selling it.

In the same way that hosts have to make a decision - do we want to keep
our existing customers happy by sticking with PHP 4 and push away
potential customers to other hosts that run ASP .NET or Java, or do we
want to attract new customers by running PHP 5 (or 6, when the time
comes), at the expense of making our customers make some trivial
revisions to their code? (When I say trivial, I mean that the actual
replacements themselves are trivial, the scale of the job may not be...)

Personally, I can't see why hosts can't run both 4 and 5, and keep
everyone happy.

Bad coding *can* get you closer to a working (in one sense of the word)
program - I've seen countless posts in PHP newsgroups where newbies have
asked things like "How can I loop through my variables $thing1,
$thing2...? "


That's just igorance. We all know that using an array in this
particular situation is easier. And once someone learn an easy way to
do something, he/she wouldn't go back.


It's not necessarily about ignorance about individual issues. Being a
good programmer/software designer is about being able to take a top-down
view and work out, a priori, why certain approaches are better/more
applicable than others, rather than having to be told on a case by case
basis.

to which the answer is "use arrays instead", to which
their response is "well, my variables do the job, so why should I?".


Very good question to ask in fact. If all you can offer is a
non-technical value-judgement: "it's good practice," then you're a sort
of priest of programming, not a software engineer.


You're right, it is a good question.

We all know that there are sound reasons behind most "good practice"
paradigms. The problem is that they're often quite hard to explain
concisely to relative newbies whose first and only exposure to
programming is PHP, and this is their only frame of reference. A frame
of reference where so many things are allowable, many of which will kick
them up the arse at a later date when their projects get larger and more
complex, and they realise that there's more to creating software than
just getting any old thing to work.

If someone's new to OO, for instance, but have found that there's this
neat thing called classes, if they discover classes through PHP then
more often than not they seem to end up trying to do things like using
classes as glorified arrays ("how can I loop through my class
members?"), or some bizarre reverse-polymorphism ("how can I find the
name of the function that called/created my object, so that I can get it
to different things accordingly?"). Completely missing the point, and
therefore the benefits, of OO. Trying to explain to them why abstract
base classes are beneficial, or why a class with only static members
isn't the same as a singleton, or why polymorphism is better than
dynamically defining classes, is extremely difficult.
--
Oli
Dec 22 '05 #43
Wayne wrote:
A common Java idiom is:

Foo foo = new Foo();

The convention in Java is that class names begin with an upper-case
letter and variables begin with a lowercase variable. I can clearly
see what is happening here.

To get the same meaning if it was case-insensitive, you'd have to do
something like:

FooClass fooInstance = new FooClass()

Which makes readability worse, not better.


In Delphi, the convention is to begin class name with the letter T.

foo :TFoo
[...]
foo := TFoo.Create();

The readability here is superior here than what you have in Java,
especially for letters where capitalization involves only a size
change: "Window window," "Vector vector," "Stream stream," etc.

Dec 22 '05 #44
>> I disagree. I have worked for decades with case-insensitive languages
and I have always treated $FOO and $foo as the same variable.
But I didn't say $FOO or $Foo. I said $foo and $foO!
Any programmer who deliberately mixes case like that is a candidate for
the unemployment queue.
People have no
trouble will all caps or the first letter capitalized. What about the
difference between setsLower() and setSlower()? To a human reader
those have different meanings,
Not to me, they don't. When writing a program I am writing in a
language that a computer understands, so I have to *think* like a
computer. To a computer the case of a word is irrelevant, and so is
it's pronunciation.
to a case-insensitive compiler they are
the same.


And to a person who has been using case-insensitive compilers for 30
years they are the same.

Dec 22 '05 #45
>> some like all upper case,
My god. I wouldn't want my code constantly shouting at me. All upper
case is harder to read, too.


In my current (non-PHP) contract the convention is that everything
which is part of the language (variable and function names) is
lowercase while evreything created by a programmer is in UPPER case.
Different organisations have different conventions, but if the compiler
is case-insensitive I really don't see the point. The argument that the
use of case *must* be consistent doesn't hold water. It's so low on the
scale of things which are *imporatnt* that it doesn't even register.

Dec 22 '05 #46
>> What I object to is being told that I MUST use one case or the other just to be
*consistent* with everyone else, especially when I disagree with their
reason for choosing one case over the other in the first place.
The majority of programmers disagree with you on this. Consistency
and conventions are preferred when working on a particular project or
platform -- it cuts down on errors and allows one to convey greater
meaning.


I disagree. The majority of programmers that I have worked with on
case-insensitive languages do NOT like being told that case is suddenly
important, that you must use one in preference to the other. It is like
saying that although the language allows you to do something either
*this* way or *that* way from now on everybody MUST do it *that* way
for no other reason than to be consistent.

Dec 22 '05 #47
>> By introducing case-sensitivity you are suddenly saying that $FOO and
$foo are now different, which goes against the grain of everything that
I have been taught since my first day at school way back in the last
century.
A common Java idiom is: Foo foo = new Foo(); The convention in Java is that class names begin with an upper-case
letter and variables begin


Who gives a toss about how java does it? This is a PHP topic.

Dec 22 '05 #48
>> Your second statement contradicts the first, but at last you agree that
having $FOO and $foo point to different things is not a good thing.
It's not exactly a contradiction.. . I wouldn't allow both $foo and
$FOO in the same program. In a case-insentive language that's
allowed. I would want that completely disallowed.


So you are forcing your personal preferences upon everyone else. That
sucks.

Dec 22 '05 #49
>> That is what I have been used to for decades, and I see absolutely no
advantage in being forced to switch.
So you're main argument is that it's not what you're used to -- so it
should be changed. Isn't that the attitude that your entire article
was arguing against??


So why should I have to change MY programming habits just to match YOUR
programming habits? Who put you in charge?

Dec 22 '05 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1787
by: Jason Mobarak | last post by:
Greetings! Say that it's desirable to provide backwards compatibility for methods of an object, consider the case where... class Foo: def bar (self, a, b): pass ....is a defined class that can be serialized and later be deserialized.
7
2151
by: Sonny | last post by:
I need to port a library that is written entirely in C to C++. The library is supported on quite a few platforms (windows, Solaris, Linux, AIX, HP-UX, OSX, etc...) and there's quite an existing customer base that uses it. I need to maintain backwards compatibility such that existing users won't have to do anything to their existing applications other than a re-compile when they upgrade to this new version of the library. I figure that I...
70
4071
by: py | last post by:
I have function which takes an argument. My code needs that argument to be an iterable (something i can loop over)...so I dont care if its a list, tuple, etc. So I need a way to make sure that the argument is an iterable before using it. I know I could do... def foo(inputVal): if isinstance(inputVal, (list, tuple)): for val in inputVal: # do stuff
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.