|
Emoji are great
|
# ? Nov 20, 2012 16:14 |
|
|
# ? May 29, 2024 19:15 |
|
ninjeff posted:The word you posted for 'if' literally means 'case' (the noun). The one for 'while' isn't really considered a word; it's just a verb suffix, like '-ing' in English. There's a whole list of alternatives, too, if you look under the 'preferred' translation: なら if, in case と and, if もし if, supposing, in case ならば if, in case 仮令 though, if, even if, although よしんば if 暁 if None of those work well enough to be a semi-formal stand-in?
|
# ? Nov 20, 2012 16:39 |
|
Munkeymon posted:よしんば if
|
# ? Nov 20, 2012 16:46 |
|
That way lies Programmiglyphics.
|
# ? Nov 20, 2012 18:19 |
|
Remember back a few hundred years ago how if you wanted to be a serious member of the scientific community, no matter what your mother tongue was, you learned Latin? Let's just go back to that for programmers. Somehow this thread always comes back to this: Lingua::Romana::Perligata.
|
# ? Nov 20, 2012 22:41 |
|
Damian Conway is a crazy person.
|
# ? Nov 21, 2012 07:12 |
|
Munkeymon posted:There's a whole list of alternatives, too, if you look under the 'preferred' translation: That's up to a native Japanese-speaking language designer to decide! I'm just trying to dispel the notion that word-for-word replacements are possible for control structures in general. See Zhentar's post for how the grammar would have to change.
|
# ? Nov 21, 2012 10:37 |
|
From the openGL docs:code:
|
# ? Nov 21, 2012 12:49 |
|
Flobbster posted:Remember back a few hundred years ago how if you wanted to be a serious member of the scientific community, no matter what your mother tongue was, you learned Latin? Let's just go back to that for programmers. Suffix based languages with many gramatical moods and where word order is used for emphasis rather than meaning could be an excellent basis for programming languages for people who like to use chained object notation to construct libraries to make code that reads a little bit like English in. If you can rearrange the words to get the same compiled code you can go wild making your code look like poetry.
|
# ? Nov 21, 2012 13:02 |
|
Amarkov posted:I've seen so many worse things, but there's a neat simplicity to function arguments which have a mandatory and constant value. It's for compatibility with older versions of OpenGL (pre 3.x). You could pass 1 there to have a border around your texture.
|
# ? Nov 21, 2012 13:09 |
|
Zombywuf posted:If you can rearrange the words to get the same compiled code you can go wild making your code look like poetry. http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html
|
# ? Nov 21, 2012 16:12 |
|
Er, yes? That is what I was talking about. (could also do a Finnish version though)
|
# ? Nov 21, 2012 16:50 |
|
Zombywuf posted:Er, yes? That is what I was talking about. (could also do a Finnish version though) Oh whoops, didn't see it linked in the quote somehow.
|
# ? Nov 21, 2012 16:52 |
|
Zombywuf posted:(could also do a Finnish version though) make our code ievan polkka https://www.youtube.com/watch?v=8ySEwZN78nc
|
# ? Nov 21, 2012 17:32 |
|
finnish polka? https://www.youtube.com/watch?v=9wVH1kxqT9k
|
# ? Nov 21, 2012 18:21 |
|
Any excuse to post a Lenningrad Cowboys video https://www.youtube.com/watch?v=j3tKqPWQHkc
|
# ? Nov 21, 2012 18:45 |
|
php:<? if(isset($_REQUEST["some_var"])) $some_var = mysql_real_escape_string($_REQUEST["some_var"]); /* ... */ $myxml = "<ShitXML Ver = \"1.0.0\">"; $myxml .= "<ShitVar>". $some_var ."</ShitVar>"; /* ... */ ?>
|
# ? Nov 21, 2012 20:31 |
|
I don't think I've ever manually built XML like that, unless you count HTML. But recently I ported (from VB6 to C#) a part of an application that manually generates a particular type of EDI files, and I didn't change the approach at all. My code is therefore full of crap like this:C# code:
|
# ? Nov 22, 2012 09:40 |
|
Zamujasa posted:
i had to make a change to this script (written within the last two months!!) one time PHP code:
|
# ? Nov 22, 2012 09:54 |
|
LOOK I AM A TURTLE posted:I don't think I've ever manually built XML like that, unless you count HTML. But recently I ported (from VB6 to C#) a part of an application that manually generates a particular type of EDI files, and I didn't change the approach at all. My code is therefore full of crap like this: I think Zamujasa was calling it cargo-cult because the author begins by using a database escape function, when the data seems not to be destined for a database. Thereby displaying a lack of insight into what the purpose of the escape function is and why it might appear in other code the author had seen.
|
# ? Nov 22, 2012 18:27 |
|
Hammerite posted:I think Zamujasa was calling it cargo-cult because the author begins by using a database escape function, when the data seems not to be destined for a database. Thereby displaying a lack of insight into what the purpose of the escape function is and why it might appear in other code the author had seen. This is a case where is would be pertinent to comment why the mysql_real_escape_string is being called. Maybe the XML needs to be escaped that way for a legitimate reason? Without knowing the 'why', the next programmer is bound to think it's an error, remove it, and potentially cause a bug that is very hard to track down. In other words, the horror isn't necessarily the escaping, the horror is not properly commenting the escaping.
|
# ? Nov 22, 2012 18:40 |
|
LOOK I AM A TURTLE posted:
|
# ? Nov 22, 2012 19:58 |
|
Deus Rex posted:
Well what did you expect, echo json_encode(array('error'=>'Must specify platform'));?
|
# ? Nov 22, 2012 20:08 |
|
A Flaming Chicken posted:Emoji symbols work quite well in Google email addresses on a Mac too e.g foo+emojisymbol@gmail.com Doesn't matter too much for gmail, since everything after the + is extraneous. Assuming you meant that literally
|
# ? Nov 22, 2012 21:45 |
|
Golbez posted:Doesn't matter too much for gmail, since everything after the + is extraneous. Assuming you meant that literally It makes it easy to set up filters You basically get a bunch of different addresses, all of which end up in the same account.
|
# ? Nov 22, 2012 23:21 |
|
Aleksei Vasiliev posted:why do people name variables like this, it's awful
|
# ? Nov 23, 2012 00:08 |
|
Why not just use sb? Naming it stringBuilder has no positive effect and makes it unreasonably long.
|
# ? Nov 23, 2012 00:34 |
|
Aleksei Vasiliev posted:Why not just use sb? Naming it stringBuilder has no positive effect and makes it unreasonably long. Readability, you don't want to open a file with tons of abbreviated variables wondering what on earth they are used for. Surely some IDE's (like Visual Studio) just tell you what kind of object the variable is, but a ton of others don't. If you're a solo developer, then by all means abbreviate the living hell out of your variable names, just don't put up others with the pain of trying to figure out what sb is used for.
|
# ? Nov 23, 2012 01:09 |
|
sb is perfectly readable for a local variable that lasts all of 8 lines in one scope. It would be terrible for a parameter name or a global variable or anything like that, but saying, in this context, that stringBuilder is more readable is close to absurd.
|
# ? Nov 23, 2012 01:20 |
|
Lonely Wolf posted:sb is perfectly readable for a local variable that lasts all of 8 lines in one scope. It would be terrible for a parameter name or a global variable or anything like that, but saying, in this context, that stringBuilder is more readable is close to absurd. I always use tmp for those variables. If its no longer clear what tmp does, it needs a real name.
|
# ? Nov 23, 2012 01:37 |
|
Lonely Wolf posted:sb is perfectly readable for a local variable that lasts all of 8 lines in one scope. It would be terrible for a parameter name or a global variable or anything like that, but saying, in this context, that stringBuilder is more readable is close to absurd. Have to agree with this guy here.
|
# ? Nov 23, 2012 01:55 |
|
Lonely Wolf posted:sb is perfectly readable for a local variable that lasts all of 8 lines in one scope. It would be terrible for a parameter name or a global variable or anything like that, but saying, in this context, that stringBuilder is more readable is close to absurd. split the difference and call it builder and end this banal argument
|
# ? Nov 23, 2012 01:58 |
|
Why name it at all?C# code:
|
# ? Nov 23, 2012 02:21 |
|
Or just skip the StringBuilder entirely as it almost certainly doesn't have a meaningful speed benefit there and is twice as much code.
|
# ? Nov 23, 2012 02:49 |
|
Seriously, you have a grand total of two actual string concatenations happening, the rest are all constant strings tacked on to other constant strings.
|
# ? Nov 23, 2012 03:25 |
|
I am pretty sure Java desugars long String + chains into StringBuilder calls, does C# not do the same?
|
# ? Nov 23, 2012 05:29 |
|
OddObserver posted:I am pretty sure Java desugars long String + chains into StringBuilder calls, does C# not do the same? C# doesn't do that, unless I'm hugely mistaken. It converts string concatention into string.Concat calls. Of course, it all falls under the umbrella of "useless micro-optimization".
|
# ? Nov 23, 2012 05:45 |
|
Anytime you're creating a new builder, stuffing things into it, then turning it into a string without having a big loop of appending somewhere in the middle, it's usually pointless. The correct way to use a string builder is to pass it around and have things append to it directly instead of creating strings themselves.
|
# ? Nov 23, 2012 06:24 |
|
hobbesmaster posted:I always use tmp for those variables. If its no longer clear what tmp does, it needs a real name. aughghghhhhhhhhhhhhhhhhh There is nothing about that variable that makes it more temporary than the average local variable. You might as well call it data or var or stuff or thingy. All of them would be equally descriptive. It is never clear what tmp does based on the name. Even if the defining characteristic of the variable was that it was temporary, it's still not a good name. It's an adjective -- it would be like naming a variable big. I would absolutely never hire anyone who misunderstands the concept of naming things so fundamentally that they name them tmp. Name things what they are. It's extremely simple. stringBuilder is a perfectly fine name, and if this were an object property or parameter name, it would be the only acceptable name to me (unless there were multiple StringBuilder properties or parameters, in which case the names would need to be made more specific). In this context as a local variable, builder would be fine. sb is not nearly as bad as tmp, but it's still bad. It might not be that confusing in this particular instance, but if you ever have an abbreviated name that ends up getting used outside the immediate context of where it's declared, people aren't going to know what it is. If I just saw sb by itself I would have no idea what it means because it has no inherent meaning. In contrast I know exactly what stringBuilder means. I'll probably know what builder is too, or at the very least I'll know that it builds something. If you're really worried about how long it takes to type out stringBuilder, take some typing lessons. And if you're working in an environment without autocomplete you're doing something wrong.
|
# ? Nov 23, 2012 09:18 |
|
|
# ? May 29, 2024 19:15 |
|
Gordon Cole posted:It is never clear what tmp does based on the name. "tmp" is pretty much the worst name for a variable ever. Every time I've seen a variable named tmp or temp, the surrounding code has been poo poo.
|
# ? Nov 23, 2012 10:16 |