|
Soricidus posted:The brace goes on the next line for declarations, and on the same line for control constructs. This isn't hard folks and I don't know why so many people get it wrong. I feel like I'm falling into a trap here, but go on, do please tell us why these things should be treated differently.
|
# ? Jun 3, 2016 09:08 |
|
|
# ? Jun 3, 2024 06:37 |
|
stop talking about braces for the billionth time, nobody is ever going to agree, code how you wanna as long as it's in a fairly accepted style and/or matches your team vOv
|
# ? Jun 3, 2016 10:24 |
|
Hammerite posted:I feel like I'm falling into a trap here, but go on, do please tell us why these things should be treated differently. I don't do it, but declarations can often be copied to headers or copied when you need to use them but can't remember all the arguments and don't have intellisense. So not having a brace allows you to cut/paste with a little less fuss. I'm a dirty VIM user who mostly codes Ruby and C++ though. So please discount my opinion. ErIog fucked around with this message at 10:33 on Jun 3, 2016 |
# ? Jun 3, 2016 10:30 |
|
ErIog posted:I don't do it, but declarations can often be copied to headers or copied when you need to use them but can't remember all the arguments and don't have intellisense. That is a reason of sorts to use the newline for function signatures, but in order to justify the inconsistency, it would need to be accompanied by a reason not to use the newline for control flow statements.
|
# ? Jun 3, 2016 11:07 |
|
Hammerite posted:That is a reason of sorts to use the newline for function signatures, but in order to justify the inconsistency, it would need to be accompanied by a reason not to use the newline for control flow statements. It takes up valuable vertical screen space. I have 80 chars left to right, I have a lot fewer rows than that by a lot. Using an entire row for a bracket doesn't just eat a char, it eats 79 chars worth of space on the screen. I do bracket on the same line for everything, but I can understand treating them differently. I think people get bogged down in formatting too much. Consistency is okay, but it shouldn't be prioritized over understandability. ErIog fucked around with this message at 11:18 on Jun 3, 2016 |
# ? Jun 3, 2016 11:14 |
|
ErIog posted:It takes up valuable vertical screen space. I have 80 chars left to right, I have a lot fewer rows than that by a lot. I am sorry that you have to do your coding on a VT220.
|
# ? Jun 3, 2016 12:25 |
|
feedmegin posted:I am sorry that you have to do your coding on a VT220. 80 chars is pretty good for having two windows up side by side with code that's readable. I wouldn't hold everybody to that convention, but I find it useful. So coming from my perspective, having declarations with a bracket on a separate line with other flow control brackets on the same line doesn't seem that crazy to me. If you're coding in Visual Studio in 2016 then you probably don't see much benefit.
|
# ? Jun 3, 2016 12:37 |
|
https://twitter.com/arlogilbert/status/738475551619325952 PHP
|
# ? Jun 3, 2016 13:05 |
|
Can I count on your support for T. Paamayim Nekudotayim for president this November?
|
# ? Jun 3, 2016 14:12 |
|
If it wasn't for php it might have not even called, fouling call statistics!
|
# ? Jun 3, 2016 14:12 |
|
dougdrums posted:Can I count on your support for T. Paamayim Nekudotayim for president this November? "-0.0"
|
# ? Jun 3, 2016 14:16 |
|
I want to nominate the idea of the overloaded right shift operator for horror status. I don't mean <iostream> but the C concept where signedness of the left operand decides between arithmetic and logical shift. I've been developing embedded software for years now and it's never helped me once. It just makes poo poo ugly. Every time I do a right shift I already know the behaviour I want, just let me specify it directly with separate operators. It's not even a good shortcut for division because signed shifts round the wrong way.
|
# ? Jun 3, 2016 14:37 |
|
Dirty Frank posted:VB is horrid and you should move to c# with all possible and prudent haste. And we should never talk about VB again. I dont have the choice, C# is better but a 13 year old codebase says it cant happen
|
# ? Jun 3, 2016 15:05 |
|
ErIog posted:80 chars is pretty good for having two windows up side by side with code that's readable. I wouldn't hold everybody to that convention, but I find it useful. Sure, I can see that horizontally, and I tend to keep it that way myself. But vertically? I've got a 1920x1200 monitor, I'm sure as hell not going to leave my editor window 24 lines long because that was the state of the art in 1975 and I don't see any good argument for doing so. I normally have more vertical than horizontal space.
|
# ? Jun 3, 2016 15:15 |
|
dougdrums posted:Can I count on your support for T. Paamayim Nekudotayim for president this November? T:: or TT:?
|
# ? Jun 3, 2016 15:55 |
|
TheresaJayne posted:I dont have the choice, C# is better but a 13 year old codebase says it cant happen same. we are on vb6, not vb.net. there's no way to directly move. we're slowly just creating new frontend stuff in c#, but that's obviously a slow process when you need to also provide fixes and enhancements on the existing infrastructure to customers.
|
# ? Jun 3, 2016 16:50 |
|
Visual Basic is to software development what WordPress is to web development. It seems like a good idea if and only if you have a very limited idea what you're doing. Unfortunately, since that's how many people/companies start out, you end up getting trapped in a maze of poo poo code you can't convince people to get rid of.
|
# ? Jun 3, 2016 17:20 |
|
LeftistMuslimObama posted:same. we are on vb6, not vb.net. there's no way to directly move. we're slowly just creating new frontend stuff in c#, but that's obviously a slow process when you need to also provide fixes and enhancements on the existing infrastructure to customers. Out of curiosity, if you do a raw cut-and-paste of your VB6 sources folder into a shiny new VB.Net project and toggle off all the safety options, how many errors do you get?
|
# ? Jun 3, 2016 21:32 |
|
ErIog posted:80 chars is pretty good for having two windows up side by side with code that's readable. I wouldn't hold everybody to that convention, but I find it useful. Especially not when the powertools plugin will makes those lines shorter for you
|
# ? Jun 3, 2016 22:12 |
|
NihilCredo posted:Out of curiosity, if you do a raw cut-and-paste of your VB6 sources folder into a shiny new VB.Net project and toggle off all the safety options, how many errors do you get? All of them. I don't even know if you can build an activex component in .Net. I'm told that we tried that at first before deciding on the c# transition and it was enough manual code editing that it was better to write newer and better stuff from scratch.
|
# ? Jun 4, 2016 00:59 |
|
PT6A posted:Visual Basic is to software development what WordPress is to web development. It seems like a good idea if and only if you have a very limited idea what you're doing. Unfortunately, since that's how many people/companies start out, you end up getting trapped in a maze of poo poo code you can't convince people to get rid of. VB is ugly, but I wouldn't say it's a bad idea per se. I feel like most people encounter VB code that has been around for many years, and as such is not "state of the art." That's been true for my entire career to this point. The real hell is being stuck during the migration between the two languages and continuously forgetting the subtle ways that they're different. That's been true for my entire career to this point.
|
# ? Jun 4, 2016 02:20 |
|
rarbatrol posted:VB is ugly, but I wouldn't say it's a bad idea per se. I feel like most people encounter VB code that has been around for many years, and as such is not "state of the art." That's been true for my entire career to this point. The real hell is being stuck during the migration between the two languages and continuously forgetting the subtle ways that they're different. That's been true for my entire career to this point. As a result of its ugliness and relative simplicity, though, it breeds bad and difficult to maintain code in many cases (see also: PHP and Perl). While there's no reason you should or must write bad code in any language, certain languages tend more toward encouraging it than others, and while all of the above are perfectly serviceable and even useful languages in the right circumstances, it can lead to especially unmaintainable, nightmarish codebases if you're working on a large project that's going to be maintained and improved upon for a long period of time. I will agree comparing it to Wordpress was harsh, because Wordpress itself is a horror, whereas VB is a good tool for certain things that is occasionally used to commit unspeakable sins. Still, I'd say that many of the conditions that lead to them being used in situations where they are far from the best tool for the job are similar.
|
# ? Jun 4, 2016 04:09 |
|
my dad got me a copy of visual basic 6.0 when I was in 5th grade and I made a frogger clone, except nobody taught me how to write loops so there was a timer for every condition I wanted to check and one for each car/truck to update their positions and poo poo. It did not run fast on some machines.
|
# ? Jun 4, 2016 04:18 |
|
PT6A posted:As a result of its ugliness and relative simplicity, though, it breeds bad and difficult to maintain code in many cases (see also: PHP and Perl). While there's no reason you should or must write bad code in any language, certain languages tend more toward encouraging it than others, and while all of the above are perfectly serviceable and even useful languages in the right circumstances, it can lead to especially unmaintainable, nightmarish codebases if you're working on a large project that's going to be maintained and improved upon for a long period of time. yeah. in our case we were one of the first systems in our field to add a gui and at the time the only non-poo poo way to have a gui application on windows was to use vb6, because your alternative was raw win32 apis in c++ and gently caress having anyone work with that when their primary jobs are application developers and database engineers. we're slowly migrating to asp.net, but some teams have more commitments than others so for the time being my team is mostly stuck in vb6 land because we've hit a sales spike and that means lots of change orders and hotfixes for bugs in weird edge cases no one had hit before. my boss actually told me the other day that he wants to promote me fast because im the only person he's ever seen get handed a bug report for one of our vb6 modules and just find and fix the problem without either leaning heavily on an experienced dev for help or running and screaming. the code is painfully poorly organized and often obtuse, but it's kinda inevitable in an enterprise application written in vb6 that's been growing for 16 years.
|
# ? Jun 4, 2016 04:56 |
|
LeftistMuslimObama posted:yeah. in our case we were one of the first systems in our field to add a gui and at the time the only non-poo poo way to have a gui application on windows was to use vb6, because your alternative was raw win32 apis in c++ and gently caress having anyone work with that when their primary jobs are application developers and database engineers. we're slowly migrating to asp.net, but some teams have more commitments than others so for the time being my team is mostly stuck in vb6 land because we've hit a sales spike and that means lots of change orders and hotfixes for bugs in weird edge cases no one had hit before. Sounds like the booking software i used to work for, We ended up having VM to run VB6 whilst the "new team" was converting to C# and Azure. I was hired by the Lead Dev, who then told the board to literally F$%^ Off, and quit leaving the whole project in the lurch, but they didnt ask me if i could help. Instead they did the following: Shortly after i passed the Trial period and had a letter stating so, Then the Manager changed and the new manager sacked me for not updating him when i went on holiday - He left at 3pm and I left at 7pm and he was expecting an update on where i was (i had put full details of where i was in the Ticket and the TFS ) and so I came back from holiday to a cardboard box and no job. I think however it was more about getting rid of anyone who was linked to the Dev Lead who has quit just before - meaning the whole C# team and me, (the original manager also quit to become a hypnotherapist) So the company had then 2 Devs left and shortly after the other new Dev quit and contacted me telling me that they had no idea at all and he left before they crashed. Just in case they are the same company - They are based near a UK international airport in the old Terminal Building.
|
# ? Jun 4, 2016 09:02 |
|
Hammerite posted:I feel like I'm falling into a trap here, but go on, do please tell us why these things should be treated differently. It looks better.
|
# ? Jun 4, 2016 10:05 |
|
code:
|
# ? Jun 6, 2016 21:08 |
|
return0 posted:
Where's the Institutional Review Board when you need them.
|
# ? Jun 6, 2016 21:21 |
|
return0 posted:
How in the world?
|
# ? Jun 6, 2016 21:38 |
|
In all fairness, maybe it's not so weird after reading more about it, but definitely caught me out earlier in a ruby web service we've inherited.
|
# ? Jun 6, 2016 21:51 |
return0 posted:
I'm guessing the first constructs a new String instance and compares it to "", while the second compares "" to the String class itself. (Meta object? Class object?)
|
|
# ? Jun 6, 2016 22:15 |
|
nielsm posted:I'm guessing the first constructs a new String instance and compares it to "", while the second compares "" to the String class itself. (Meta object? Class object?) I've been burned by enough stupid decisions in dynamic languages that I'm going to assume the first doesn't do an equality check at all, but instead checks if "" is of type String.
|
# ? Jun 6, 2016 23:05 |
|
Bognar posted:I've been burned by enough stupid decisions in dynamic languages that I'm going to assume the first doesn't do an equality check at all, but instead checks if "" is of type String. Bingo. The triple-equal is basically "".is_a?(String)
|
# ? Jun 6, 2016 23:20 |
|
Oh my god, you guys are really grasping at straws. Everybody knows you never use === and always use ====, which is the equality operator that actually works. Don't complain just because you haven't put in the time to learn the basics of the language.
|
# ? Jun 6, 2016 23:24 |
|
Next up in our lesson is the 8======D operator.
|
# ? Jun 6, 2016 23:25 |
|
"===" in Ruby is the Case Equality operator and is generally asymmetric. This is usually OK becuase "===" is never directly invoked in idiomatic Ruby, but used to define the comparator for case/when expressions. The way it's defined on Module (and Class) objects is to return true if the right-side is an instance. It lets you do type inspection: code:
I don't think "===" as a case equality operator is horrible. The obvious problem is that it has a totally different meaning in JavaScript, and JS programmers are hard-wired to use "===" everywhere. If you actually see 'foo === "some string"' in Ruby, it's guaranteed to be a mistake by a JS programmer. ExcessBLarg! fucked around with this message at 23:45 on Jun 6, 2016 |
# ? Jun 6, 2016 23:42 |
|
No, I think a programmer who had never seen === before (in any language) but was familiar with == (in Ruby and elsewhere) would probably jump to the assumption that === is some kind of variant equality. They might not know what it is, exactly, but they would probably expect it to be symmetric. Using it for case matching is definitely a weird choice when they could easily have gone with something like ~=.
|
# ? Jun 7, 2016 01:16 |
|
NihilCredo posted:Oh my god, you guys are really grasping at straws. Everybody knows you never use === and always use ====, which is the equality operator that actually works. Don't complain just because you haven't put in the time to learn the basics of the language. I was almost sure that PHP had an honest-to-god ==== operator, but since I can't find it anymore it must have been a joke.
|
# ? Jun 7, 2016 01:21 |
|
rjmccall posted:No, I think a programmer who had never seen === before (in any language) but was familiar with == (in Ruby and elsewhere) would probably jump to the assumption that === is some kind of variant equality. They might not know what it is, exactly, but they would probably expect it to be symmetric. Using it for case matching is definitely a weird choice when they could easily have gone with something like ~=. Yeah, I think that a non-symmetric operator shouldn't look symmetric. "-" can't be helped, but I do miss Pascal's ":=" for assignment.
|
# ? Jun 7, 2016 01:25 |
|
|
# ? Jun 3, 2024 06:37 |
|
There shouldn't be any operators, only explicit function invocation.
|
# ? Jun 7, 2016 01:54 |