Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Xarn
Jun 26, 2015

Internet Janitor posted:

Is the objection the usual golang-esque "explicit for loops are easier (for me) to understand than functional pipelines" or is it something more creative?

Streams are not explicit enough for him.


Some more content: Our current C++ codebase doesn't use RAII and is extremely vulnerable regarding order of destruction, to the point where destructing TCP/IP server before all clients properly disconnect hangs the destructor. :suicide:

At least I started with guerilla introduction of ScopeGuards.

Adbot
ADBOT LOVES YOU

sarehu
Apr 20, 2007

(call/cc call/cc)

Xarn posted:

Some more content: Our current C++ codebase doesn't use RAII and is extremely vulnerable regarding order of destruction, to the point where destructing TCP/IP server before all clients properly disconnect hangs the destructor. :suicide:

A codebase full of low-hanging fruit! Have fun.

Karate Bastard
Jul 31, 2007
Probation
Can't post for 18 hours!
Soiled Meat
The reason code is easier to write than to read is that the goal of every maintenance programmer is to stay employed, and the goal of every consultant is to be consulted again.

Xarn
Jun 26, 2015

sarehu posted:

A codebase full of low-hanging fruit! Have fun.

Now I only need to convince my employer and the rest of the team to let the New Guy (2 months) run roughshod through the code. :v:

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Soricidus posted:

it's a mixture of the two. the fundamental issue is that arabic is a bidirectional script. bidi text processing doesn't mean "can handle right-to-left languages as well as left-to-right languages", it means "can handle languages that flip between left-to-right and right-to-left within a single sentence, or indeed sometimes word"...

:magical:

Makes me really curious what a text encoding and display system designed by Arabic speakers with no exposure to ASCII or Unicode would look like.

Linear Zoetrope
Nov 28, 2011

A hero must cook
Not an Arabic speaker, but if I had to do it, I'd use directional meta-characters. Define codepoints for "begin right to left" and "begin left to right" (maybe add in up-down and down-up in there, so you can handle right-to-left up-to-down Japanese and Chinese and such). Then instead of trying to auto-handle direction switching you just press something akin to a caps-lock key which changes the directionality of the characters. There's still some details about text justification (should entire sentences in right-left be right justified?), but I think those are solvable with the system in place.

Linear Zoetrope fucked around with this message at 20:03 on Oct 19, 2015

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Xarn posted:

Now I only need to convince my employer and the rest of the team to let the New Guy (2 months) run roughshod through the code. :v:

Why else would you hire someone if not to change the code?

Jsor posted:

Not an Arabic speaker, but if I had to do it, I'd use directional meta-characters. Define codepoints for "begin right to left" and "begin left to right" (maybe add in up-down and down-up in there). Then instead of trying to auto-handle direction switching you just press something akin to a caps-lock key which changes the directionality of the characters. There's still some details about text justification (should entire sentences in right-left be right justified?), but I think those are solvable with the system in place.

https://en.wikipedia.org/wiki/Right-to-left_mark

Linear Zoetrope
Nov 28, 2011

A hero must cook

Ah, so that is how they do it. Reading the algorithm spec, I think the problem comes in the "implicit directional markers", rather than just having a drat key people press to explicitly decide the direction. Text direction should just never be allowed to be implicit.

Linear Zoetrope fucked around with this message at 20:07 on Oct 19, 2015

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Jsor posted:

Ah, so that is how they do it. Reading the algorithm spec, I think the problem comes in the "implicit directional markers", rather than just having a drat key people press to explicitly decide the direction. Text direction should just never be allowed to be implicit.

Implicit marks aren't really implicit in that sense (or they wouldn't be marks), they just don't have a visible rendering. Nothing in the Unicode bidi spec places constraints on how input behaves, and I think most systems tie directionality to keyboard layout unless manually overridden by the user, so there is indeed a key people press to go into entering Hebrew (default RTL) in the midst of German (default LTR).

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Jsor posted:

Not an Arabic speaker, but if I had to do it, I'd use directional meta-characters. Define codepoints for "begin right to left" and "begin left to right" (maybe add in up-down and down-up in there, so you can handle right-to-left up-to-down Japanese and Chinese and such). Then instead of trying to auto-handle direction switching you just press something akin to a caps-lock key which changes the directionality of the characters. There's still some details about text justification (should entire sentences in right-left be right justified?), but I think those are solvable with the system in place.

Additional constraint: it's 1975 and those direction indicators cost too much precious memory/storage according to your boss and the accounting department.

Basically I'm wondering what we'd have to deal with if the entire computing revolution came from the Arabic-speaking world. I'm guessing there'd be an ASCII-alike where some character range was supposed to print one way and some the other and software was just expected to deal with it. Oh and since this is an alternate reality where IBM is based in Qatar, everyone has to deal with this encoding as the foundation of Unicode, including the implicit direction changes. Also porn filters have become strong AI.

JawnV6
Jul 4, 2004

So hot ...

Jsor posted:

Ah, so that is how they do it. Reading the algorithm spec, I think the problem comes in the "implicit directional markers", rather than just having a drat key people press to explicitly decide the direction. Text direction should just never be allowed to be implicit.
You\'re still not solving \"user clicks mouse on text stream with expectations\" in a way that doesn\'t leave a bunch of goofy detritus in the buffer. Like clicking in the middle of something and retyping the last few characters to preserve formatting or getting frustrated and having a bunch of direction indicators stacked up between every number.

nielsm
Jun 1, 2009



More interesting, how would they deal with characters that render differently depending on their position in a word? Do the presentation forms (encode the rendering) and have software manage normalization, or encode normalized and select glyphs on rendering depending on context?

Maybe we'd have 9 bit bytes as the normal instead, split into 3 triplets written octal.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

JawnV6 posted:

You\'re still not solving \"user clicks mouse on text stream with expectations\" in a way that doesn\'t leave a bunch of goofy detritus in the buffer. Like clicking in the middle of something and retyping the last few characters to preserve formatting or getting frustrated and having a bunch of direction indicators stacked up between every number.

IBM's algorithm handles this, I believe. You need directionality hints on the caret though.

E: also, loving the escaped chars. A horror somewhere no doubt.

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
Makes me appreciate how stupidly simple roman characters are in comparison.

Space Whale
Nov 6, 2014
"So this test that was disabled in TeamCity a year ago? I don't know why it was turned off, but it works on my machine, so I'm gonna push that now."

:what:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Space Whale posted:

"So this test that was disabled in TeamCity a year ago? I don't know why it was turned off, but it works on my machine, so I'm gonna push that now."

:what:

The horror is that someone turned off a failing test instead of fixing it.

Linear Zoetrope
Nov 28, 2011

A hero must cook
Once on one of my open source projects somebody committed a single unit test that just called every function in a way that explored every code path without actually testing anything just so the coverage said 100%. :negative:

orenronen
Nov 7, 2008

Jsor posted:

Not an Arabic speaker, but if I had to do it, I'd use directional meta-characters. Define codepoints for "begin right to left" and "begin left to right" (maybe add in up-down and down-up in there, so you can handle right-to-left up-to-down Japanese and Chinese and such). Then instead of trying to auto-handle direction switching you just press something akin to a caps-lock key which changes the directionality of the characters. There's still some details about text justification (should entire sentences in right-left be right justified?), but I think those are solvable with the system in place.

My native language is RTL. The main problem with bidirectionality isn't that Arabic and Hebrew switch randomly between RTL and LTR -- the languages themselves are completely RTL. It's just that modern speakers use the occasional English word in the middle of the text, and (much more commonly) write numbers like the rest of the world does. So if I want to type the number "123" in the middle of my Hebrew text I expect to type in 1 and then 2 and then 3 and have it appear in the expected order. This gets complicated when you consider things like a decimal point that may also be a sentence-ending period in certain contexts. Also, hyphens and commas and most other punctuation marks.

Expecting someone to push a special key every time they want to enter a number isn't very practical, so we get the algorithms we have today, which more often than not do the right thing. Good word processors also offer the option to input the invisible directionality characters explicitly.

Linear Zoetrope
Nov 28, 2011

A hero must cook

orenronen posted:

My native language is RTL. The main problem with bidirectionality isn't that Arabic and Hebrew switch randomly between RTL and LTR -- the languages themselves are completely RTL. It's just that modern speakers use the occasional English word in the middle of the text, and (much more commonly) write numbers like the rest of the world does. So if I want to type the number "123" in the middle of my Hebrew text I expect to type in 1 and then 2 and then 3 and have it appear in the expected order. This gets complicated when you consider things like a decimal point that may also be a sentence-ending period in certain contexts. Also, hyphens and commas and most other punctuation marks.

Expecting someone to push a special key every time they want to enter a number isn't very practical, so we get the algorithms we have today, which more often than not do the right thing. Good word processors also offer the option to input the invisible directionality characters explicitly.

I mean, sure, having two extra keystrokes is annoying, but IMO in almost all cases dealing with input, except perhaps document search (Google can get much better results than you by guessing what you mean), explicitness beats algorithmic guessing. But then, I'm the person who throws superfluous safety parens all over their code.

In my "ideal" system, any text's display behavior is undefined if the first character isn't an ordering character (which good word processing software would auto-insert based on your locale), but I can understand how for most people that'd be annoying (and also defeats the "imagine this is 1975" idea as well).

Linear Zoetrope fucked around with this message at 04:51 on Jan 29, 2019

pseudorandom name
May 6, 2007

feedmegin posted:

A non-printing codepoint that flags up 'from now on everything is Chinese' (or Japanese, or Korean) would have the same effect with much less breakage, surely.

The U+E0000 block is exactly this, although it was deprecated in 2008 for some reason.

No Safe Word
Feb 26, 2005

Jsor posted:

Once on one of my open source projects somebody committed a single unit test that just called every function in a way that explored every code path without actually testing anything just so the coverage said 100%. :negative:

Can't argue with the metrics!

AWWNAW
Dec 30, 2008

Xarn posted:

I just had an argument with colleague about programming languages.

Apparently, Java streams are ruining Java. Don't even ask about LINQ.

Out of curiosity, how old are they? The people I've seen that are really afraid of LINQ, lambda, stream-style, etc., are all older programmers that haven't advanced their knowledge of techniques in the past 10-15 years.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

No Safe Word posted:

Can't argue with the metrics!

hi boss

Xarn
Jun 26, 2015

AWWNAW posted:

Out of curiosity, how old are they? The people I've seen that are really afraid of LINQ, lambda, stream-style, etc., are all older programmers that haven't advanced their knowledge of techniques in the past 10-15 years.

23 I think, maybe 24.

KaneTW
Dec 2, 2011

Xarn posted:

23 I think, maybe 24.

Jesus wept.

TheresaJayne
Jul 1, 2011
I am a lot older than that, I have no problem with LINQ and other new stuff - I love the extension methods of C# and wish they were better implemented in Java.

beuges
Jul 4, 2005
fluffy bunny butterfly broomstick

AWWNAW posted:

Out of curiosity, how old are they? The people I've seen that are really afraid of LINQ, lambda, stream-style, etc., are all older programmers that haven't advanced their knowledge of techniques in the past 10-15 years.

I think it's probably just as likely with younger devs just out of college or whatever, whose only exposure to programming has been simple assignment-level stuff, so when they see these more advanced, complicated language features or frameworks, they don't have the insight to be able to fathom a system that could be so complicated as to require something like this, or, more likely, because the concept is "hard" to understand (e.g. using lambdas), and because they can achieve the same result of the one-liner lambda with a half-page of writing explicit functions using the techniques they already understand, they don't see the point of the new features when you can already achieve the same results in a supposedly "easier to understand" way.
I have a nephew who just started work this year after completing a year-long IT/development course after high school, and his stubbornness to accept better ways of doing things is sad, considering that he's bright enough to be able to write code at his level that works well. He also proudly tells me about how he's gotten into "heated arguments" at work... when I dig deeper about what the arguments were about and what his reasonings were for putting forward the arguments that he did, it's blatantly clear that he has only surface-level knowledge of the topic from reading a few blogs, and has no actual practical experience with the concepts being argued.

Linear Zoetrope
Nov 28, 2011

A hero must cook
Huh, I just looked up Java lambdas and they're kinda weird (I think Java lambdas are also closures?). They're functionally the same as in other languages, but it looks like they're married to one-method interfaces for some reason I assume is because of the type system? I dunno, they seemed sorta confusing to me even though I've used various permutations of "lambda" and "closure" in 3-4 other languages (in fact, I probably abused lambdas in Python a bit too much)

Volte
Oct 4, 2004

woosh woosh
Young, intermediate-level developers have the most stubborn and unjustifiable dogmas about programming from what I've found. It's like when young people get politically motivated and start incorporating obvious propaganda into their worldview without questioning it. This is how we end up with Ruby programmers, people.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Java lambdas are literally syntactic sugar for anonymous classes with one method. This is why Java 8 added better type inference for single-abstract-method interfaces; every place in old code that already used this feature to achieve the effect of a lambda and every API equivalent to a lambda is forward-compatible.

canis minor
May 4, 2011

I bitch about inline styles, so the CSS guys put in a link to a stylesheet for a specific two column markup. Yay, no inline styles here!

:suicide:

(the two column markup is already supported with the grid system that we have. this example reflects the "don't delete any CSS rules, every loving new markup needs to have additional new classes" methodology that once made our CSS grow into megabytes)

loinburger
Jul 10, 2004
Sweet Sauce Jones

Volte posted:

Young, intermediate-level developers have the most stubborn and unjustifiable dogmas about programming from what I've found. It's like when young people get politically motivated and start incorporating obvious propaganda into their worldview without questioning it. This is how we end up with Ruby programmers, people.

In grad school I had a group project in a Java software engineering course with somebody who had about five years of experience with programming in the real world, and she insisted that every Java class had to correspond to a physical object. Like, you could have a Car class, but you couldn't have a Command class because commands aren't physical objects. (A Queue would be fine because they'd all be Queues of physical objects.) Our textbook and the professor both said that classes could represent abstract things, but she said they were wrong. After a few weeks she rewrote all of the other group members' code, we all rejected her changes, and she threw a fit and dropped the class.

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

loinburger posted:

In grad school I had a group project in a Java software engineering course with somebody who had about five years of experience with programming in the real world, and she insisted that every Java class had to correspond to a physical object. Like, you could have a Car class, but you couldn't have a Command class because commands aren't physical objects. (A Queue would be fine because they'd all be Queues of physical objects.) Our textbook and the professor both said that classes could represent abstract things, but she said they were wrong. After a few weeks she rewrote all of the other group members' code, we all rejected her changes, and she threw a fit and dropped the class.
So what in God's name did her "rewrite" look like? I'm trying to figure that out, and my brain isn't fractured enough to do so.

Pavlov
Oct 21, 2012

I've long been fascinated with how the alt-right develops elaborate and obscure dog whistles to try to communicate their meaning without having to say it out loud
Stepan Andreyevich Bandera being the most prominent example of that
Obviously it was a single class called 'World', because the world is a physical thing.

loinburger
Jul 10, 2004
Sweet Sauce Jones

Zemyla posted:

So what in God's name did her "rewrite" look like? I'm trying to figure that out, and my brain isn't fractured enough to do so.

It was an inventory management system, so there actually were quite a few physical objects for her to work with. The real problem was her UI code, which had a single class: Screen, since that's the only physical part of the UI (windows and the like aren't real enough)

IT BEGINS
Jan 15, 2009

I don't know how to make analogies
Small dev horror. Asked one of our senior devs to pair with the new guy to work on adding a feature to our 'remote' authentication. Asked him to also test drive it or at least cover it so some of the guys that are new to testing have a real example to look at.

Got told "it will only confuse the new guy" and "it's a terrible specimen to test" because it requires "heavy mocking of the incoming request". :doh:

lord of the files
Sep 4, 2012

Xarn posted:

Streams are not explicit enough for him.


Some more content: Our current C++ codebase doesn't use RAII and is extremely vulnerable regarding order of destruction, to the point where destructing TCP/IP server before all clients properly disconnect hangs the destructor. :suicide:

At least I started with guerilla introduction of ScopeGuards.

the chaining of streams can get a bit messy especially with byte streams.

i am all for java streams, but you’d think that they would figure out that the chaining of streams is difficult at times. they should and try to make some wrapper streams to make the process easier, or rethink streams entirely.

Xarn
Jun 26, 2015

Subjunctive posted:

Why else would you hire someone if not to change the code?

To add code, because you are getting behind on the dates, duh.

In happy news, I not only killed another deadlock in our codebase today, I got to fix the underlying cause, instead of just symptoms. :dance: (I also got to use Parallel Stacks window in Visual Studio, if we didn't have 200+ threads of which only about 10 are distinct and meaningful, it could have been useful.)

Sebbe
Feb 29, 2004

So, apparently PHP lets you redefine the VM opcodes... from within the language itself.

Adbot
ADBOT LOVES YOU

Mogomra
Nov 5, 2005

simply having a wonderful time

Sebbe posted:

So, apparently PHP lets you redefine the VM opcodes... from within the language itself.

That example is priceless.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply