|
Looks like someone doesn't fully understand how to use booleans:PHP code:
|
# ? Sep 17, 2012 20:50 |
|
|
# ? Jun 3, 2024 20:15 |
|
Gigantic Slut Man posted:CoffeeScript is lexically scoped, but you don't have access to var, so you can't avoid changing the value of a variable from the outer scope other than by trying to make a unique variable name. If your function finds itself in a scope with foo, and you've named a variable foo, you're modifying the external foo. code:
|
# ? Sep 17, 2012 21:53 |
|
Sorry for the continued miscommunication, I know that JavaScript doesn't have those features. Let me explain like this: on the server side, you're using something like fs = require 'fs, which encapsulates that module. On the browser side, you're concatenating the files together, but they should all be enclosed in self-executing functions and assigned around one global variable. So you'll never encounter a library defining foo, only fs.foo, so to say. Unless I'm misunderstanding, the only time CoffeeScript's scoping behaves unexpectedly is if your library code isn't properly encapsulated, or if you're reusing a local variable name inside one module.
|
# ? Sep 17, 2012 22:07 |
|
I'm using Coffeescript. It encapsulates every .coffee file compiled into a function, so unless you specifically assign a variable to the window or global (for servers) object, it will not be a global variable. You have to manually export variables you want to be used by other files in your code base. I personally haven't had any dramas getting it to do what I want it to do. edit: all it's really doing is flipping around the default JavaScript behaviour so you imply locals rather than globals in assignment. Maluco Marinero fucked around with this message at 23:20 on Sep 17, 2012 |
# ? Sep 17, 2012 23:07 |
|
Optimus Prime Ribs posted:Looks like someone doesn't fully understand how to use booleans: Except, as silly as it is, that could actually serve a purpose. If they're both false, then the user hasn't yet registered an opinion on the disclaimer. If the 'acceptedDisclaimer' is 'yes', then they've seen and accepted the disclaimer. If the 'acceptedDisclaimer' is 'no', then they've seen and rejected the disclaimer. 'yes' and 'no' are obviously, in this instance, strings that are set when the user either accepts or rejects the disclaimer. Is it a great way to do it? Probably not, but it's not that much of a horror, really.
|
# ? Sep 18, 2012 00:51 |
|
e
Blotto Skorzany fucked around with this message at 16:36 on Sep 19, 2012 |
# ? Sep 18, 2012 01:15 |
|
Otto Skorzeny posted:Another department is trying to force my department to use Visual Source Safe for all new development (despite the fact that we don't and can't use visual studio for any of our projects). I know VSS is a piece of poo poo, can people spam me objective info to fight this with? Wikipedia posted:The final version of the product, Visual SourceSafe 2005, retired from mainstream support on 10 July 2012 with extended support ending on 11 July 2017.
|
# ? Sep 18, 2012 01:21 |
|
bobthecheese posted:Except, as silly as it is, that could actually serve a purpose. That seems like something better represented by true, false, null for accept, decline, no response.
|
# ? Sep 18, 2012 01:32 |
|
http://www.developsense.com/testing/VSSDefects.html is the classic anti-VSS rant. If it makes you feel any better, I just had to extract our old VSS database and pull it into SVN to figure some things out. VSS2SVN.exe took the better part of the day but did work quite well. God I wished I had done things like comment commits back then.
|
# ? Sep 18, 2012 01:49 |
|
classic anti-VSS rant posted:Create a project called A. To this project, add a file named 1.c. Optionally revise the file; then delete it from A. Add a different file called 1.c to A; you will be offered the choice to recover the file, or to purge it from the database. Choose not to recover the deleted file, but instead to add your new file. Display the history of the project, and attempt to Get a version of that project from before 1.c was deleted. You will find that the original version of 1.c is not available, and thus your project cannot be rebuilt. Surely this on its own is cause for immediate rejection of VSS. You can trivially lose an entire file of data.
|
# ? Sep 18, 2012 01:58 |
|
Zamujasa posted:That seems like something better represented by true, false, null for accept, decline, no response.
|
# ? Sep 18, 2012 02:03 |
|
Gigantic Slut Man posted:CoffeeScript is lexically scoped, but you don't have access to var, so you can't avoid changing the value of a variable from the outer scope other than by trying to make a unique variable name. If your function finds itself in a scope with foo, and you've named a variable foo, you're modifying the external foo. There's no declaration syntax available, only assignment with implicit declaration if the variable doesn't already exist. you can get around this with coffeescript's do keyword, which makes an anonymous function wrapper and immediately invokes it. it's meant more for like inside a loop which generates functions to avoid closing over the same variable in each function (JS suffers the exact same scoping issue in this case, just with a more verbose workaround) CoffeeScript code:
|
# ? Sep 18, 2012 06:24 |
|
Plorkyeran posted:You can only store strings in cookies, and using "true"/"false" is easier to confuse for an actual boolean value. No value set is equivalent to null. I think he was referring to the values and variables used within the program itself, not the value stored in the cookie. As it is, $acceptedDisclaimer is true if the disclaimer was accepted, $declinedDisclaimer is true if the disclaimer was declined, and both are false if there was no response. It sounds like he was suggesting that $acceptedDisclaimer should be true if the disclaimer was accepted, false if it was declined, and null otherwise; and that $declinedDisclaimer should be done away with.
|
# ? Sep 18, 2012 08:00 |
|
My main problem with CoffeeScript, of which this argument is a symptom, is the mind-boggling belief (incorrect, in my opinion) that implicit is better than explicit. There are cases where it's useful to have implicit operations, but as a basic language design concept, I think it's horrible.
|
# ? Sep 18, 2012 08:54 |
|
To see what I mean:
|
# ? Sep 18, 2012 09:01 |
|
Plorkyeran posted:You can only store strings in cookies, and using "true"/"false" is easier to confuse for an actual boolean value. No value set is equivalent to null. I am the horror. With this web app prototype I'm building I'm experimenting with IndexedDB, unfortunately it doesn't do indexes for booleans yet. Enter "true" and "false", although I should probably just change it in a function when they get applied to the object prototype I guess. edit: Above, I see what you mean, although in the end of the day that IS the syntax, largely taken from Ruby's way of doing things. It's pretty clear to anyone who works with the language exactly what the problem is. For my mind the pros of working with Coffeescript outweigh the cons for me, although I guess I really haven't explored alternatives for languages that compile to javascript. Maluco Marinero fucked around with this message at 09:11 on Sep 18, 2012 |
# ? Sep 18, 2012 09:05 |
|
Maluco Marinero posted:edit: Above, I see what you mean, although in the end of the day that IS the syntax, Shrugging your shoulders and going "well that's just the way it is" when it's entirely possible to change something is a bit of a horror. Coffeescript is at the point where they should be identifying pain points and fixing them, not just settling for "marginally better than plain JavaScript"
|
# ? Sep 18, 2012 09:44 |
|
I guess by saying that that IS the syntax, I mean that it's pretty straightforward that a variable name directly followed by () is a function call with no arguments. This isn't some obscure rule here, it's the parentheses free style which is demonstrated throughout the language and it's documentation. It's not something I entirely like working with myself, I ended up working with Python rather than Ruby for other stuff I've done, but it IS the syntax they've chosen, and it's an entirely consistent behaviour within that syntax. Maluco Marinero fucked around with this message at 10:12 on Sep 18, 2012 |
# ? Sep 18, 2012 10:01 |
|
Jabor posted:Shrugging your shoulders and going "well that's just the way it is" when it's entirely possible to change something is a bit of a horror. They're far past that point. They've declared language stability: they cannot break existing code. CoffeeScript makes certain tradeoffs. Sometimes design features are mutually exclusive. The designer has put his foot down re: shadowing. It won't change. To be honest, I doubt the CoffeeScript designer thought about all these ambiguous edge cases; that really only comes with experience.
|
# ? Sep 18, 2012 10:04 |
|
Gigantic Slut Man posted:To see what I mean: C++ code:
|
# ? Sep 18, 2012 11:54 |
|
e
Blotto Skorzany fucked around with this message at 16:36 on Sep 19, 2012 |
# ? Sep 18, 2012 14:08 |
|
Thermopyle posted:Now I want to write an RTS in Python. Scala has traits and would be quite interesting to do. Is OpenGL for the jvm still horrible?
|
# ? Sep 18, 2012 14:47 |
|
PrBacterio posted:Incidentally, this exact same issue is also something that has always bugged me about the C preprocessor: What would you expect it to do?
|
# ? Sep 18, 2012 14:54 |
|
that awful man posted:I think he was referring to the values and variables used within the program itself, not the value stored in the cookie. Yeah that was my problem with it. This would have made a lot more sense: PHP code:
e: Yeesh. I'm glad I never have to work with CoffeeScript. Optimus Prime Ribs fucked around with this message at 15:19 on Sep 18, 2012 |
# ? Sep 18, 2012 15:16 |
|
hobbesmaster posted:What would you expect it to do? Yeah, I'm confused as to what the problem is here. If it didn't do this, how would you define non-function-style macros that start with parentheses? Would you make a new syntax? I think this is the most concise way to do it.
|
# ? Sep 18, 2012 17:47 |
|
I'm not sure I've ever seen anyone run into that problem writing CoffeeScript. Mainly because having a function that returns a function which takes a function as input seems to be a coding horror in itself.
|
# ? Sep 18, 2012 18:43 |
|
Strong Sauce posted:I'm not sure I've ever seen anyone run into that problem writing CoffeeScript. Mainly because having a function that returns a function which takes a function as input seems to be a coding horror in itself. doesn't seem like a horror on its face, isn't that what a combinator does?
|
# ? Sep 18, 2012 18:50 |
|
Deus Rex posted:doesn't seem like a horror on its face, isn't that what a combinator does? EDIT: That Turkey Story posted:Yeah, I'm confused as to what the problem is here. If it didn't do this, how would you define non-function-style macros that start with parentheses? Would you make a new syntax? I think this is the most concise way to do it. PrBacterio fucked around with this message at 19:20 on Sep 18, 2012 |
# ? Sep 18, 2012 19:17 |
|
I've happened to stumble upon the worst soon-to-be production code I've ever seen in our server application at work the other day. To give some context, our application gets something on the order of 40000 users a day stretched over 24 server nodes, and is written in Java backed by a database. Users access this through a proprietary client that's little more than a frontend for Internet Explorer. All in all, it's running fine - actually very stable compared to what the users use otherwise. The rights system is currently being overhauled completely, server-side. The old system was a database-backed list of roles with occasionally denied privileges depending on the role. Users had accounts with group privileges noted down in a database table. Those privileges were parsed during JSP compiling, and affected parts would simply not be generated on the page. The pages were in a hierarchical structure of static tags, so they could be referenced by the privileges table. The new system first off does away with the database part. Second, rights for certain parts of our business logic are defined through annotations in central classes now, about 50 classes in total. This wouldn't be so bad if not for a) the privileges for specialised business objects being annotated in their general superclasses b) the ratio of annotation-to-code being 8:1 or worse in affected classes. I've literally found a sub-300-line class (imports included) touting over 2200 lines of annotations. It gets worse! From these monolithic annotated classes, a batch (actually part of production code) will, on deployment, generate a massive XML containing the entire rights management. Should the user log on to our server application, a section of this xml will be cached in a server-side session attribute. JSPs will be generated according the the read privileges, yada yada. But the rights are now frozen in the code until the next version comes out, 4 months or so later. What if someone decides that some random role needs different rights after all? Then they have to get someone to manipulate the XML that was generated earlier, by hand. And file a ticket to change it for the next version. There is no graphical interface to do that, or a tool to do it more conveniently aside from general XML tools. If they for some reason have to regenerate the XML and forget whatever changes they had made before the next version came out, they would have to figure them out all over again. All this not only got past our architect, but he actually decided on it. He decided against a database-backed solution. Every single person involved, except maybe him, gets angry very quickly if you so much as mention the topic. I am ever so glad I was too busy with other tasks to get suckered into this. Eliza fucked around with this message at 20:25 on Sep 18, 2012 |
# ? Sep 18, 2012 19:50 |
|
Strong Sauce posted:I'm not sure I've ever seen anyone run into that problem writing CoffeeScript. Mainly because having a function that returns a function which takes a function as input seems to be a coding horror in itself. Common LISP: the ultimate horror.
|
# ? Sep 18, 2012 20:19 |
|
Eliza posted:I've happened to stumble upon the worst soon-to-be production code I've ever seen in our server application at work the other day. Misused OO can also to an extent be horrible, but in my experience it's usually just that someone has simply implemented an OO structure that does almost nothing, so it's (mostly) just about refactoring code for a while and flattening the hierarchy. I don't doubt that there are examples of some seriously insane inheritance hierarchies out there, though, that make it a pain to do anything with. * Of course, that kind of code can also indicate a poorly skilled developer overall, but can also just be a newbie.
|
# ? Sep 18, 2012 20:20 |
|
Strong Sauce posted:I'm not sure I've ever seen anyone run into that problem writing CoffeeScript. Mainly because having a function that returns a function which takes a function as input seems to be a coding horror in itself. So I guess Haskell as a whole is just a horrible language and shouldn't exist. Huh.
|
# ? Sep 18, 2012 20:49 |
|
Deus Rex posted:doesn't seem like a horror on its face, isn't that what a combinator does? I guess calling it a horror was pretty extreme, but stylistically to me a()(b) looks very ugly when for the most part a(b) will work.
|
# ? Sep 18, 2012 20:58 |
|
Look Around You posted:So I guess Haskell as a whole is just a horrible language and shouldn't exist. Huh. Yup.
|
# ? Sep 18, 2012 21:44 |
|
PrBacterio posted:I was only pointing out that this is the exact same syntactical issue as what was brought up with Coffeescript, and so if it bothers you in the one case it should also do so in the other and vice-versa. Uh. One's a high level language designed for writing production code and the other is a macro language. Nobody is advocating you write serious applications in C Preprocessor macros dude. It's not a fair comparison.
|
# ? Sep 18, 2012 22:19 |
|
That Turkey Story posted:Yeah, I'm confused as to what the problem is here. If it didn't do this, how would you define non-function-style macros that start with parentheses? Would you make a new syntax? I think this is the most concise way to do it. The preprocessor really should always insert parens for you automatically. I can't think of a single reason for it not to.
|
# ? Sep 18, 2012 22:27 |
|
Gigantic Slut Man posted:Uh. One's a high level language designed for writing production code and the other is a macro language. Nobody is advocating you write serious applications in C Preprocessor macros dude. It's not a fair comparison. I think he's just saying that the wart is basically the same wart without making a judgment about whether that particular wart is more tolerable in one place than the other.
|
# ? Sep 18, 2012 22:48 |
|
Suspicious Dish posted:The preprocessor really should always insert parens for you automatically. I can't think of a single reason for it not to. code:
Amarkov fucked around with this message at 22:56 on Sep 18, 2012 |
# ? Sep 18, 2012 22:53 |
|
Amarkov posted:
That doesn't parse E: nmd, you fixed it.
|
# ? Sep 18, 2012 22:56 |
|
|
# ? Jun 3, 2024 20:15 |
|
Suspicious Dish posted:The preprocessor really should always insert parens for you automatically. I can't think of a single reason for it not to. You mean have macros always expand to something parenthesized? That wouldn't work -- the are lots of times where you don't want the expansion to result in something that's parenthesized I.E. almost anything that doesn't result in an expression.
|
# ? Sep 18, 2012 23:01 |