|
minato posted:Do you put commas at the end of the line or the beginning? I thought I was the only one who did this!
|
# ? Jul 31, 2011 21:26 |
|
|
# ? May 14, 2024 21:15 |
|
MS SQL Server does the comma first style as well when you autogenerate SELECT queries in SSMS.
|
# ? Jul 31, 2011 22:39 |
|
What? No it doesn't, at least circa 2008. Are you running an addin that's doing it for you like something from RedGate?
|
# ? Aug 1, 2011 00:52 |
|
qntm posted:I thought I was the only one who did this! code:
|
# ? Aug 1, 2011 01:55 |
|
Volte posted:It's the standard practice in Haskell:
|
# ? Aug 1, 2011 02:11 |
|
PrBacterio posted:Huh? (Not talking about the placement of the commans here but the braces instead but), I won't pretend that I actually know Haskell but I've always been led to believe that standard practice in Haskell was to leave all braces out because they'll be inferred automatically by an indentation-based rule, kind of like Python. Declaring records is pretty much one of the few places that braces are required.
|
# ? Aug 1, 2011 02:17 |
|
PrBacterio posted:Huh? (Not talking about the placement of the commans here but the braces instead but), I won't pretend that I actually know Haskell but I've always been led to believe that standard practice in Haskell was to leave all braces out because they'll be inferred automatically by an indentation-based rule, kind of like Python. What yaoi prophet said, and also: using braces and semicolons is also very convenient for other forms of syntax that _could_ rely on indentation, because often it's easy to need to change the indentation of something, and it's a lot easier to get your editor to do it right if you used the braces.
|
# ? Aug 1, 2011 04:02 |
|
Zhentar posted:That is pretty terrible. If he never makes you fix that poo poo yourself, you're never going to stop doing it. but then he is doing standard coding standard, ie he is doing code:
code:
|
# ? Aug 1, 2011 12:51 |
|
Factor Mystic posted:What? No it doesn't, at least circa 2008. Are you running an addin that's doing it for you like something from RedGate? Yeah it does. In both 2005 and 2008 R2 at least. Open SSMS, go find a table, right click on it, Script Table as >, SELECT To >, New Query Editor Window. Commas first.
|
# ? Aug 1, 2011 12:55 |
|
TRex EaterofCars posted:Yeah it does. In both 2005 and 2008 R2 at least. I stand corrected. It doesn't do that for drop/create script creation though, which is what I checked when I read your post. Anyway, gross. Add that to the unending list of SSMS failures I intend to solve with my SQL IDE.
|
# ? Aug 1, 2011 15:17 |
|
qntm posted:I thought I was the only one who did this! There's something of a movement in JavaScript-land for comma-first too. code:
|
# ? Aug 1, 2011 19:50 |
|
pokeyman posted:JavaScript I'm surprised that doesn't parse var a = "ape" as a complete statement and throw a syntax error on the next line.
|
# ? Aug 1, 2011 20:09 |
|
shrughes posted:I'm surprised that doesn't parse var a = "ape" as a complete statement and throw a syntax error on the next line. Why would that surprise you in a language that uses a line termination character?
|
# ? Aug 1, 2011 20:12 |
|
No Safe Word posted:Why would that surprise you in a language that uses a line termination character? Because it's optional.
|
# ? Aug 1, 2011 20:14 |
|
shrughes posted:I'm surprised that doesn't parse var a = "ape" as a complete statement and throw a syntax error on the next line. code:
ASI has to be one of the worst ideas ever.
|
# ? Aug 1, 2011 20:20 |
|
Torn between this thread and the poo poo that pisses you off thread...code:
Edit: code:
xarph fucked around with this message at 02:11 on Aug 2, 2011 |
# ? Aug 2, 2011 02:07 |
|
xarph posted:Torn between this thread and the poo poo that pisses you off thread... That's like every init script ever written. I've seen one that used a web-interface to shut down the daemon, and never checked the output to find if that failed or not.
|
# ? Aug 2, 2011 02:22 |
|
e:nvm I'm an idiot.
|
# ? Aug 2, 2011 10:14 |
|
Have to say the amount this thread has made me laugh has shown me I both know way more about programming than I realized and that I could have it wayyyy worse. The peak, for as far as I've gotten, was definitely the conversation about using prime factorization to set up parameter combinations. I don't have any specific examples, but the project I'm working on is a mobile+server project. Version 1.0 of the django backend has several decent bits of way-too-complex logic copy pasted and many reimplimented features because the previous dev blatantly (from his code and talking to him) didn't trust the libraries. The iOS code is a set of classes with no hierarchy, as in no folder organization and no subclasses, and the query organization is basically a chain of HTTP requests whose response delegate targets are almost always in different classes. It basically turns into every time we need to hack something into the spaghetti code that we haven't had time to rewrite yet. A lot of it is basically stuff you'd expect an intern or a novice programmer to do, but this guy has been a developer for about a decade
|
# ? Aug 3, 2011 18:35 |
|
ultramiraculous posted:The iOS code is a set of classes with no hierarchy, as in no folder organization and no subclasses... For what it's worth, default Xcode behaviour is to throw everything in one folder, so you see tons of iOS/Mac apps that have no folder organization. As for the lack of subclasses, I'm trying to picture an Objective-C project where no class has a superclass. It's an ugly picture.
|
# ? Aug 3, 2011 20:08 |
|
Aleksei Vasiliev posted:If you wrap your lines at 80 characters I literally hate you irl gently caress you i code in a terminal all the loving time
|
# ? Aug 4, 2011 04:49 |
|
the talent deficit posted:gently caress you i code in a terminal all the loving time
|
# ? Aug 4, 2011 05:00 |
|
So he can fit another one next to it
|
# ? Aug 4, 2011 05:09 |
|
I thought 80-chars was a hold-over from having to print out source code in university and not have it wrap. Python basically forces you to break that convention unless you like to use really short names for everything or end up cramming everything on the right side of the editor eventually.
|
# ? Aug 4, 2011 05:21 |
|
i usually use a 87 character terminal because at my resolution and font size three 87 character windows just barely fit
|
# ? Aug 4, 2011 05:24 |
|
Shumagorath posted:I thought 80-chars was a hold-over from having to print out source code in university and not have it wrap. Python basically forces you to break that convention unless you like to use really short names for everything or end up cramming everything on the right side of the editor eventually. Of all the programming languages in use today, your example of one whose lines can't fit within 80 characters is the only one that suggests you do so.
|
# ? Aug 4, 2011 06:56 |
|
My terminal is 85 characters wide, so there's room for 4-digit line numbers and a space in Vim. Same with Emacs windows.
|
# ? Aug 4, 2011 12:20 |
|
mr_jim posted:4-digit line numbers This is the real coding horror.
|
# ? Aug 4, 2011 12:56 |
|
ninjeff posted:This is the real coding horror. They usually don't get that high. If they do, they're much closer to 1000 than to 9999.
|
# ? Aug 4, 2011 13:13 |
|
pokeyman posted:Of all the programming languages in use today, your example of one whose lines can't fit within 80 characters is the only one that suggests you do so. Suggestions are made to be ignored, in accordance with how stupid they are, how outdated, or how much you find that something else simply works better for you.
|
# ? Aug 4, 2011 13:56 |
|
A A 2 3 5 8 K posted:Suggestions are made to be ignored, in accordance with how stupid they are, how outdated, or how much you find that something else simply works better for you.
|
# ? Aug 4, 2011 14:39 |
|
Brecht posted:Coding horror spotted. <says the same thing upon seeing code that you've wrapped at 80 chars because you think you're supposed to do such things> And the cycle continues
|
# ? Aug 4, 2011 14:53 |
|
Brecht posted:Coding horror spotted. "A Foolish Consistency is the Hobgoblin of Little Minds"
|
# ? Aug 4, 2011 14:54 |
|
Shumagorath posted:I thought 80-chars was a hold-over from having to print out source code in university and not have it wrap. Python basically forces you to break that convention unless you like to use really short names for everything or end up cramming everything on the right side of the editor eventually. I'm afraid to look at your code. I've written literally thousands of lines of python code in the past few years and have yet to run into that problem. You should try nesting less and making more clearly defined methods. It will make you love your code. Also, it's 79 columns.
|
# ? Aug 4, 2011 15:02 |
|
A A 2 3 5 8 K posted:"A Foolish Consistency is the Hobgoblin of Little Minds" Yeah, gently caress shared style standards, quite.
|
# ? Aug 4, 2011 17:48 |
|
Brecht posted:Coding horror spotted. He is right. At least: rules always have a reason behind them. It's important to understand the reason why a rule exists. If you understand the reason for the rule, you know enough to determine when breaking the rule is a valid course of action.
|
# ? Aug 4, 2011 18:06 |
|
Shumagorath posted:I thought 80-chars was a hold-over from having to print out source code in university and not have it wrap. Python basically forces you to break that convention unless you like to use really short names for everything or end up cramming everything on the right side of the editor eventually. I dunno, if the crowding on the right side is happening to me, I usually take that to mean that my stuff is too deeply nested. it honestly isn't a constraint I find myself struggling against. I've occasionally had a less verbose function name than I would if I had been programming in something like Objective-C, but nothing I'd call 'short' edit: basically what geonetix said
|
# ? Aug 4, 2011 18:51 |
|
geonetix posted:I'm afraid to look at your code. I've written literally thousands of lines of python code in the past few years and have yet to run into that problem. You should try nesting less and making more clearly defined methods. It will make you love your code. In the case of C++, you can quite easily break the 80-column limit, especially if you're passing any templated arguments (especially using STL pairs). It's a tradeoff between having easily readable names for variables and methods/functions, and having short code. I aim for 80 columns, but in practice it usually ends up at around 100 columns or something that fits on a screen easily. Especially so when I was working on a very large codebase last summer and trying to follow a company's coding standards closely - there were occasionally calls that were impossible to format within 80 columns without doing dumb crap like naming variables A, B, C etc. (which would have violated their code standard anyways) My opinion is this - try to keep your code consistently easily readable in Eclipse/MSVC without scrolling or wrapping, while keeping names of variables and functions consistent but descriptive. And if someone in VIM complains, well, they're the ones choosing to use an archaic editor. There's reasons to keep something easily readable on modern editors, but the 80-line standard is a bit over-restrictive and should die along with floppy disks and CRT monitors. Goreld fucked around with this message at 19:02 on Aug 4, 2011 |
# ? Aug 4, 2011 18:59 |
|
Goreld posted:And if someone in VIM complains, well, they're the ones choosing to use an archaic editor. Are you loving serious. Also most people using VIM don't complain about line length if they're working on modern code.
|
# ? Aug 4, 2011 20:07 |
|
|
# ? May 14, 2024 21:15 |
|
NotShadowStar posted:Are you loving serious. He's quite clearly an emacs user
|
# ? Aug 4, 2011 21:02 |