|
A problem with visual programming systems that often isn't discussed is their tendency to strip programmers of the broad range of pre-existing tools for manipulating text. Whether it's basics like grep or diff, or the ability to share code by pasting it into IRC, email, markdown documents and pastebins, if the designers of the visual programming system didn't provide some equivalent you're out of luck. See also: Smalltalk. Visual programming systems which can serialize in a reasonable textual format make it possible to overcome some of these issues, but I'm still really unconvinced they're a net gain.
|
# ? Jun 13, 2016 22:02 |
|
|
# ? May 17, 2024 14:42 |
|
I remember when I was in high school and we had a day where they paired us with someone who worked in something we were potentially interested in as a career, and for various reasons I ended up at a civil engineering company. Even back then I was a bit worried when they showed me one of the tools they used to do structural stuff, which was a big excel spreadsheet where they'd punch in parameters describing the loading on something, the various constants that described the properties of the material they were using, and so on and so forth. A bunch of stuff was calculated based on that, and some cells would be highlighted in red if values were outside their safe range. Then they'd gently caress around the inputs until nothing was red, and I guess that's how bridges are designed.
|
# ? Jun 13, 2016 22:04 |
|
canis minor posted:My brother is a perfect example of this - I love him dearly, but I feel slightly uncomfortable when he shows me an "application" that is used to calculate mortgage interest rates "written" in Excel. I can top this. My first job out of college was at a specialty gas manufacturer. All of their calculations for mixtures (of very, very, very corrosive, fatal-if-inhaled, explosive, explosively-unstable-at-room-temperature) gases were done via Excel spreadsheets with VBA. But it worked. They never had an explosion, at least not due to that spreadsheet. I refused to touch that thing. Today, I would have a field day writing a test suite around their calculations and ensuring the calculations were actually correct. And getting it in source control. That was a fun place to work.
|
# ? Jun 13, 2016 22:53 |
|
Funny how the world continues to spin with bad practices and lack of unit testing
|
# ? Jun 13, 2016 23:15 |
|
YeOldeButchere posted:I remember when I was in high school and we had a day where they paired us with someone who worked in something we were potentially interested in as a career, and for various reasons I ended up at a civil engineering company. Even back then I was a bit worried when they showed me one of the tools they used to do structural stuff, which was a big excel spreadsheet where they'd punch in parameters describing the loading on something, the various constants that described the properties of the material they were using, and so on and so forth. A bunch of stuff was calculated based on that, and some cells would be highlighted in red if values were outside their safe range. Then they'd gently caress around the inputs until nothing was red, and I guess that's how bridges are designed. From what little I know of engineering, they used to have (and probably still do have in many places) gigantic piles of binders containing thousands of pages of meticulously detailed information on the physical properties of different kinds of materials. Designing a bridge that has to be able to handle certain loads in a specific environment could involve many days' worth of looking up and cross-referencing what amounts to humongous tables of data. Excel is...not actually a bad first replacement for that, and I can well believe that it's a massive improvement over what they had before. I guess what I'm saying is, just because a program is written in Excel doesn't automatically make it a bad program. If your program consists primarily of a bunch of tables of (largely fixed) data and then a few formulae combining them, then Excel makes a decent amount of sense!
|
# ? Jun 13, 2016 23:17 |
|
tyrelhill posted:Funny how the world continues to spin with bad practices and lack of unit testing I think it was more luck than anything else. The calculations were always hand-checked and then redone from scratch if there was a discrepancy.
|
# ? Jun 13, 2016 23:22 |
|
TooMuchAbstraction posted:From what little I know of engineering, they used to have (and probably still do have in many places) gigantic piles of binders containing thousands of pages of meticulously detailed information on the physical properties of different kinds of materials. Designing a bridge that has to be able to handle certain loads in a specific environment could involve many days' worth of looking up and cross-referencing what amounts to humongous tables of data. Excel is...not actually a bad first replacement for that, and I can well believe that it's a massive improvement over what they had before. I kind of get that, but the thing is you just know that somebody made the spreadsheet once, put it on a network share, and people made local copies of it. Then some people made changes to their local copies, and gave that version to other people when asked, and before you know it there's like 50 different versions of nebulous origin floating around and nobody really knows what's different in each one.
|
# ? Jun 14, 2016 00:21 |
|
YeOldeButchere posted:I kind of get that, but the thing is you just know that somebody made the spreadsheet once, put it on a network share, and people made local copies of it. Then some people made changes to their local copies, and gave that version to other people when asked, and before you know it there's like 50 different versions of nebulous origin floating around and nobody really knows what's different in each one. That's more of a version control and deployment issue than a code issue though, isn't it? I guess it's just another one of the skillsets that software developers are expected to learn, but others may well not pick up.
|
# ? Jun 14, 2016 00:36 |
|
TooMuchAbstraction posted:That's more of a version control and deployment issue than a code issue though, isn't it? I guess it's just another one of the skillsets that software developers are expected to learn, but others may well not pick up. Yeah. There's this temptation as computer touchers and programmers to look down on things that might be hacked together with suboptimal tools, but many people's primary jobs require a tiny bit of data crunching and mostly something else completely. These people want the easiest tool that's most readily available. For most normal people in most office environments, that winds up being Excel.
|
# ? Jun 14, 2016 04:16 |
|
It's not close to production-strength yet, but Stencila is germane to this topic.
|
# ? Jun 14, 2016 05:12 |
|
Internet Janitor posted:A problem with visual programming systems that often isn't discussed is their tendency to strip programmers of the broad range of pre-existing tools for manipulating text. Whether it's basics like grep or diff, or the ability to share code by pasting it into IRC, email, markdown documents and pastebins, if the designers of the visual programming system didn't provide some equivalent you're out of luck. See also: Smalltalk. Visual programming systems which can serialize in a reasonable textual format make it possible to overcome some of these issues, but I'm still really unconvinced they're a net gain. Oh, I definitely agree. I don't entirely visual solutions are the answer, but I think having more visualization and code editing tools would be interesting. NoFlo is definitely not all the way there, but it's a step in the right direction.
|
# ? Jun 14, 2016 08:22 |
|
canis minor posted:
Heh, are you and me coworkers perhaps? I've seen things you would not believe. For instance, developers willingly disabling the compiler's overflow detection just because catching it as an exception is hard. Or something like that. Overflow detection disabled => truncation. In a bank. Regarding to money amounts
|
# ? Jun 14, 2016 11:32 |
|
Amberskin posted:Heh, are you and me coworkers perhaps? I'd ask you to name and shame, but I suspect the answer is "literally all of them." Not that it matters because the value of my account (or basically anyone else's) won't get there anyway.
|
# ? Jun 14, 2016 12:02 |
|
My water supplier computes "two thirds" as 0.667 and "one third" as 0.333. They're stealing pennies per year from me with that scam.
|
# ? Jun 14, 2016 12:21 |
|
tyrelhill posted:Funny how the world continues to spin with bad practices and lack of unit testing It does until it doesn't. Google 'excel error cancer treatment' for a decent example of "doesn't"
|
# ? Jun 14, 2016 13:56 |
|
qntm posted:My water supplier computes "two thirds" as 0.667 and "one third" as 0.333. They're stealing pennies per year from me with that scam. Hehehe... I'll go into old fart mode now. The year is 1999. The place is, somewhere in the Euro zone. The rules of the conversion between national currencies and Euro establish that you have to apply 5/4 rounding, except if the result is going to be zero (in that case you had to round up). For instance, let's take Spain. An Euro (EUR) is worth 166.386 old spanish pesetas (ESP). So 1 ESP = 0,0060 EUR, that is, 0,60 euro cents. For the rounding rule, 1 ESP = 0,01 EUR then. By the same rule, 0,01 EUR = 1,6638 ESP. The ESP had no fractional units, so applying the rounding rule 0,01 EUR = 2 ESP. A smart guy decided he had found his own private money making machine. So him opened an account in euros and an account in ESP in a bank, and put together a script to drive that bank internet home banking service to transfer 1 ESP to the account in Euros, and transfer 0,01EUR back to the account in ESP. Yay, free money! The bank detected the pattern when the guy had accumulated something like 100 EUR. Of course, you could not stop it from happening legally. So the solution was simply to apply an 1 EUR fare for each 100 transactions, so the "profits" got eaten. The guy also got a visit by some nasty lawyers. And, legend says, he was hired by one of the contractors which develop the home banking systems. But I can't confirm that. Those were the times...
|
# ? Jun 14, 2016 13:57 |
|
Munkeymon posted:It does until it doesn't. Google 'excel error cancer treatment' for a decent example of "doesn't" Different people get different results from the same Google search, and the article I think you were probably alluding to doesn't show up as the first result for me (it is fourth in the list). Here is the article I think you wanted to refer to: http://biomedicalcomputationreview.org/content/error-%E2%80%93-what-biomedical-computing-can-learn-its-mistakes
|
# ? Jun 14, 2016 14:46 |
|
Internet Janitor posted:LabView and Excel, on the other hand, pose some meaningful danger. They allow "non-programmers" to solve useful problems for themselves, which is great, but they're all too often used in production environments. Where you could have a straightforward script in nearly any sane language you instead get a tangled mess that is all but impossible to audit for correctness or instrument for tests. At a previous job, I worked for a company that supplied monitoring systems for industrial systems. The flagship product was a $35k-per-license piece of software which was a gigantic LabView application written and maintained by a VP who used LabView for everything, including simple one-off scripts. (This wasn't instrument control -- it was purely a UI by which the user monitored data provided by a separate API.) An impressively large number of bugs was attributable to his hand-rolled serialization and deserialization, which of course he couldn't replace but it would mean having to go through the code and find every place it had been copied to.
|
# ? Jun 14, 2016 15:15 |
|
C# code:
|
# ? Jun 14, 2016 15:36 |
|
Bognar posted:
Whoopsie!
|
# ? Jun 14, 2016 16:15 |
|
Bognar posted:
It took me way too long to see the error.
|
# ? Jun 14, 2016 16:30 |
|
Bognar posted:
Does c# actually allow code to randomly be in {} with no reason?
|
# ? Jun 14, 2016 17:00 |
|
Skyl3lazer posted:Does c# actually allow code to randomly be in {} with no reason? There's a perfectly valid reason to insert random {} in your code: it creates scope blocks, so you can e.g. declare a variable that's local to that scope and invalid outside of it. It's not (usually) a common thing to do, though, since usually you'd just make a new function to contain your scope instead.
|
# ? Jun 14, 2016 17:06 |
|
It's actually really dumb and error-prone, especially since "if true" exists.
|
# ? Jun 14, 2016 17:21 |
|
TooMuchAbstraction posted:There's a perfectly valid reason to insert random {} in your code: it creates scope blocks, so you can e.g. declare a variable that's local to that scope and invalid outside of it. It's not (usually) a common thing to do, though, since usually you'd just make a new function to contain your scope instead. If you're creating scopes just to contain variables, then you should definitely be using a separate function. Based on that alone I'd advocate for the removal of the feature altogether (although you'd then might want to make changes to other language constructs like switch/case).
|
# ? Jun 14, 2016 18:01 |
|
Bognar posted:If you're creating scopes just to contain variables, then you should definitely be using a separate function. Based on that alone I'd advocate for the removal of the feature altogether (although you'd then might want to make changes to other language constructs like switch/case). I don't want to create a new function just so I can create a lock (some lock implementations auto-release when the lock object leaves scope).
|
# ? Jun 14, 2016 18:14 |
|
TooMuchAbstraction posted:I don't want to create a new function just so I can create a lock (some lock implementations auto-release when the lock object leaves scope). I'd rather see a "with" construct; as in: code:
|
# ? Jun 14, 2016 19:15 |
|
Using explicit scopes just to control the lifetime of variables is super-normal in C++ due to RAII.
|
# ? Jun 14, 2016 19:34 |
|
Explicit scope is fine but a bare block sucks. Make my fuckups a syntax error.
|
# ? Jun 14, 2016 20:14 |
|
One of the cleverest (both good and bad types of clever) thing I've seen done with curly braces is in bash, where each pair of curly braces is a subshell. If you string them together with pipes you can create a parallelized event loop.. as subshells produce output the last binary in the pipe reads that and acts upon it. Annoying to debug if one of the subshells has problems, but it's a fun parlor trick.
|
# ? Jun 14, 2016 20:25 |
|
xzzy posted:One of the cleverest (both good and bad types of clever) thing I've seen done with curly braces is in bash, where each pair of curly braces is a subshell. If you string them together with pipes you can create a parallelized event loop.. as subshells produce output the last binary in the pipe reads that and acts upon it. I always wonder why people do fancy stuff in bash. It just seems like it would be so much easier to write/debug in a language like python...but I'm not writing stuff for the shell all the time so maybe there's good reasons. I do know it irritates the crap out of me when I've got to troubleshoot some service with startup bash scripts hundreds of lines long.
|
# ? Jun 14, 2016 20:28 |
|
In my experience bash is chosen when someone wants zero dependencies and the ability to run it out of the box on any unix-like system. Once upon a time we were supporting irix, linux, and solaris.. /bin/sh was the only thing they could be guaranteed to have in common.
|
# ? Jun 14, 2016 20:34 |
|
It's also part of the "standard linux education" or whatever that means exactly. A lot of times it's the only scripting language they know.
|
# ? Jun 14, 2016 20:41 |
|
Amberskin posted:Heh, are you and me coworkers perhaps? so like this, but with real money. https://www.ima.umn.edu/~arnold/disasters/ariane.html TooMuchAbstraction posted:There's a perfectly valid reason to insert random {} in your code: it creates scope blocks, so you can e.g. declare a variable that's local to that scope and invalid outside of it. It's not (usually) a common thing to do, though, since usually you'd just make a new function to contain your scope instead. next round of javascript errors
|
# ? Jun 14, 2016 21:07 |
|
Thermopyle posted:I always wonder why people do fancy stuff in bash. It just seems like it would be so much easier to write/debug in a language like python...but I'm not writing stuff for the shell all the time so maybe there's good reasons. Some of it is like the visual programming discussion above: start with a 10-line script, which would be messier in Python since it's all calls to commands... and then 2 years later it's 1000 lines full of program logic.
|
# ? Jun 14, 2016 21:17 |
|
TooMuchAbstraction posted:There's a perfectly valid reason to insert random {} in your code: it creates scope blocks, so you can e.g. declare a variable that's local to that scope and invalid outside of it. It's not (usually) a common thing to do, though, since usually you'd just make a new function to contain your scope instead. Why would I create a new function and pass/copy a bunch of state when I could just use RAII and have a scoped lock to get to shared data from where I actually want it?
|
# ? Jun 14, 2016 21:21 |
|
Thermopyle posted:I always wonder why people do fancy stuff in bash. It just seems like it would be so much easier to write/debug in a language like python...but I'm not writing stuff for the shell all the time so maybe there's good reasons. Python, Ruby &c don't have good interfaces for working with pipes and subprocesses. cat | cat is like 10 lines in an ugly API. It helps to think of Bash not as a scripting language but as a DSL for orchestrating programs via pipes. You wouldn't use it for the same things you'd use Python for. Turtle and Scsh are cool things you should look at that sort of bridge this gap. xtal fucked around with this message at 21:26 on Jun 14, 2016 |
# ? Jun 14, 2016 21:24 |
|
xtal posted:Python, Ruby &c don't have good interfaces for working with pipes and subprocesses. cat | cat is like 10 lines in an ugly API. Why in the world would you do cat | cat. I mean I take your point, if you wanted to do something like grep | grep it would be comparatively messy in a scripting language, but then that's why you can do things like (Ruby, anyway): code:
|
# ? Jun 14, 2016 21:40 |
|
I use python with the sh package to basically write the same script I would in bash, but not have to worry about string quoting.
|
# ? Jun 14, 2016 21:44 |
|
|
# ? May 17, 2024 14:42 |
|
Nippashish posted:I use python with the sh package to basically write the same script I would in bash, but not have to worry about string quoting. drat, that's an awesome package.
|
# ? Jun 14, 2016 21:46 |