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
Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

VikingofRock posted:

So this might be a naive question, but has anyone ever actually been successfully sued over breaking backwards compatibility? I searched and couldn't find any examples of it, but maybe there's some famous case or something that I just haven't heard of / my googling skills are poor.
A woman was running her travel agency on Windows 7. The forced Windows 10 upgrade hosed her applications and she got a $10,000 judgement in small claims. Microsoft declined to appeal and stopped forcing the upgrade. Another case regarding the Windows 10 upgrade, Watson et al. v. Microsoft, seeks class status and is still pending. That lawsuit specifically alleges failure to ensure compatibility.

Gazpacho fucked around with this message at 18:51 on May 2, 2017

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Incidentally, this is why Microsoft didn't start to fix the Internet Explorer brokenness until the European Commission threatened to clean their clock with fines.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
In the Watson case the plaintiffs admit agreeing to the upgrade, so the forcing is not relevant there. And in both cases, what Microsoft neglected to do is as much an issue as what it actively did.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Hammerite posted:

Can't decide whether I'm being a bit too pedantic, or far too pedantic.

code:
void CMyDialog::EnableButtons(bool enabled)
{
	BOOL enabled_asWindowsBOOL = enabled ? TRUE : FALSE;

	m_button1.EnableWindow(enabled_asWindowsBOOL);
	m_button2.EnableWindow(enabled_asWindowsBOOL);
	m_button3.EnableWindow(enabled_asWindowsBOOL);
}
Good idea, some doofus could pass in a VARIANT_TRUE and then who knows what would happen?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
JavaScript code:
var foo = function() {
  return (
    // This comment makes Closure Compiler emit an empty function.
    false);
};
I spent a day on this. What the hell.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Wrong, companies are locking themselves so hard into go apps that its value will be beyond question, much the same way that it is verboten to denounce Ronald Reagan in a public forum

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

idiotmeat posted:

Is that based on docker being written in go?
Mainly, but not exclusively.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Doom Mathematic posted:

How come for(;;) { ... } works, anyway? Shouldn't that at least be for(;true;) { ... }? Or does an empty statement return true??
The direct answer is that it works because the compiler makes it work. And the implicit result is true rather than false because a loop that implicitly terminates rather than implicitly repeating isn't much of a loop.

C's flexible loop statements are something that it gets very, very right, which is why derived languages tend to keep them.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Doom Mathematic posted:

So how come while() { ... }, with no condition, is a syntax error?
Because it's not valid syntax as specified by K&R (predating the standard). My previous answer doesn't imply that it should be otherwise. There are no "empty expressions" in C.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Doom Mathematic posted:

I don't understand what you mean by this, aren't there at least three empty expressions, possibly four, in for (;;) { }? Does ; by itself evaluate to true?

In any case, it doesn't make sense that omitting the condition in a for loop and omitting the condition in a while loop don't do the same thing. That's strangely inconsistent language design.
In K&R and C89 there are three optional expressions. The opening parenthesis can be followed by an expression, or a semicolon. There's no "empty expression" in the latter case. ";" is a delimiter, and has no associated value. In GCC, the parser sets the condition to an empty parse tree here and then the null condition drops the compiler into here to generate a jump back to the top.

In a while loop, the expression just isn't optional. Nobody ever suggested that C was a garden of pure ideology. It gets the job done.

Gazpacho fucked around with this message at 04:51 on Jul 26, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
It's defined in C89 and C++, undefined in C99 (type constraints).

It's also pretty benign.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
LLVM = Language Lawyer Virtual Machine

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

ratbert90 posted:

Why do people not even bother cleaning up their code when they send code samples?
Holy poo poo, a single .c/.h file? The C file is 25k and 1,000 lines long.

Including such awesome things as:

C++ code:
    /* DBUS is ready, messages can be sent */
    dbusReady = true;
Some devs are just unable to grasp any standard for source code beyond whether it compiles and "seems to work". It's not that they cut corners under time constraints, nor that they lack examples of alternatives in the age of GitHub, nor that those alternatives require any extraordinary degree of thought. They just don't have the ... inclination. And it's good to find that out during the recruiting process.

In this specific case, the information you've provided indicates that the dev didn't bother placing the code under VC to work on it. Because if they had, there'd be no reason to maintain dead code and little risk in factoring the big file.

Gazpacho fucked around with this message at 20:06 on Aug 14, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
When I had to use centralized version control (CVS, PVCS, RCS, and Perforce) I ended up manually improvising those steps, or steps dual to them, anyway. I was at a CVS-based company when git was released, but not famous, and I remember telling co-workers "Wouldn't it be great if there were a VC system that didn't revolve around individual file histories?"

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Zaphod42 posted:

As long as you use it properly everything in git is super simple and prevents you from loving anything up. You're just using git like CVS right now which isn't really right; you need to embrace the different approach. Its really better.
Contradictory clauses bolded

PS: Yes, you do have to use the basic features that git hands you. Still, I find that git doesn't help you in any significant degree to use those features correctly, while Mercurial does, which is why given the choice of the two I'll throw rocks at git. Not sure what the issue with multiple branch heads is, unless someone is so foolish as to push them in spite of the warning not to.

Gazpacho fucked around with this message at 02:10 on Aug 15, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
git as such has no sales force. There are no VPs striking "deals" to use git, in contrast with e.g ClearCase. As a trainer you would come in after the decision has already been made, but in my experience git adoption faces more hurdles from management than encouragement, particuarly with regard to auditability and IP security.

pre:
VERSION CONTROL ARGUMENT


                                Linus Torvalds





             pee-pee





                        doo-doo


  git has a
  bad interface

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Those who defend git's intuitiveness but do not have Mercurial experience should be aware of a few things.

- Mercurial has ordinal revisions. Meaning, numbers starting from zero. They're local to each clone, and exist concurrently with the hash revision IDs. Mercurial could work without them, but they exist for UI benefit, so that users can specify ranges of revisions with ranges of numbers, and not "ancestors of this but not this" which borders on writing a script.
- Mercurial has rebasing, hard resetting, history rewriting, partial committing. All that stuff in git that's handy if you're prepared to learn it, but not strictly necessary. It comes in the distribution but it's TURNED OFF, because new users shouldn't be bothered with it. When you're ready for one of these features, you can enable it in your config file and go.
- Mercurial has no command "forms" indicated by the post-option arguments, because expressing variations is what options are for. As a result, it can follow the longstanding Unix command line convention of using "--" to separate options from trailing arguments, not some trailing arguments from others.
- As an example if you want to rebase revisions from A to B onto C, Mercurial rebase requires you to tag each of those with an option, rather than specifying two of them (which two?) in a particular order (which?) and the third with an option that modifies (or maybe doesn't) the semantics of the other two.

Git's CLI has been created by and for people who breathe shell scripts, people who long ago forgot how silly it is to write something like [ "x$file" = x ]. And we know that it didn't have to be like that, because Mercurial didn't make the same mistakes.

Gazpacho fucked around with this message at 23:40 on Aug 15, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

ShoulderDaemon posted:

Having features which are unavailable until a config file is modified is a user-hostile mistake. It results in people writing scripts which mysteriously fail for other users, or it results in some users accidentally breaking their config because they want to use one of these tools, and it means that you have to defensively write documentation and tooling as if all of your users are using their own uniquely personalized VCS instead of a single well-defined program.
So it''s user-hostile, where the user is the developer of consumer of a script. You're kind of making my final point here. The goal should be to make something that serves its purpose without an ecosystem of scripts.

e: which is not to say that Mercurial lacks an ecosystem. It's just coded in Python, not bash, and at that level features are not turned off.

Gazpacho fucked around with this message at 00:18 on Aug 16, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Suspicious Dish posted:

Ordinal revisions are sometimes convenient but when UIs like TortoiseHg prefer showing them and hiding the hash, that's really annoying. A large part of source control is to be a shorthand for team communication and just the other day the ordinal revisions got us into trouble when someone said "go look at 35586" and we were looking at two different commits.
Tortoise shouldn't do that. It would blame it on Tortoise continually extending itself from CVS to systems that are nothing like CVS.

Suspicious Dish posted:

ok but they don't work. and neither does branching.

Mercurial does some really stupid things, like having a completely broken branch model (before you say bookmarks are equivalent to git branches, sure, but they aren't replicated or pushed to remotes), and having the concept of "multiple heads" where you can be in a completely hosed situation where the same name like "default" can refer to two different commits. git solves this by explicitly naming each head after a remote. You can't have two masters, you just have master and origin/master.
What are you talking about? The history manipulation tools work fine. I don't use bookmarks. If you're going to do protracted development, cut a branch and merge it in later. Where multiple heads exist, they exist to be merged/rebased ASAP.

Suspicious Dish posted:

Also, everybody always talks about "Mercurial's UI" as the commands you put in it and forget entirely about the output of the tool, which ranges from "useless" to "excessively harmful". hg log is one of the most useless commands on the planet and gives you everything you don't need, in reverse order. it also only shows you the first line of a commit message, de-emphasizing long, important commit messages that explain things in favor of "fixed junk".
I have found it frustrating that the pager extension, which deals with both of the issues you raise has to be explicitly turned on, and furthermore that certain co-workers never do so. But that's necessary because Mercurial doesn't assume a Linux environment the way git does. Commits that can't be summarized effectively with a header line are the result of a PEBKAC, not an issue with the VC.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Finding yourself suddenly on a dev team outnumbered by people who never opt to pursue a problem to its root cause has to be the ultimate workplace horror (and sign to move on).

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Rubellavator posted:

One of the conventions our databases use for Boolean values is O/X. I have no idea who came up with that because I don't think I've seen it elsewhere. Another convention we use is X/null. We have no control over this. I'm just waiting for the day.
I'm guessing there was a huge bikeshed argument involving 0/1, Y/N and T/F, and all parties agreed to lose

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

New Yorp New Yorp posted:

Alternate title: Developer doesn't use source control; learns why he should use source control.
Yeah I bet you would have done apologetics for SourceSafe too.

PS: There was time when a Microsoft program that unexpectedly deleted all of a user's files (MultiPlan) was cause for a product recall, followed by a shareholder lawsuit. This being the horrors thread, here are the details as I've heard them: MultiPlan used modal commands based on the initial letter of the command. As it happened, the letters of the word "TODAY" would trigger the command sequence "(T)? (O)? (D)elete (A)ll (Y)es" This led to a company-wide policy at Microsoft, as long as it was developing non-GUI apps, that commands would always be introduced by a dedicated escape key, not accepted by default.

Gazpacho fucked around with this message at 19:31 on Aug 22, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Master_Odin posted:

Well, for me, I personally hate functions that both mutate their parameters and returns a status flag on completion, especially since this is within a class where you could save data to a class variable. I'd also probably just put all three functions into a try/catch since the point was to quit on error (which shouldn't happen almost ever in production).

I've since learned he's done a switch(false) elsewhere to do form validation and in the default clause another switch(false) that handles DB interactions.
Perhaps I've misunderstood but it sounds like you want to track method failures in a manner that isn't reentrant. Which isn't necessarily out of the question, but does bring its own problems.

Ranzear posted:

If you want to nip this in the bud, I have a slightly less egregious pattern to suggest for "bail-out" chaining:
Just use a goto already, you know you want to. :twisted:

Gazpacho fucked around with this message at 19:29 on Aug 23, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

sucks because not lazy

Bash code:
repl()
{
	local from="$1" to="$2" c buf
	while read -n 1 c; do
		buf+="$c"
		if [ "${#buf}" -gt "${#from}" ]; then
			echo -n "${buf:0:1}"
			buf="${buf:1}"
		fi
		if [ "$buf" == "$from" ]; then
			echo -n "$to"
			buf=
		fi
	done
	echo -n "$buf"
}

roman()
{
	yes I | tr -d \\n | head -c "$1" |
	repl IIIII V |
	repl IIII IV |
	repl VV X |
	repl VIV IX # etc.
	echo
}

Gazpacho fucked around with this message at 00:27 on Aug 27, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Vanadium posted:

No that's just monads, I really want a respectable-looking syntax for goto.
It kinda sounds like you want a compiler that can guess what you ambiguously want in a given flow situation.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

PhantomOfTheCopier posted:

In the end, they realize assume that `rm -rf` and `git clone repo dirname` are common in git workflows, and they end up with multiple local directories for their local work. Indistinguishable from CVS.
Cloning as part of a "workflow" (I hate that term) is the numero uno sign that someone has missed the point of git branches.

It's you. You are the problem.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
I'm not saying people can't use the term, or can't use workflows, it's just that I'm not too keen on the whole concept.

It reminds me of the way people use the term "design patterns" to mean precisely those patterns handed down in one book by Gamma et al.

Gazpacho fucked around with this message at 22:22 on Sep 4, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Coffee Mugshot posted:

It isn't always, but...
People who get it stuck in their heads that they've "mastered" a tech when they're actually abusing it terribly cause a lot of trouble in the industry, and need to be checked. The attitude is the problem, not the skill level.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
excuse me, excuse me, why does an address line have to be converted to a string?

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Plorkyeran posted:

x = 1; x = 2; return x + x; is a perfectly sensible decomposition of that expression.
... and it's the one that gcc generates, even without optimization flags. Here's the basic block output, edited for readability.

code:
main ()
{
  int x;
  int _4;
 
  x_1 = 0;
  x_2 = 1;
  x_3 = 2;
  _4 = x_3 + x_3;
  return _4;
}

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

KernelSlanders posted:

There are no sensible decompositions of that expression. C trying to pretend there are in the first place is the horror here. Compiler should just puke.
Nope. It is not possible in the presence of pointer expressions to detect at compile time that an expression assigns a variable more than once. Requiring detection in expressions like this one, where it is possible, would still leave undefined situations and therefore would be something of a wasted effort and misleading assurance.

With the -Wall option GCC does detect it though.

e: This may sound contradictory, but all I'm saying is that while compilers are free to try to detect multiple assignments, they can't always do it, and the problem of specifying cases in the standard that must be detected is itself not well-defined, and the code generator has to be prepared to deal with it anyway.

Gazpacho fucked around with this message at 16:35 on Sep 7, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
- The overlap clause is not relevant to the expression at hand, which involves only one object.
- 6.5.16.1 ¶3 says that the effect of the assignment is sequenced after the value of x++ is calculated.
- 6.5.2.4 ¶2 says that the side effect of x++ is also sequenced after the value of x++ is calculated.
- Absent any constraint on how the two effects are sequenced relative to each other, 6.5 ¶2 leaves the behavior undefined.

KernelSlanders posted:

All of these replies only further prove my point. The problem is C. To use Xerophyte's example, the fact that you can use the ternary operator to set the assignment location of a RHS expression is insane. That an assignment is a valid LHS returning the assigned to value is also insane.* It's hard to imagine a modern language that would allow such nonsense. The core problem though is that C allows tons of syntax that is nonsensical but is not a compile error.
It's not insane if it happens to be what you want to do, which it occasionally is.

Gazpacho fucked around with this message at 02:08 on Sep 8, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Seems I wasn't understood earlier about UD being not always being statically detectable in the presence of pointer expressions. Consider a little spin on the tweet code:

main.c:
C code:
int main() {
  return (*f() = 1) + (*g() = 2);
}
evil.c:
C code:
static int x;

int * f() { return &x; }

int * g() { return &x; }
Both of these files get compiled and linked into one program. Each compilation unit (preprocessed file) in a C program gets compiled separately. How's the compiler going to detect that main.c is modifying the same object twice in an expression? It can't. The information it would need isn't present in the file. Heck, I could even add a coin toss to evil.c so that one couldn't know even with both files available.

As mentioned, the developers of GCC have helpfully included detection for some cases. But why write those cases into the standard, when they would be incomplete anyway?

You can extend your objections beyond the UD rule to cover assignment expression values, and pointers in general, but pretty soon you're not talking about the C language, which is what the standard exists to specify.

Gazpacho fucked around with this message at 02:31 on Sep 8, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Foxfire_ posted:

Only real difference is that C doesn't specify an order to its + operator and Python does. :shrug:
That's what happens when you standardize a language on paper for which multiple implementations already exist, rather than one holy reference implementation.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
VC clone going outrageously slow. I think, WTF is going on, did someone check a database into the repo?

So I poke around in the VC web UI a bit...

They did. :gonk:

Gazpacho fucked around with this message at 21:00 on Nov 7, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Database files running 10s of megabytes, checked into VC. Several of them checked in identically two or three times

A few third party jars checked in.

Some other files that would be compressible to <1%, if anyone had bothered to compress them.

Overall 97% of the project file tree in binary files.

Wish I knew what I did in this life or another that I end up working in places like this.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Hammerite posted:

why does any of that matter? I mean if they're the product of a build process then sure they shouldn't be checked in
- Did you miss the part where it makes cloning take forever?
- Did you miss the part where multiple copies of the same huge files are checked in? (no duplicate merging with this VC)
- We have an artifact repository where binaries and external dependencies of any sort can be uploaded and then fetched during builds.
- Kindly get out of the industry.

Gazpacho fucked around with this message at 17:07 on Nov 8, 2017

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
pro-click. Some coder in a hurry misspelled Tether as "Teather" in Aliens: Colonial Marines and hosed the AI in the finished product. Always remember this in code reviews.

A more general rule of thumb that isn't obvious to a lot of people: You are the first reviewer of your code. Don't dump the diff on someone else if you aren't willing to look at it yourself.

Gazpacho fucked around with this message at 03:21 on Jul 16, 2018

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Checking the init file keys against a registry of valid keys would have helped, but that assumes that the developers are coding the init file reader and have time to overengineer it, rather than using one off the shelf and paying attention to the user-visible functionality of their game

Gazpacho fucked around with this message at 05:45 on Jul 16, 2018

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Athas posted:

There is nothing in CUDA that prevents you from re-numbering your parameters when you add more.
whoosh (the problem, therefore, would be the researchers)

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