Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: Java compatibility issues (WAS: MF having issues?)
Richard<riplin@Azonic.co.nz> 03/08/06 6:09 PM >>>
>
>Frank Swarbrick wrote:
> 
>
>Actually you probably must not do that as it is not likely to do what
>you intend.

You're right.  As I said, I couldn't recall if == would compare string
values or just their references.  In C# it compares values.
 
>
>No. Not nicer.  I use Cobol to write Cobol programs.  There is no case
>statement at all in Python and I don't miss it.

I don't know Python, really, other than a little reading.  Can you show me
how you might code the equivalent of a case statement?
 
>
>The 'breaks' are not 'silly'.  They allow one to do:
>
>    case 1:
>    case 2:
>             dopart1and2;
>             break;
>
>or even drop through:
>
>    case 1:
>             dopart1only;
>    case 2:
>             dopart1and2;
>             break;
>
>But the break, or lack of it, is one of the bug traps in C-like
>languges. In Cobol one of the bug traps is not having an imperitive
>statement after a WHEN, or commenting it out, and having this drop into
>the next action.  Python eliminated the case statement exactly for the
>reason that doing so removes the opportunity to create bugs.

I think that one is much more likely to forget a 'break' statement than one
is to comment out a single COBOL statement and having it drop through.
Which is not to say that there isn't a third, better, way.  Such as,
maybe...

switch {
case 1:
or 2:
or 3:
dopart1;
case 4:
dopart2;
fallthru;
default:
doallothers;
}

Just off the top of my head, but this might be just as flexible and less
prone to mistakes.
 
myString 
>
>An == operator will only compare primitives. Object references are
>primitives, so Object == Object is only true if the two object
>references are identical, ie they both reference the same object.

Yep.  As I said in a previous message, I don't like this.  It seems to me
I'm much more likely to want to do a "value" compare than a "reference"
compare, so to me the "value" compare should be the "basic" compare.  Just
my opinion, obviously.

Frank


---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO  USA

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Swarbrick
03-09-06 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:16 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.