andrewducker: (no glasses)
[personal profile] andrewducker
Having now been using Java for 2 weeks I feel categorically able to make two definitive statements about terrible, terrible design decisions.

1) Case Sensitivity is a really stupid idea. When you're trying to debug your code the last thing you want to be doing is trying to spot which bit of a name you've miscapitalised. There's just no need for it any more - it's obviously a hangover from the days when the extra step of converting everything to the same case during compilation would have been an overload. Nowdays having to remember that MyPatternMatcher and myPatternMatcher aren't the same is just silly. Oh, and the fucking capitalisation of the built-in libraries, where everything starts with a lower-case character, but then has upper case characters for all following words (i.e. myList.getNextListEntry) is just plain fucked up - either words should start with a capital letter, or they bloody well shouldn't.

2) Zero Based Counting are just positively counterintuitive. I mean, yes, if you start counting at 1 then you might waste a teeny amount of storage, but it prevents the silliness that happens when you retrieve an array size and then access the contents of the entries up to _one less than that number_. Imagine trying to do this anywhere in life except in a computer program? Wait - we do! The British insist that there is a ground floor and _then_ a first floor, and look how stupidly confusing that is to everyone else. Again - back in the olden days this might have been acceptable, but it makes things actively less readable and is therefore BAD.

Thankfully it does have iterators, so I can live with that. And the latest version even has a ForEach statement, which is positively modern and useful.

Date: 2005-02-11 07:45 pm (UTC)
From: [identity profile] stillcarl.livejournal.com
REBOL doesn't have case-sensitivity.
REBOL doesn't use zero based counting.
REBOL does have iterators.
REBOL does have a foreach word.

What's your thoughts on operator precedence? REBOL just evaluates left to right and I've found once you get used to it, it makes little difference. We can use parens when necessary, but don't seem to need them as much as you'd think.

Date: 2005-02-12 11:37 am (UTC)
From: [identity profile] stillcarl.livejournal.com
REBOL's lovely, once you get to know it. Though easier to write than read. Its shortfalls are not in the language, (as far as I can tell), but in its (currently) slow development. Not open-source either, though there's movement in that direction.

Which means you probably won't find any jobs requiring REBOL abilities, so a language to learn for its own sake at the moment - unless you're a freelancer whose code isn't going to be passed on to others in the future.

Date: 2005-02-12 02:17 am (UTC)
From: [identity profile] skington.livejournal.com
Given that Java can't have spaces in method / class names, then the only way to indicate that a new word is beginning is by use of upper-case letters. And, yes, you could argue that that should apply to all words, including the one at the beginning, except that the dot / white space before the method call tells you that this is the beginning of the word. Why is it useful to have words not begin with a capital letter? Well, for instance, if they're not constants (I can't remember whether Java has a convention where constants are in all-caps or not, but many other languages do, as I recall).

Oh, and it's something you'll get used to in a bit. I mean, it's not as if you get run-time errors from mis-capitalisation, surely?

As for zero-based counting, I might agree with you if you hadn't used UK floors as an example. I'm not at all confused by UK floor numbering. In the UK, when we say "2nd floor", we mean "2 floors up from the ground floor". This might be initially confusing to a Merkin visitor, but on the other hand it also means that we can talk about floor -3, which is the sub-sub-basement (three floors below the ground floor), and if you go from floor -3 to the second floor, it will take five floors and that's obvious.

This is no use for arrays, of course, where there is no such thing as a negative array apart from, maybe, index -1 meaning the last element of the array - negative indexes wrap around as opposed to go into negative space - but I'm not here to make your arguments better for you ;-).

Date: 2005-02-12 05:00 am (UTC)

Date: 2005-02-12 09:35 am (UTC)
From: [identity profile] code-delphi.livejournal.com
Since I've been using C++ for pretty much my whole career, case-sensitivity and arrays that start at element 0 seem entirely natural. It's amazing what you can get used to! Think of it as an offset into memory, and it makes sense (admittedly there's absolutely no need to conceptualise that in a high-level language like Java, but c'est la vie).

The idea of a language not being case sensitive is... weird. That'd be like, you know, Basic! Takes me back to my early teens, where I labouriously typed in the code for adventure games (long before I knew it was called "code") from a wonderful collection of kids' books, into my not-so-trust Tandy Color Computer (or "CoCo"), to be saved on audio cassette. Dear God™, I can hear it even now...

Date: 2005-02-14 08:53 am (UTC)
From: [identity profile] channelpenguin.livejournal.com
On arrays. In VB(6) I always used

For i = LBound(ArrayVar) to UBound(ArrayVar)

No bounds problems AT ALL. For collections always used 'for each'. Of course with various external libraries' homerolled collections it was often a guess as to whether it was 1 to .Count or 0 to .Count -1, and often people just didn't know how to implement 'for each' in VB (it was a trifle obscure to say the least!)

In C#, I use foreach (actually I may have got a teeny bit sloppy on that one, must check!)

Date: 2005-02-14 12:03 am (UTC)
darkoshi: (Default)
From: [personal profile] darkoshi
I sort of agree with you on #2, but I'm quite used to having arrays start at zero. And it can be quite confusing to me now, trying to remember which languages have the arrays start with 1 instead of zero.

As for case-sensitivity, I have no problem with it. I get annoyed when reading VB code where the same variables are capitalized differently on different lines... How can they be read as the same variable if they even look different!

Using lowerUpperCaseSyntax makes sense to me, because variables usually start in lower case, but capitalizing the other words makes them easier to read. Whereas names that start with uppercase are usually the names of classes, and all-uppercase is used for constants. Or sometimes, starting with a lower-case letter is used for private variables & functions, while starting with an uppercase letter is used for public ones... I suppose you're right, it can get confusing.

Date: 2005-02-14 12:11 am (UTC)
darkoshi: (Default)
From: [personal profile] darkoshi
and I don't think I've ever had to debug to find a problem due to use of the wrong case... the compiler always catches those, and even usually tells you which word is wrong, or at least which line has the problem. Even if you have a variable and a class with the same name, but capitalized differently, usually you can't use the variable in a place where a class is expected, nor vice versa, so you get compiler errors if you mix them up.

But if did have to debug to find this kind of problem... I wonder what kind of interesting code you had, that the compiler didn't catch the error? Or... maybe you use "debugging" to also mean fixing compile-time errors, and not just runtime ones.

Date: 2005-02-14 09:01 am (UTC)
From: [identity profile] channelpenguin.livejournal.com
lowerUpperCase (known, IIRC as 'camel case') is used by C/C++/Java bods for internal variables, and SentenceCase for anything externallly visible.

thus:

private string firstName;

public string FirstName
{
get {return firstName;}
set {firstName= value;}
}

Otherwise you have to use some form of hungarian (mFirstName, _FirstName) or a totally different name (naff beyond naff). I'm slowly coming round ot this one.

MY pet hate (and Sean's too - and he has had WAY longer and WAY more exposure to hate) is

private void Horrible{
//stuff
}

instead of

private void Nice
{

Date: 2005-02-15 11:37 am (UTC)
From: [identity profile] opusfluke.livejournal.com
I'm just starting to learn Java and you're scaring me. AS for the ground floor/first floor thing that's nothing! What about a billion? I'm British, dammit, and a billion is one million million NOT one thousand million! And we should go back to calling tungsten "wolfram" while we're at it.

January 2026

S M T W T F S
     1 2 3
45 6 7 8 9 10
11 12 13 1415 16 17
18 19 20 21 22 23 24
25 26 27 28293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 29th, 2026 07:31 am
Powered by Dreamwidth Studios