Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

10-30-2013 , 09:20 PM
muttiah,

he's not hating on you for using it, nor on c# for having conventions. he's hating on the convention itself for being ugly.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-30-2013 , 09:29 PM
Quote:
Originally Posted by derada4
Yeah I have to admit, as I'm learning C# I've been noticing the chronic { on it's own line and find it very tilting.

I start my C# dev job this Friday...What if everyone there does this? Should I just follow suit? Be an outlaw from the get go? Or wait till I am more established?
Someone hasn't learned Ctrl-e d yet.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-30-2013 , 10:11 PM
Quote:
Originally Posted by daveT
Visual Studio only allows you to do horizontal split on a file would be a major one, at least for me it was.
Why is it a major problem? That seems over the top. I think this is a "religious" issue more than anything else.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-30-2013 , 10:31 PM
Quote:
Originally Posted by derada4
Yeah I have to admit, as I'm learning C# I've been noticing the chronic { on it's own line and find it very tilting.

I start my C# dev job this Friday...What if everyone there does this? Should I just follow suit? Be an outlaw from the get go? Or wait till I am more established?
The only thing worse than people that use their own line for { are people that go against the convention the rest of the team has established.

Edit: I swear we had this discussion a few months ago and I feel like I was in the minority for advocating { on the same line as the conditional.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-30-2013 , 10:42 PM
Quote:
Originally Posted by adios
Why is it a major problem? That seems over the top. I think this is a "religious" issue more than anything else.
The problem is that c# is very tall. I copy/pasted this code from here: https://github.com/sta/websocket-sha...ample2/Chat.cs

This is a comparison of horizontal to vertical:



- vs -



Even on full-screen real estate, which the above images are, I'm surprised that anyone would want to edit on the bottom. This is especially surprising when 20% of the screen real-estate is taken up by VS, allowing you to see 10 LOC at most, which is not enough room to even see a database to repeater function. It's hardly a religious issue.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-30-2013 , 11:19 PM
dave,

vertical split ftmfw and lol i also hate how little of the screen VS gives over to the goddamn code (by default or whatever because you can totally customize the huge fields of icons and panels and dropdowns and tabs to your heart's content! and then do it again when you upgrade your machine! what were we talking about?!)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-30-2013 , 11:19 PM
Quote:
Originally Posted by Urinal Mint
I've heard of R before. How would you recommend learning it?
Documentation is pretty sparse, but if you google around there are some good examples.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 03:11 AM
Quote:
Originally Posted by muttiah
So using standard C# braces and conventions is bad?? Cool story bro.
not sure why you'd get personally offended by this, but there are very few experienced programmers i know who put braces on their own line. just because something is a convention doesn't make it good practice.

as jj said though, if you are on a team the benefit of a single convention is better than doing your own thing, even if your own thing is better than the convention.

EDIT: also to clarify my position, this is something doesn't *really* matter at all, it's just something that i find annoying because it feels like wasteful training wheels

Last edited by gaming_mouse; 10-31-2013 at 03:21 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 04:37 AM
weirdly, I started off with the opening braces on same line and later switched to line of their own and now I can't read same-line so easily.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 05:38 AM
_dave_,

you also like to write "if( something)", so i'm writing you off as anamoly :P
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 06:24 AM
actually I don't, although I didn't code for a few days until after that discussion so didn't bring it up again lol. just observed myself writing if (x) and thought lol oops
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 06:53 AM
Quote:
Originally Posted by derada4
Yeah I have to admit, as I'm learning C# I've been noticing the chronic { on it's own line and find it very tilting.

I start my C# dev job this Friday...What if everyone there does this? Should I just follow suit? Be an outlaw from the get go? Or wait till I am more established?
Ask for the coding standards at the place and follow them.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 07:39 AM
Thanks for the advice!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 10:35 AM
When I said the braces are a C# standard, I didn't imply you you have a choice in the matter.

I take it you haven't downloaded Visual Studio. There are a few editing things it does for you: build boilerplate; drop down auto complete; ctrl e d, which auto formats the code for you. It won't matter how you decide to program, vs will fix your code for you.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 10:56 AM
you can configure it how you want: http://stackoverflow.com/questions/3...e-on-same-line
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 11:04 AM
Quote:
Originally Posted by daveT
When I said the braces are a C# standard, I didn't imply you you have a choice in the matter.

I take it you haven't downloaded Visual Studio. There are a few editing things it does for you: build boilerplate; drop down auto complete; ctrl e d, which auto formats the code for you. It won't matter how you decide to program, vs will fix your code for you.
Yeah at first I was just going back and undoing the auto-format every time I wrote a new function/class...which as you are already thinking, got old very quickly and I just gave up.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 11:45 AM
Quote:
Originally Posted by gaming_mouse
not sure why you'd get personally offended by this, but there are very few experienced programmers i know who put braces on their own line. just because something is a convention doesn't make it good practice.
Almost all non lisp programmers put most closing braces on their own lines. Even opening braces are put on their own lines at least in some cases (function/class declaration) in most common indentation styles (K&R, Allman, BSD, GNU etc).

"Opening braces never get their own line" style only became popular with Java and Javascript and isn't followed by most C/C++/C# projects. I can't think of a single significant C/C++ open-source project that uses that style, while I can think of a lot that don't (Linux, Emacs, GCC, FireFox, WebKit, BSD, anything else from GNU/BSD communities, etc, etc).

Edit: Btw, don't get me wrong, I'm in your camp, just saying that this style is relatively new (in terms of popularity), which means truly "experienced" people would tend to use older styles.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 11:52 AM
I don't know, this sort of thing has long been common in C and C++ that I've seen:

Code:
if(x) {
     something;
} else {
     something else;
}
Now *I* always put braces on their own lines, since I find the clarity gain to be useful, and the vertical space cost to be insignificant when my editors tend to be at least 50 rows high. But tacking opening braces on ends of lines is something I've seen plenty of outside of Java and Javascript.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 12:02 PM
Quote:
Originally Posted by candybar
Almost all non lisp programmers put most closing braces on their own lines. Even opening braces are put on their own lines at least in some cases (function/class declaration) in most common indentation styles (K&R, Allman, BSD, GNU etc).

"Opening braces never get their own line" style only became popular with Java and Javascript and isn't followed by most C/C++/C# projects. I can't think of a single significant C/C++ open-source project that uses that style, while I can think of a lot that don't (Linux, Emacs, GCC, FireFox, WebKit, BSD, anything else from GNU/BSD communities, etc, etc).

Edit: Btw, don't get me wrong, I'm in your camp, just saying that this style is relatively new (in terms of popularity), which means truly "experienced" people would tend to use older styles.
interesting...

to clarify, i was referring only to opening braces. the closing ones need to be on their own line for you to see where the indentation ends.

it appears that git source uses a hybrid style: https://github.com/git/git/blob/master/builtin/add.c

in any case, i stand by my fiery position that we should kill babies before giving opening braces their own line, and would appreciate it if you, as a fellow rational person, helped my campaign of publicly ridiculing anyone who diagrees, rather than calmly offering "evidence" like some kind of "scientist" and trying to foster "objective" discussion. i mean really.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 12:43 PM
This is pretty mind-boggling for anyone who hasn't heard about it yet, a virus that can communicate to another computer by using high frequency sound waves through the microphone and speakers:

http://arstechnica.com/security/2013...jumps-airgaps/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 12:51 PM
Quote:
Originally Posted by Neil S
I don't know, this sort of thing has long been common in C and C++ that I've seen:

Code:
if(x) {
     something;
} else {
     something else;
}
Now *I* always put braces on their own lines, since I find the clarity gain to be useful, and the vertical space cost to be insignificant when my editors tend to be at least 50 rows high. But tacking opening braces on ends of lines is something I've seen plenty of outside of Java and Javascript.
Yeah, this is common, what has relatively been uncommon is doing this for functions. Until the Java/Javascript era, most K&R-ers still thought functions (and later classes) are special enough to warrant having a separate line for the opening brace. I think some of you who grew up in the world of modules and classes and methods and anonymous functions may be too young to understand the significance of functions as a top-level construct in the C mindset. Wouldn't want to see the opening brace if I grepped for the all-important function signature.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 12:53 PM
Fair point.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 02:14 PM
Quote:
Originally Posted by derada4
This is pretty mind-boggling for anyone who hasn't heard about it yet, a virus that can communicate to another computer by using high frequency sound waves through the microphone and speakers:

http://arstechnica.com/security/2013...jumps-airgaps/
My first working hypothesis would be that one of his coworkers is responsible for all of this and it's not nearly as sophisticated as he thinks
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 02:28 PM
Wow, I cant believe we have been talking about which line curly brackets should be on for 3 pages.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
10-31-2013 , 02:44 PM
Quote:
Originally Posted by MrWooster
Wow, I cant believe we have been talking about which line curly brackets should be on for 3 pages.
Obligatory - "If that was 3 pages for you, you're worse than a person that puts a curly bracket on its own line"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m