|
PDP-1 posted:4) LabView's motor controllers can operate in two regimes of stability: (1) If you want a motor to turn clockwise, power up the coils that turn it clockwise. This is the sane mode. (2) Power up both the coils that turn the motor clockwise and counter-clockwise to 100% so the opposing torques hold the shaft in place. If you want to turn clockwise, power down the counter-clockwise coils to 90% so the clockwise coils begin to win. This is the "Hey do you smell that hot electronics smell? *touches motor and burns off outer skin layer*" mode. They actually do that intentionally for some applications, kind of forgot what though. You get better position control at low speeds. So probably CNC machines or something. That wouldn't be a Labview thing though, that would depend on the motor controller hardware. that said, labview is loving horrible in so many goddamn ways.
|
# ? Mar 27, 2012 02:36 |
|
|
# ? May 17, 2024 02:27 |
|
I'm digging through the code to a simple game, in the hopes of cleaning it up and using it as an example of writing games in Haskell. Some of the code is incredible.code:
code:
|
# ? Mar 27, 2012 03:18 |
|
HappyHippo posted:The idea of controlling industrial machinery on anything but a PLC sounds insane. People on the fence about it assume that it's because LabView is the newer, better product and worth more to businesses, when in reality the only reason for the divide is that there isn't a skilled pool of LabView programmers with decades of experience like there is with PLC. Unfortunately the replaceability factor favors LabView users to the extreme; if you have a production line that incorporates LabView, you are honest-to-god hosed if your programmer leaves and you don't already have a new one lined up. If you have a production line using PLC and your programmer leaves, there is a market consisting of users with decades of experience out there that can fill the position. I know people that have picked LabView to learn and focus on because "It's better money and PLC is old, all the PLC programmers are like 50". They're probably right, and it's a good decision as far as working to make the most money you can goes, but that doesn't make LabView good in the slightest. Also apparently a lot of LabView programmers have experience that is purely academic - a place I contracted for needed a LabView programmer and the only people available were 1st year apprentices, no experience outside the classroom. Would love to have been a fly on the wall at a company forced to replace a long-term employee with one of these guys.
|
# ? Mar 27, 2012 03:19 |
|
Janin posted:I'm digging through the code to a simple game, in the hopes of cleaning it up and using it as an example of writing games in Haskell. Some of the code is incredible. At least they didn't write something like code:
|
# ? Mar 27, 2012 03:27 |
|
My favorite discovery so far is the "get-put pattern"code:
|
# ? Mar 27, 2012 04:00 |
|
The Gripper posted:What sucks most about it is the way LabView tends to draw new users in because generally the payrate for LabView programmers is higher than PLC programmers. Strange, my experience had led me to the opposite view. To me, LabView is a low-skill language that lets non-programmers plug things into a computer and make them work without having to know much about formal coding practice. Just connect a voltmeter to your PC with a GPIB cable, wait for VISA to detect it, and you're off. Draw a for-loop block, wire the output of the voltmeter to a graph node and you got a datalogger baby! No drivers, no win32, just plug-n-go. Also, LabView came out in 1986 and there's tons of people who know how to use it. I'm an electrical engineer and I'd guess 10-20% of my colleagues have at least some level of skill with it. I personally have been using it since the late 90's and only switched over to (mostly) C# in the last 2-3 years. The PLC crowd on the other hand are usually lifers in the hardware control field and the ones I've met straddle the line between hardware and low-level software engineering. They build million dollar systems that will run for 20 years in conditions just shy of a meteor strike and go apoplectic when someone plugs their poo poo into a UPS from Best Buy instead of a true UPS. It's much more of a hardcore engineering field and I'd expect that they got paid better than some random LabView hack. I'm not saying you're wrong, maybe it's just that our fields of work are very different, but to me if PLC work is LEGO Mindstorms then LabView is Duplo blocks.
|
# ? Mar 27, 2012 04:14 |
|
PDP-1 posted:I'm not saying you're wrong, maybe it's just that our fields of work are very different, but to me if PLC work is LEGO Mindstorms then LabView is Duplo blocks. I agree with LabView being the less technical of the two though, PLC takes a lot of experience to really get the ball rolling whereas LabView is designed outright to cut a lot of that out. In the companies I worked with PLC programmers weren't treated as extremely-skilled-professionals as much as they were blue collar laborers that know how to deal with PLC. This probably has a lot to do with the kind of people looking for PLC work in this area, generally as you said lifers in the hardware control field however they're looking to get back into the workplace rather than move to a better position, after their old workplace closed down or were made redundant. Not a whole lot of people with PLC skill were leaving jobs voluntarily to take new positions elsewhere. LabView users tended to be younger - less blue collar and more white collar - and were shopping around for the best possible position they could find, so that entire side of the market tended to treat them as if their skills were worth more than PLC skills.
|
# ? Mar 27, 2012 04:36 |
|
Janin posted:My favorite discovery so far is the "get-put pattern" How do you write basically the same four lines of code out five times and not think 'hey maybe I should abstract this into a function'? Also this is probably just style but seeing do-blocks inside parentheses always weirds me out for some reason.
|
# ? Mar 27, 2012 09:51 |
|
GrumpyDoctor posted:I took an electronic arts class in college in which in which I did my final project in Max/MSP and I blew my instructor's mind by actually skeleton-ing out the program before diving in and stringing connections around willy-nilly the way musicians using Max always do. The funny part is our audio engineer types love this sort of drag and drop things approach. They get scared by seeing actual code.
|
# ? Mar 27, 2012 14:55 |
|
ymgve posted:Braces are good, even for single statements. Isn't the correct answer to put it all on the same line?
|
# ? Mar 27, 2012 16:09 |
|
FamDav posted:Isn't the correct answer to put it all on the same line? Any of these are fine: code:
code:
|
# ? Mar 27, 2012 16:22 |
|
What you don't realise is if you use the right language you don't have to put braces around any if statements.
|
# ? Mar 27, 2012 16:26 |
|
baquerd posted:Any of these are fine: I like the terrible one. It has visual indication it's affected by the line above it and isn't polluted by braces. It's clean and compact and I have literally never been burnt by the obvious argument against it. Now this, on the other hand, is terrible: code:
|
# ? Mar 27, 2012 16:29 |
|
The Gripper posted:LabView users tended to be younger - less blue collar and more white collar - and were shopping around for the best possible position they could find, so that entire side of the market tended to treat them as if their skills were worth more than PLC skills. I think it's more of a management thing where they think they can just buy a computer and get a kid to drag blocks around on a screen, as opposed to some old dude who will want to buy a whole bunch of boxes with blinky lights and ask annoying questions about redundancy and fail-safes.
|
# ? Mar 27, 2012 16:37 |
|
Panic! At The cisco posted:What you don't realise is if you use the right language you don't have to put braces around any if statements. That's really a different matter altogether. In Python, Lisp, et al. there are other conventions that organize code. In a language featuring braces for organization, use them or go single-line.
|
# ? Mar 27, 2012 16:53 |
|
I always use curly braces, even if it could reasonably be fit onto a single line, for the sake of consistency. Obviously, I am horribly wrong.
|
# ? Mar 27, 2012 17:30 |
|
I use brackets because it looks dumb as hell. If you want to save those two key strokes just make a one liner out of it
|
# ? Mar 27, 2012 17:42 |
|
Perl doesn't let you do one-line no-curly if statements... unless the statement precedes the if. do_something() if($condition); do_something() unless($condition); I miss this syntax so much...
|
# ? Mar 27, 2012 18:58 |
|
McGlockenshire posted:Perl doesn't let you do one-line no-curly if statements... unless the statement precedes the if. Ruby allows this too.
|
# ? Mar 27, 2012 19:16 |
|
Ithaqua posted:I always use curly braces, even if it could reasonably be fit onto a single line, for the sake of consistency. Obviously, I am horribly wrong.
|
# ? Mar 27, 2012 19:21 |
|
But then you run into the issue stated before where a global search-and-destroy on "doSomething(z)" (which doesn't return a value, we'll say) will end up causing unforeseen effects. Using braces turns the if-statement into a no-op. No braces means the next statement is executed next (or a syntax error if you're lucky). On the subject of PHP and concatenated variables I'm pretty sure other languages have something similar. I know TI-BASIC on the TI-92+ allowed you to use variable variables by using "#variable" (useful when choosing a variable to store things in).
|
# ? Mar 27, 2012 19:30 |
|
TRex EaterofCars posted:I like the terrible one. It has visual indication it's affected by the line above it and isn't polluted by braces. It's clean and compact and I have literally never been burnt by the obvious argument against it. Except if you have multiple people on your team mangling files with crazy formatters, then the "terrible" one that you like can potentially become the terrible one that in your mind is the truly terrible one. With braces it can get mangled and look stupid but at least it'll never become what you posted above even with lovely reformatters around.
|
# ? Mar 27, 2012 19:30 |
|
Dicky B posted:It's perfectly consistent to always omit curly brackets when it's only one line. Consistent with being a bad coder I bet you don't use semi-colons to end all your lines in JavaScript. I always use braces but don't actually care either way
|
# ? Mar 27, 2012 19:30 |
|
Let's just write parse trees. Man, what a weird language that would be.
|
# ? Mar 27, 2012 19:34 |
|
Zamujasa posted:But then you run into the issue stated before where a global search-and-destroy on "doSomething(z)" (which doesn't return a value, we'll say) will end up causing unforeseen effects.
|
# ? Mar 27, 2012 19:45 |
|
pokeyman posted:Let's just write parse trees. Man, what a weird language that would be. In case you're serious, there is a language like that, it's called Lisp.
|
# ? Mar 27, 2012 19:50 |
|
You know what? I think I actually preferred Stallman chat to brace chat.
|
# ? Mar 27, 2012 19:59 |
|
Yeah that was an attempted Lisp joke.
|
# ? Mar 27, 2012 20:10 |
|
Wheany posted:You know what? I think I actually preferred Stallman chat to brace chat. code:
|
# ? Mar 27, 2012 20:30 |
|
"At age 59, every programmer has the indentation style he deserves." edit: Stallman is still perhaps outclassed by "Eastern Polish Christmas Tree Notation" Internet Janitor fucked around with this message at 20:43 on Mar 27, 2012 |
# ? Mar 27, 2012 20:39 |
|
Internet Janitor posted:"At age 59, every programmer has the indentation style he deserves." Thats... Kind of awesome actually. code:
|
# ? Mar 27, 2012 23:54 |
|
Plorkyeran posted:"if you do this highly destructive thing without checking the results things might break" is not a very compelling argument It's just an example of something that could happen, is all. You can get the same result if you just comment out the line normally, easily done especially if the code is like code:
|
# ? Mar 28, 2012 03:45 |
|
Internet Janitor posted:"At age 59, every programmer has the indentation style he deserves." Those two architects deserve awards for being some of the greatest trolls of all time. "Hehe, they think they will maintain this after we are gone."
|
# ? Mar 28, 2012 05:57 |
|
Internet Janitor posted:"At age 59, every programmer has the indentation style he deserves." I don't know about braces, but I can dig the assignment operators being lined up. Looks kinda neat.
|
# ? Mar 28, 2012 06:40 |
|
Zamujasa posted:On the subject of PHP and concatenated variables I'm pretty sure other languages have something similar. I know TI-BASIC on the TI-92+ allowed you to use variable variables by using "#variable" (useful when choosing a variable to store things in). Yeah but in PHP it is a terrible abomination because PHP already has a feature that lets you do this in a much more sensible and controlled way, i.e. associative arrays.
|
# ? Mar 28, 2012 12:12 |
|
braces
|
# ? Mar 28, 2012 12:26 |
|
brb manually typesetting my code
|
# ? Mar 28, 2012 12:26 |
|
From the same page as the christmas tree notation:code:
|
# ? Mar 28, 2012 13:09 |
|
Hammerite posted:Yeah but in PHP it is a terrible abomination because PHP already has a feature that lets you do this in a much more sensible and controlled way, i.e. associative arrays. http://php.net/manual/en/language.variables.variable.php
|
# ? Mar 28, 2012 15:25 |
|
|
# ? May 17, 2024 02:27 |
|
Aleksei Vasiliev posted:Can we all agree that Stallman's preferred style is terrible? Are those spaces between function name and args really a thing? .
|
# ? Mar 28, 2012 17:46 |