|
tef posted:I think you're confusing "similar things should look the same" as "every other language should work like the one I learned to use". Yeah, it really seems to me that it's a bit of a no-brainer how much simpler it can be to read and understand a language that requires you to explicitly call 'this' or 'self' or '@' or whatever the hell the current object is. Unnecessarily complex variable scoping rules don't help anyone in the long run, it's just obfuscation. Read the docs of the language you use and lo and behold, you can understand how things work. The horror is only really there if a language finds ways to be internally inconsistent.
|
# ? Jan 21, 2013 09:03 |
|
|
# ? Jun 3, 2024 06:12 |
|
Contra Duck posted:
|
# ? Jan 21, 2013 09:24 |
|
Stoph posted:
Definitely. But also: use jshint or jslint. Cocoa Crispies posted:Use a language that gives you different syntax for instance variables and local/global variables, syntax for classes and objects, and better syntax for function binding. With web browsers you really don't have a choice. (Or is the joke that CoffeeScript is such a language and I'm dumb?)
|
# ? Jan 21, 2013 14:56 |
|
Wheany posted:
It's the latter.
|
# ? Jan 21, 2013 15:36 |
|
tef posted:This is generally what I think of languages where 'this' or 'self' is implicit.
|
# ? Jan 21, 2013 15:57 |
|
Cocoa Crispies posted:It's the latter. Well, I don't know CoffeeScript so it's a bad language that you should not use.
|
# ? Jan 21, 2013 15:59 |
|
Wheany posted:Well, I don't know CoffeeScript so it's a bad language that you should not use. Obligatory: https://github.com/satyr/coco/wiki/wtfcs
|
# ? Jan 21, 2013 16:08 |
|
Wheany posted:Well, I don't know CoffeeScript so it's a bad language that you should not use. I like CoffeeScript a lot -- it hides a lot of JavaScript's warts and gives it a cleaner syntax. The problem is debugging CoffeeScript. Since it emits regular old JS, you still need to have a good knowledge of JS in order to effectively debug. Of course, you should be unit testing, but there are going to be times you'll need to dive into the code in a debugger no matter what.
|
# ? Jan 21, 2013 16:12 |
|
It really makes nice code to look at though. http://coffeescript.org/
|
# ? Jan 21, 2013 16:18 |
|
Found this today in work stuff:code:
|
# ? Jan 21, 2013 17:10 |
|
code:
|
# ? Jan 21, 2013 17:22 |
|
I don't know why, but I find Unexpected 'MATH' hilarious no matter how many times I see it. Unexpected ('Surprise') math: math you did not expect to see today. Edit: Basically, I picture CoffeeScript as an accounting student when faced with their first certification exam saying CoffeeScript posted:Oh, god! Oh, gently caress! I didn't think there'd be math in this thing! Munkeymon fucked around with this message at 23:41 on Jan 21, 2013 |
# ? Jan 21, 2013 19:12 |
|
Munkeymon posted:I don't know why, but I find Unexpected 'MATH' hilarious no matter how many times I see it. Unexpected ('Surprise') math: math you did not expect to see today. https://www.youtube.com/watch?v=6_Ye0HfX41Q&t=10s
|
# ? Jan 21, 2013 19:36 |
|
Ithaqua posted:I like CoffeeScript a lot -- it hides a lot of JavaScript's warts and gives it a cleaner syntax. The problem is debugging CoffeeScript. Since it emits regular old JS, you still need to have a good knowledge of JS in order to effectively debug. Of course, you should be unit testing, but there are going to be times you'll need to dive into the code in a debugger no matter what. Source Maps make this a lot easier: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
|
# ? Jan 21, 2013 21:08 |
|
Ithaqua posted:I like CoffeeScript a lot -- it hides a lot of JavaScript's warts and gives it a cleaner syntax. The problem is debugging CoffeeScript. Since it emits regular old JS, you still need to have a good knowledge of JS in order to effectively debug. Braaam posted:Source Maps make this a lot easier: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ I've found that writing CoffeeScript that compiles to relatively simple JavaScript helps with development, debugging, and maintenance. Generating an additional file to map source to compiled code sounds similar to the regex aphorism: "Some people, when confronted with a problem, think, I know, I'll use regular expressions. Now they have two problems."
|
# ? Jan 21, 2013 22:37 |
|
Cocoa Crispies posted:I've found that writing CoffeeScript that compiles to relatively simple JavaScript helps with development, debugging, and maintenance. Generating an additional file to map source to compiled code sounds similar to the regex aphorism: "Some people, when confronted with a problem, think, I know, I'll use regular expressions. Now they have two problems." Yeah, I've never really had trouble relating the compiled code to it's source with Coffeescript. As long as your dev environment is preserving white space with the compiled code, it's not like the structure becomes wildly different. It's not like it's a Haskell to Javascript compiler or anything.
|
# ? Jan 21, 2013 22:52 |
|
This probably belongs here but not because the code is bad, really: http://swanson.github.com/blog/2013/01/20/worst-bug-ever.htmlquote:After about of week of stepping through the code line by line (even verifying some of the calculations by hand), I finally isolated the section of code where the results diverged.
|
# ? Jan 21, 2013 23:56 |
|
Maple and Matlab both are huge horrors. Probably the only good math software I saw is Mathematica, and even that has some quirks.
|
# ? Jan 22, 2013 00:09 |
|
Maple uses I for the imaginary unit, rather than i. It can be jarring when you forget you have to capitalise it, but I guess it does mean you can use i as a dummy variable or loop variable without issue. My licence on this computer has expired or I'd check, but I think Maple would complain if you tried to reassign I. That said, Maple is very clunky in a lot of different ways and I have posted about it in this thread in the past.
|
# ? Jan 22, 2013 00:31 |
|
Yeah, Maple was so awful that I bought a Mathematica license despite it being like 6 times the cost of Maple (I think 40 or 50 euro). Definitely worth it, though.
|
# ? Jan 22, 2013 00:45 |
|
I thought Matlab was always a big thing. I've only used it a bit myself, but I never heard anything bad about it compared to Maple. Leave it up to the Something Awful forums to make me hate everything I thought was good.
|
# ? Jan 22, 2013 01:21 |
|
Matlab's got problems (http://abandonmatlab.wordpress.com/) but it's got itself wedged so solidly into its particular niche that it's not going to get displaced for a long long time.
|
# ? Jan 22, 2013 01:37 |
|
Sort of off topic, but using a for loop in MATLAB is often not what you want to do. Unless there's some obscured complexity here, d = compute_diffraction_at_wavelength(LensLayers, WAVELENGTH) would do the same thing, but faster.
|
# ? Jan 22, 2013 01:55 |
|
.
Nickopops fucked around with this message at 09:38 on Nov 1, 2019 |
# ? Jan 22, 2013 02:11 |
|
Nickopops posted:not a great MATLAB coder Nice tautology you got there.
|
# ? Jan 22, 2013 05:35 |
|
No Safe Word posted:This probably belongs here but not because the code is bad, really: http://swanson.github.com/blog/2013/01/20/worst-bug-ever.html IIRC j is also set to sqrt(-1) by default. Probably why I've never run into that one as an EE.
|
# ? Jan 22, 2013 06:38 |
|
I don't have the code for this, but it's definitely a horror. I was working in Sublime Text 2 today and went to rename a file by right-clicking it in the sidebar. When I typed the new name, I accidentally typed the name of a file that was already in that directory. (They're just a bunch of files in numbered sequence and I fat-fingered it.) Sublime happily did the rename, destroying the file with the same name instead of telling me that it already existed. Thank god I have a backup.
|
# ? Jan 22, 2013 15:41 |
|
No Safe Word posted:This probably belongs here but not because the code is bad, really: http://swanson.github.com/blog/2013/01/20/worst-bug-ever.html The implication here is that in matlab, for loop variables have global scope rather than being loop local. Thern posted:I thought Matlab was always a big thing. I've only used it a bit myself, but I never heard anything bad about it compared to Maple. Matlab is hugely popular. It's just not very good, and most of the people I know who have to use it regularly hate it. (It's better than Maple, but that really isn't saying much.)
|
# ? Jan 22, 2013 15:48 |
|
Not strictly a coding horror, but on my walk from my car to my lab today in the freezing cold I round the last corner leading up to the entrance and what's waiting or me? A giant truck that's part of a LabView campus tour
|
# ? Jan 22, 2013 16:03 |
|
quiggy posted:Not strictly a coding horror, but on my walk from my car to my lab today in the freezing cold I round the last corner leading up to the entrance and what's waiting or me? A giant truck that's part of a LabView campus tour But this reminded me that maybe there has been an open-source alternative since I last checked. I am still looking, so I ran into this discussion thread, which I think is a horror in its own right: quote:I chimed in as well. The problem is that LV does make it "too easy" to do REAL programming and not have a CS background. That generates jealousy and anger esp from those who've invested years in learning the arcana of overloading functions from some obscure lib somewhere. The buggy whip manufacturers got really upset by automobiles... I'll take suggestions for EE data collection tools and experiment automation if anybody has them.
|
# ? Jan 22, 2013 17:14 |
|
Rocko Bonaparte posted:I was going to start bitching about LabView in proxy. I never used it, but I work with an army of electrical engineers, so it had come up before. I think the $$$ was a big issue. But then I read somewhere in CoC--probably here--about all the problems with the drat thing. IIRC one big thing was that if you reset the whole flow, it didn't reset all the variables. That and due to it trying to run everything in parallel, it could put your system into a crawl. I had the assignment of porting some old LabView programs over to C# last year. They were pretty simple stuff, primarily controllers for different devices. I cannot tell you how frustrating it was that there is literally no way to have LabView release a port that a device is on if the program itself doesn't have that ability. Even nuking LabView from the processes menu doesn't free up the ports it was using
|
# ? Jan 22, 2013 17:18 |
|
ToxicFrog posted:The implication here is that in matlab, for loop variables have global scope rather than being loop local. EDIT: While I'm on the topic of scoping rules: Plorkyeran posted:Implicit this is not quite as weird in statically typed languages (and unsurprisingly enough every language I've used with it has been statically typed), but I am gradually coming around to the viewpoint that it's not a net gain. PrBacterio fucked around with this message at 19:11 on Jan 22, 2013 |
# ? Jan 22, 2013 19:02 |
|
Crossposted from YOSPOS: The ancient bug that woke up me and other devs in the middle of the night for weeks because none of us knew what valgrind was.C++ code:
Gazpacho fucked around with this message at 03:29 on Jan 23, 2013 |
# ? Jan 22, 2013 22:40 |
|
Rocko Bonaparte posted:LabView. My only experience with LabView is as a FIRST Robotics Mentor, gently caress LabView. I am very glad we got the team off of it.
|
# ? Jan 23, 2013 04:42 |
|
.
Nickopops fucked around with this message at 09:38 on Nov 1, 2019 |
# ? Jan 23, 2013 08:55 |
|
C++ code:
|
# ? Jan 23, 2013 17:38 |
|
Rocko Bonaparte posted:I was going to start bitching about LabView in proxy. I never used it, but I work with an army of electrical engineers, so it had come up before. I think the $$$ was a big issue. But then I read somewhere in CoC--probably here--about all the problems with the drat thing. IIRC one big thing was that if you reset the whole flow, it didn't reset all the variables. That and due to it trying to run everything in parallel, it could put your system into a crawl. You can write reasonable software in Labview and connecting some instruments together with some filters and spitting out a csv or whatever is a good use of it. Just take the time to learn the language and best practices and for the love of god don't go beyond data collection and initial processing with it. Too bad about the entire not hiring people that understand software to write software so all Labview code is a complete disaster thing.
|
# ? Jan 23, 2013 18:03 |
|
So why is Matlab so big? Does everyone just use it because everyone uses it?
|
# ? Jan 23, 2013 19:26 |
|
Wheany posted:So why is Matlab so big? Does everyone just use it because everyone uses it? Matlab is very good for computational purposes. You don't need to worry about data types or float precision or whatever, just let it do its thing. Also it has a lot of really useful and obscure built-in functions that you can do pretty much whatever with. If you're working in a science or engineering field and say "Oh, I need a program to do <thing> and have some amount of programming ability myself", 9 times out of 10 Matlab is probably your best bet.
|
# ? Jan 23, 2013 19:30 |
|
|
# ? Jun 3, 2024 06:12 |
|
Nice bit of (literal) crap that I came across today in the app that I need to take over after a colleague's departure. Simplified example to show just the relevant parts (this is C#/.net, but it should be obvious even if you haven't used it):code:
1. In case it's not obvious, the inner try/catch is there only to catch an array index out of range exception (because this is some kind of generic querying code and data table may not always have the same number of columns). Oh, if only there were a property you could read to find out the number of columns beforehand and use that in the for loop... (there is, of course) 2. In the outer catch: it's cool no need to log the exception, that's pretty standard in this app. What's far more egregious is that this "poo poo!!!" text actually propagates all the way back to the GUI and is in fact displayed to the user when there is an exception in this code. This actually happened, that's how I found this code. I realise that is (almost) nothing compared to some of the stuff seen here, but it really annoyed me today.
|
# ? Jan 23, 2013 20:12 |