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
Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Mustach posted:

Exxxxxtreeeeeeme MUMPS!



Example challenge: Convince your coworkers that the following is not an appropriate response to "I found a security vulnerability that allows a user to execute arbitrary code on the database server":

quote:

This is a known issue. There are few ways to avoid this:

1. Use BulkRPC for sending user entered data.
2. Or, make sure you wrap the user entered data in quotes (properly) before sending it to the server using RPC.

Also this problem is not isolated to how we do calls to the database server. It's industry wide problem. You can create havoc using SQL injections if the user entered data is not properly validated.

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Basically the library required you to know its internal implementation in order to be safe, since you called it like
code:
arg1 = "foo"
arg2 = 1
arg3 = "I'll kill you\"); evilevilevil() #"
DoSomething("func", arg1, arg2, arg3)
which got turned into some code on the server like
code:
func("foo", "1", "I'll kill you"); evilevilevil() #")
with no indication in any of the documentation that that's how it actually worked. The whole point of abstracting out that layer is to automatically handle escaping strings properly (see basically any SQL library's execute() function). It is not the responsibility of the input reader to know how to escape strings to prevent injection attacks (unless you are a fan of the cut-n-paste pattern).

Avenging Dentist fucked around with this message at 01:34 on Apr 21, 2010

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Also http://en.wikipedia.org/wiki/MUMPS#Sample_programs

(Also also the employees are idiots and the CEO is a fruit loop.)

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

rt4 posted:

Nicer than what? Not trying to be snarky; I just don't get it.

It has an admittedly cool DB layer (or at least, it was cool back in the day where no one had heard of associative arrays). Nowadays, especially with things like MongoDB, literally everything MUMPS did is done better elsewhere.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Janin posted:

But how many dentists use it? Not many. The idea of sitting down, clicking a mouse 4-5 times, and then using this free awesome software is so abjectly terrifying to the average dentist that they avoid it like it's dick cancer.

You've got to know how to motivate dentists. As a dentist, the number one thing I'm concerned with in my practice is the degree to which I can cause another human being suffering. If you market the software as being able to help dentists inflict more pain on their patients, they will eat that poo poo right up.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Zombywuf posted:

Yeah, you see that bit where that's completely incomprehensible, that's the bit that makes this bad. I have no idea in that statement what's a keyword, what's a variable, what's a collection or even what's a name and what's an operator. It is so ugly that I have no desire to find out.

Oh you don't know the half of it. The whitespace is the most important part of that line.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Have fun: http://71.174.62.16/Demo/AnnoStd?Frame=Main&Edition=1995&Page=a107100#Def_0003

Let's see if I remember this stuff.

code:
FOR  SET num=$ORDER(^CoC(num)) QUIT:num=""  DO
"FOR  " is an infinite loop that executes all the crap on the rest of the line. SET num=$ORDER(^CoC(num)) essentially says "Get the value at the index num in the global variable ^CoC and then tell me the index of the next value and set num to that. So it's a bizarro iterator. QUIT:num="" says "break out of this loop, but only when num is the empty string. DO says "execute the block on the following lines".

So it translates roughly to:
code:
num = "";
while(true)
{
    num = ^CoC[num].next();
    if(num == "") break;

    // do stuff
}

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Zhentar posted:

Not really. This stuff can be easily trained in under a week.

Which is why the training period is (was?) three months for developers. And that's excluding application training and project-level training. All told, it was about 7 months before I committed a single thing.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Internet Janitor posted:

Legacy codebases were encouraged to use cryptic variable names and no comments.

That's because comments did (and still do) impose a small runtime performance hit in MUMPS. (Yeah, go ahead and read that again.) Also global variables were infinitesimally faster than local variables, so in the absence of actual performance data, they relied on superstition to tune their code. Incidentally, this is still the case at Epic, or was when I was there; people who went through training at different times received vastly divergent advice about performance (and it wasn't due to compiler/interpreter changes).

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Yeah, I'm fairly sure that Intersystems Cache (the MUMPS interpreter/environment) doesn't compile to bytecode.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Zhentar posted:

Was. They've cut it down to about 2 1/2 months. But of that, only one week was MUMPs specific; the rest was VB, framework, and application training (so I don't know why you would think that was excluded...). By my 6 month mark, I'd completed a project to be delivered to a customer shortly, so I'm guessing your team was weird.

We did at least a month of MUMPS programming in training. This is as of late 2006 though, so it's possible that their standards have changed. Unfortunately, my guess is that their training standards have lowered rather than their hiring standards have raised. Also, this was the same for every single developer that started when I did, since I saw all of them in developer classes for three months. Once you hit the three month mark, you did about a month and a half of app training and then I moved onto my team's training which was largely redundant with other training (except for "welcome to the wild world of HTML"). To be fair, part of the reason it took me six months was because I gave absolutely no gently caress about my training since I knew it was bullshit from day one (and getting yelled at for trying to program Scorched Earth in MUMPS didn't help). I think the motivated people took about 5 months though.

Zhentar posted:

Local variables are much faster than globals for a relatively small number of subscripts. However, globals scale much better.

I mean lexical globals, not MUMPS globals. It's been a while.

Avenging Dentist fucked around with this message at 04:24 on Apr 25, 2010

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Oh also:

Zhentar posted:

Although this thread is proof that the problem is hardly unique to Epic or MUMPS.

It's a bit of an egregious failing when the very same person (who's in charge of basically all the programmers) at one point asserts that in Visual Basic, using With statements is 10x faster than not using it, and then a couple years later says the difference is a wash. I mean, I suppose it's my fault for not automatically tuning everyone out the moment they utter the words "Visual Basic", but what can I say? I'm a glutton for punishment.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Zhentar posted:

I went through training in early 2007. We had a full month that involved MUMPS type things, but only one week of that was actual language training.

I could teach C++ in "a week" to programmers who'd never used C, C++, or Java if I got to spend three more weeks after that cementing the ideas in with more examples. This doesn't mean I'd assert that C++ can be learned in a week. Granted, I remember the language training itself being longer than that, but I really honestly think that if they gave you (the rhetorical you) a week and then expected you to write anything substantial in MUMPS, you'd have a lot of problems and would constantly be consulting references.

Zhentar posted:

Oooooh. I don't know whether or not that's still the case (nor do I care, since it's never come up).

It comes up indirectly if you ever have to look at any old code.

Zhentar posted:

Yeah, I'll give you that one. With hasn't really mattered since native compiled code. I don't know why it took a decade for people to get up to speed.

I will grant that it's possible that the person who relayed the "10x faster" statement is just stupid as gently caress, since it takes a pretty dumb person to be bad enough with money that he'd have problems paying rent on an apartment on Epic money.

Of course, if we start going into horrors committed by my actual coworkers, we'll be here all drat day. A choice example: one of my coworkers swore up and down that it is logically impossible for a programming language to support function pointers. I died a little that day.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
code:
<AvengingDentist> !butt bit-twiddling
<buttebot> AvengingDentist: butt-twiddling

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Ryouga Inverse posted:

Well, given that the report included MFC and Win32 in a list of web frameworks...

No it didn't? It's "frameworks", period.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Ryouga Inverse posted:

Three of these things aren't like the others.

"Frameworks, period" would include Cocoa/Carbon, Qt, GTK, etc. This thing has no idea what it wants to focus on.

Wow, a Windows-centric developer survey? Well I never.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Khorne posted:

Why yes, there was tons of code like this at the place I was contracted to code for. On a better note, while that is a terrible example for the ternary operator just take comfort in the fact it could have been worse.

Your example is a clamp/assertion away from being the "right way" in C. Perhaps it is you who is the horror, goon sir? :smug:

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

ColdPie posted:

I don't think I would blame someone for reimplementing atan2 either, given its name.

I would. The C standard library is really small. If you don't know C well enough to be able to use documentation when you want a really common function, you don't know it well enough to be getting paid to write code in it.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Yeah really, if your knowledge of C is so limited that you don't think "oh hey there's a math.h header I wonder if it has this seemingly-common function I want", you really have no business writing C.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

NotShadowStar posted:

I'm not sure how that even works without a compiler/parse error.

That's a perfectly legitimate construct in nearly every language with remotely C-like syntax.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

LockeNess Monster posted:

I do not understand this stupid debate about code style conventions of tabs vs space when there are auto-format tools for almost all languages.

Yeah I love it when people make commits to projects using their own personal brand of indentation instead of the style chosen for the project. Especially when they reformat the spacing for the whole file.

It's hilarious that the stupidest people in "tabs vs. spaces" arguments always end up being in the group of people saying "it doesn't matter".

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

LockeNess Monster posted:

share formatting rules files; make everybody autoformat using it before commit, fire people who fail to do this, problem solved

That's retarded

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
If it takes any measurable mental effort to write in multiple programming styles, you are an awful programmer. Remembering where to put braces when you are surrounded by "correct" code is not hard. The only thing there's even remotely a need for is setting indent-tabs-mode and c-basic-offset so electric mode doesn't gently caress up your poo poo (or whatever the equivalent is in vim).

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

LockeNess Monster posted:

If you only have humans formatting the code then there is very good chance that it wont be 100 consistent. Forcing everybody to use auto format tool with shared style before commit is a good solution imho.

The only autoformatting tool that works correctly all the time is the one that just removes all whitespace.

A A 2 3 5 8 K posted:

And what you don't get is that if it takes any measurable mental effort to read multiple programming styles, you're also an awful programmer. Once you get that, you see there's no need for all this herding cats poo poo.

Yes that is basically true that is why normal people don't try to proselytize their indent style.

Avenging Dentist fucked around with this message at 21:56 on May 19, 2010

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Internet Janitor posted:

I'd argue that lambda expressions are not a good idea for Java. They don't improve the expressive power of the language

Neither does any feature once you have Turing completeness.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
MUMPS is a bad language used by a bad company that Zhentar has Stackholm Syndrome about so that he won't commit suicide. (I worked there too but then I realized that that was a shameful thing to do.)

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
The only thing dumber than using the copy-paste design pattern is making edits to the pasted code without tool assistance (e.g. find-and-replace).

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Crazy RRRussian posted:

Dude, just rewrite the code to avoid the substr operation.

He already rewrote it you dingleberry.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Crazy RRRussian posted:

Yea sure, but hes saying he had to do a radix trie for it. I am just curious how the time needed to construct the tree impacts performance here with naive string matching.

Probably pretty good given that many implementations of std::string use copy on write.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Crazy RRRussian posted:

substr is loving slow and runs in linear time.

These two have nothing to do with each other. In most cases where substr is slow, it's because of dynamic memory allocation, not because it's "linear time". Any string comparison is also linear time, so (in absence of allocations) you're just adding a scalar multiple (2) to the asymptotic behavior of the code.

I'm actually surprised libstdc++ doesn't use COW on substr starting at 0, but then COW is stupid as gently caress for strings to begin with, and in violation of the C++0x spec (due to the requirements of move ctors, I believe). I long for the day that clang and libcxx are the defaults on all systems.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

shrughes posted:

The real horror is that C++ is so complicated that you can only "believe" it's in violation of the C++0x spec.

I haven't read the whole proposed spec since I see little point in trying to hit a moving target (especially since the semantics of rvalue references have changed several times now). I'm actually just going on something said on the GCC mailing list.

EDIT: Ah, sorry, it's because C++0x provides new concurrency guarantees for std::string, namely that 1) two threads may read from the same string object, and 2) a thread may copy and manipulate a string even if another thread is holding on to the original (short version: strings can't be retarded in C++0x). http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2668.htm if you care.

Avenging Dentist fucked around with this message at 21:42 on Jun 4, 2010

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
You know what else is just as dirty and probably a lot safer? Unprotected anal sex with anonymous men in bathroom stalls.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

LeftistMuslimObama posted:

IN DEFENSE OF MUMPS

This is a joke right

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

LeftistMuslimObama posted:

Nope. I really think everyone who's super jaded on mumps is stuck maintaining really lovely code. Like, 90% of the MUMPS code out there is the M-equivalent of factoryfactorybeanproxyfactoryinitializer, but I genuinely think that for some applications it has inherent benefits that aren't present in other languages.

A language that makes it easy to write lovely code (especially at a per-line level, instead of at the broader architectural level) is a bad language. You can't blame the programmers for that. MUMPS is bad for a lot of the same reasons that PHP is bad.

The other stuff, like code comments having a runtime performance cost (though I think Intersystems finally fixed this in their implementation) is just poo poo icing on the rear end cake. Even the somewhat nice features of MUMPS (the spare btrees, mainly) don't save it, since other languages can easily implement those sorts of things as a library. At the end, all you have is a language that's too terse for its own good, creaking under the weight of its own specification.

That said, I do agree that the-company-that-shall-not-be-named somehow managed to use only the worst parts of MUMPS.

(And in the end, if you're raking in the dough because you know a computer thing that's not mainstream, then congratulations! You win the tech sector. But you don't have to get attached to the lovely technology you use to stack that paper. I know it's tempting to get attached; there was an incredibly shameful week or two where I thought Javascript was actually a good language. Luckily, I was quickly disabused of that notion.)

Adbot
ADBOT LOVES YOU

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Thermopyle posted:

I think I just said this recently, but isn't "it's only lovely if you use it wrong" a fully general defense of any piece of poo poo?

I'm not a lovely poster; you're just holding my posts wrong. :unsmigghh:

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