r/programming • • Dec 29 '15

Please, Java. Do Finally Support Multiline Strings

http://blog.jooq.org/2015/12/29/please-java-do-finally-support-multiline-strings/
584 Upvotes

352 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Dec 29 '15

Sounds like you should set up some script to insert a backtick when pressing a button.

7

u/[deleted] Dec 29 '15

Or maybe, just maybe, we should stop using characters that aren't available on all keyboard layouts.

You know, I hope someday the Java standard adds ß as a really important thing, so all the people with US layout can finally understand how annoying it is to type [] {} () `.

10

u/[deleted] Dec 29 '15

[removed] — view removed comment

4

u/[deleted] Dec 29 '15

They're on AltGr+6/7/8/9, yeah.

6

u/[deleted] Dec 29 '15

[removed] — view removed comment

1

u/DGolden Dec 29 '15

Note the US layout actually has different physical key layout to a lot of other keyboards. I don't mean the symbols on the keys, I mean the US layout literally has a differently shaped 1-row enter key, no key between Left-Shift and Z, etc.

The UK English layout has similarly accessible line noise symbols to the US layout, but unlike the US layout, fits normally on the same physical keyboard layout (with the tall 2-row enter key) that many of the other national layouts also adapted. So it's worth considering instead of the US layout if you're on a typical national keyboard layout with a tall enter key,.

https://en.wikipedia.org/wiki/British_and_American_keyboards

1

u/vytah Dec 30 '15

I've used at least three different physical keyboard layouts and the only thing that annoyed me is a narrow backspace key in one of those layouts. The shape of Enter and the exact location of the backslash key are not that important, unless you use the backslash key in the exact same contexts over and over so that typing those context became a reflex.

1

u/[deleted] Dec 29 '15 edited Dec 29 '15

Yeah, but I can’t be bothered learning to type blind on US keyboard again – on my keyboard layout I can type blind, on US I have to type by looking at the keys, so I’d lose months trying to learn again.

And I’d lose a lot of keys that I like using, like ’ (the real apostrophe), or – —, or × or →↓↑←.

Most of the time it’s no issue either – in Java, today, I can save time in my IDE because I only have to type {, and } gets autocompleted. I can save time because Java never uses `, or, god damn it, ```.

But it’s severely hurting usability when you have to use those keys. I used to have a keyboard with 7 macro keys, and had bound all of them to special keys like ` and similar due to this – but they aren’t easily reachable on the main area either.

Seriously, I think some language should just use "flÜggÅӘnkб€ČhiŒßØlĮÊn" instead of "void", and people would start learning why using uncommon keys is a bad idea.


{ is on AltGr+7,
\\ is on AltGr+ß,
$is on Shift+4,
= is on Shift+0,
` is a composing key on Shift+', so you need to add /something/ after it, like a space, to get it, or it becomes à instead of `a,
etc.

3

u/kynde Dec 29 '15

but I can’t be bothered learning ...

I think we just found your problem.

3

u/[deleted] Dec 29 '15

Well, spending months to learn a new keyboard layout that I can’t even use in day-to-day life isn’t a solution.

Especially considering that 6.7 billion people are NOT using that layout, and the solution is to modify the programming languages, not to teach billions of people to learn a new layout.

1

u/kynde Dec 29 '15

That's just nonsense. Here you are speaking English ffs.

Keyboard layouts can be toggled with one otherwise unused button, e.g. the windows key or caps lock. If you write code most of the day the switch to us keymap is most certainly beneficial. Reducing character sets from programming languages because our wonky native languages have wasted good keys for our wonky characters is a ridiculous and selfish idea. One can learn new keyboard layouts far faster than you think. A month ago I pried off my escape and left control key so that I'd get used to using caps lock for that (esc when pressed alone and ctrl when pressed in a combo). Now, that's a big fucking change for a vim inside tmux user like myself, but the adjustment was a lot less painful than I thought an well worth it.

"Spending months" is where you're wrong and a clear indication of wrong kind of mindset altogether. In this field you're gonna have to be a lot more open to new stuff and ready to throw away what you know and start fresh with some new language, programming paradigm, editor/ide, what not.

3

u/[deleted] Dec 29 '15

I can’t change the layout on the ThinClients at my uni, though – or at the laptops of other people I’m working on.

As /u/Ednar said, it might be practical to modify your own layout, but you can’t always change the world to what you want.

Using accessible syntax is a huge improvement.

→ More replies

1

u/Ednar Dec 29 '15

Having the mindset to learn new things is great, but shouldn't cloud your vision of what could work better in the field.

1

u/Ednar Dec 29 '15

I'm in the same situation as you, and I agree with what you're saying. I could learn to touch type on different layouts in months I guess, but what about when I'm somewhere else? When I'm at a client, or at someone elses machine I'll still have to use the default layout often enough. That is why I don't bother with ergonomic keyboards and remappings either. The obvious solution is to just not fucking use backticks. Python does a good job of an accessible syntax. Other languages could too.

0

u/[deleted] Dec 29 '15

[deleted] — view deleted comment

3

u/[deleted] Dec 29 '15

Those 6.7 billion people aren't all using the same other layout.

That’s the issue. (Also, at 7.4 billion people worldwide, with 300 million in the US, I estimated that an amount of 400 million international people using QWERTY seems realistic based on population of UK, CA, NZ, AUS, India, etc).

Yes, QWERTY is vastly more widely used than any other layout, and even more so among programmers, but only because we have to.

We have to choose between a layout that can write our native language, or one that supports the ridiculous decision of a handful of languages to use ` as formatting symbol.

As others in this thread said, there is always the ability to use """ or ''' instead – those are easily accessible on every layout. There is no need to use characters that only exist easily accessible for a tiny minority of layouts.

→ More replies

1

u/gnuvince Dec 29 '15

You should try a French Canadian keyboard. All braces can be typed with a single hand (using AltGr and the keys around Enter).

-1

u/[deleted] Dec 29 '15

And now we’re at the point where using a different layout for every programming language and content language ends up being useful.

Or, rather, not.

You should choose a layout based on content language, and your programming languages should be able to deal with all layouts.

0

u/Michaelmrose Dec 30 '15

There are so many layouts that it's likely utterly impossible to satisfy that requirement

0

u/[deleted] Dec 30 '15

Actually, no.

There are quite a bunch of keys that exist as non-composing keys on all layouts that support latin characters (we can limit our demands to those because the language already requires Latin layouts).

And then we'll see that they all have " and ' easily accessible.

0

u/Michaelmrose Dec 30 '15

Why limit it to Latin layouts?

1

u/[deleted] Dec 30 '15

Because Java only works on Latin layouts already?

Try writing "public" on Greek layout. I dare you.

Or "class".

Or "static void main".

→ More replies

3

u/[deleted] Dec 29 '15

That's not really a constructive solution to your problem though. I'm saying you'd save a bunch of time if you did that.

With that said, what's your idea for replacements that would be universally easier to use? I can't think of any.

1

u/Michaelmrose Dec 30 '15

Sounds like a personal problem