DStaal Posted March 18, 2020 Share Posted March 18, 2020 18 minutes ago, Incarnation of Chaos said: Where did he use "=" instead of "=="? I know "=" assigns a value to a variable, and "==" compares two variables. iv'e been writing conditional statements and loops most of the evening actually, so i guess my brain may be a bit fried and i'm not seeing something right in front of me. He didn’t - but the fact that you're still asking me is proves the point of how easy a typo it is to overlook, and it's one that you will make if you type enough comparisions. This is a good way to prevent it from being a headache later. I'll admit it does depend on language - but the only language I've had major experience with which wasn't subject to this was COBOL, and that's because it's long-winded enough that it's not using the same operators. (And @kfsone - I've worked in some of the languages you're using as examples against - and they allowed it. Heck, I originally learned this in best practices for one of them. I'd have to analyse a bit to figure out what's going on in your examples - but this digression has gone on plenty long enough. Suffice I think it's common enough to think about, but that you do have to be aware of what you're comparing. This is really only relevant for simple constants/comparisons - anything else and it doesn't work anyway.) Link to comment Share on other sites More sharing options...
Incarnation of Chaos Posted March 18, 2020 Share Posted March 18, 2020 5 minutes ago, DStaal said: He didn’t - but the fact that you're still asking me is proves the point of how easy a typo it is to overlook, and it's one that you will make if you type enough comparisions. This is a good way to prevent it from being a headache later. I'll admit it does depend on language - but the only language I've had major experience with which wasn't subject to this was COBOL, and that's because it's long-winded enough that it's not using the same operators. (And @kfsone - I've worked in some of the languages you're using as examples against - and they allowed it. Heck, I originally learned this in best practices for one of them. I'd have to analyse a bit to figure out what's going on in your examples - but this digression has gone on plenty long enough. Suffice I think it's common enough to think about, but that you do have to be aware of what you're comparing. This is really only relevant for simple constants/comparisons - anything else and it doesn't work anyway.) Well yeah; though i seem to misplace brackets or semi-colons more than flub on a comparison xD Link to comment Share on other sites More sharing options...
kfsone Posted March 18, 2020 Author Share Posted March 18, 2020 21 minutes ago, DStaal said: He didn’t - but the fact that you're still asking me is proves the point of how easy a typo it is to overlook, and it's one that you will make if you type enough comparisions. This is a good way to prevent it from being a headache later. I'll admit it does depend on language - but the only language I've had major experience with which wasn't subject to this was COBOL, and that's because it's long-winded enough that it's not using the same operators. (And @kfsone - I've worked in some of the languages you're using as examples against - and they allowed it. Heck, I originally learned this in best practices for one of them. I'd have to analyse a bit to figure out what's going on in your examples - but this digression has gone on plenty long enough. Suffice I think it's common enough to think about, but that you do have to be aware of what you're comparing. This is really only relevant for simple constants/comparisons - anything else and it doesn't work anyway.) It caught me by surprise early on, when I moved from BCPL to C, took me weeks to figure out the bug the first time. SAS C wasn't terribly generous with errors/warnings but I was also writing a compiler generator so I had several layers to try and figure out. Link to comment Share on other sites More sharing options...
RoninFrog Posted March 19, 2020 Share Posted March 19, 2020 1 hour ago, DStaal said: Case3: planet = planet.Dres; if planet.Eeloo = planet { print true; } 1 hour ago, DStaal said: Case 3 won't compile Ah yees, because is Eeloo really a planet? Link to comment Share on other sites More sharing options...
Superfluous J Posted March 19, 2020 Share Posted March 19, 2020 1 hour ago, Incarnation of Chaos said: Where did he use "=" instead of "=="? In the (not-so) fictional universe where the programmer made a typo. IF you get in the habit of writing it "if string value == variable" then your typos generate errors. If you get in the habit of writing "if variable == string value" then your typos generate bugs that you may not notice until a long time later. Link to comment Share on other sites More sharing options...
shdwlrd Posted March 19, 2020 Share Posted March 19, 2020 6 hours ago, kfsone said: Sure - golang turned 130,000 lines+ - snipped- I'm expecting people to take certain things for granted here, so I acknowledge that I'm not providing end-to-end concrete proof that all other possibilities aren't in play. If you're actually interested, there's plenty of good stuff on language design and parsing out there Was this what you were asking or were you referring back earlier to my example of XML vs CFG vs JSON? That was what I was looking for, thanks for the clarification. Link to comment Share on other sites More sharing options...
dave1904 Posted March 20, 2020 Share Posted March 20, 2020 I would suggest you guys take this to the international subforum. This is the english forum section. Link to comment Share on other sites More sharing options...
έķ νίĻĻάίή Posted March 30, 2020 Share Posted March 30, 2020 I hope that they store the part models as either an .Stl file or an .Obj so that I can mess around with it or 3D print my own rocket. Link to comment Share on other sites More sharing options...
Recommended Posts