|
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. At least I started with guerilla introduction of ScopeGuards.
|
# ? Oct 19, 2015 13:01 |
|
|
# ? Jun 7, 2024 11:32 |
|
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. A codebase full of low-hanging fruit! Have fun.
|
# ? Oct 19, 2015 14:32 |
|
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.
|
# ? Oct 19, 2015 14:50 |
|
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.
|
# ? Oct 19, 2015 18:26 |
|
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"... 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.
|
# ? Oct 19, 2015 18:33 |
|
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 |
# ? Oct 19, 2015 19:59 |
|
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. 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
|
# ? Oct 19, 2015 20:01 |
|
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 |
# ? Oct 19, 2015 20:05 |
|
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).
|
# ? Oct 19, 2015 20:13 |
|
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.
|
# ? Oct 19, 2015 20:43 |
|
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.
|
# ? Oct 19, 2015 20:48 |
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.
|
|
# ? Oct 19, 2015 20:50 |
|
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.
|
# ? Oct 19, 2015 20:57 |
|
Makes me appreciate how stupidly simple roman characters are in comparison.
|
# ? Oct 19, 2015 21:54 |
|
"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."
|
# ? Oct 20, 2015 00:51 |
|
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." The horror is that someone turned off a failing test instead of fixing it.
|
# ? Oct 20, 2015 01:04 |
|
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%.
|
# ? Oct 20, 2015 01:09 |
|
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.
|
# ? Oct 20, 2015 01:36 |
|
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. 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 |
# ? Oct 20, 2015 01:46 |
|
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.
|
# ? Oct 20, 2015 01:58 |
|
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%. Can't argue with the metrics!
|
# ? Oct 20, 2015 02:02 |
|
Xarn posted:I just had an argument with colleague about programming languages. 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.
|
# ? Oct 20, 2015 02:27 |
|
No Safe Word posted:Can't argue with the metrics! hi boss
|
# ? Oct 20, 2015 02:34 |
|
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.
|
# ? Oct 20, 2015 06:32 |
|
Xarn posted:23 I think, maybe 24. Jesus wept.
|
# ? Oct 20, 2015 06:35 |
|
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.
|
# ? Oct 20, 2015 07:18 |
|
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.
|
# ? Oct 20, 2015 08:14 |
|
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)
|
# ? Oct 20, 2015 09:12 |
|
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.
|
# ? Oct 20, 2015 12:49 |
|
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.
|
# ? Oct 20, 2015 12:50 |
|
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! (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)
|
# ? Oct 20, 2015 13:13 |
|
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.
|
# ? Oct 20, 2015 14:30 |
|
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.
|
# ? Oct 20, 2015 15:08 |
|
Obviously it was a single class called 'World', because the world is a physical thing.
|
# ? Oct 20, 2015 15:18 |
|
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)
|
# ? Oct 20, 2015 15:50 |
|
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".
|
# ? Oct 20, 2015 17:06 |
|
Xarn posted:Streams are not explicit enough for him. 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.
|
# ? Oct 20, 2015 18:01 |
|
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. (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.)
|
# ? Oct 20, 2015 18:17 |
|
So, apparently PHP lets you redefine the VM opcodes... from within the language itself.
|
# ? Oct 20, 2015 18:24 |
|
|
# ? Jun 7, 2024 11:32 |
|
Sebbe posted:So, apparently PHP lets you redefine the VM opcodes... from within the language itself. That example is priceless.
|
# ? Oct 20, 2015 18:27 |