Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
What is the reason for this syntax?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="David Vallner, post: 4530808"] --------------enig7D67C73E474C8DC75375704F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It's not about personal preference, it's about accepted conventions. Sun's *official* style guidelines say camelCase, and { on same line. Microsoft's *official* style guidelines say PascalCase and { on new line. I follow the former convention when coding Java, the latter when coding C#. I snake_case method names for Ruby and Python, never in Java, I don't write code with camelCase in Ruby either. I do that precisely because my personal preference doesn't matter. However, I realise there are people with more inertia using an environment on the team, who are probably less flexible about that. That's why I will follow the convention most likely to be agreed upon - to make my code -less alienating to them-, and not to me. I mean, I wrote the thing in the first place, and know where to click in an IDE to move around my code by heart by then, I don't need these basic visual aids to navigate. I never said anything about language-enforced formatting. Ruby does so only where required by the semicolon-less syntax, and you just happened to hit a sore spot of yours that just isn't parseable the way you would like, period. It's not an arbitrary restriction someone made up because it looks prettier. However, personal preference is, in my opinion, not a reason to not follow convention even if the convention isn't enforced. Explaining themselves comes when it's time for code review. Often, that time isn't. Also, most of real-life codereading occurs when the original author has long ran for the hills. Obviously, it isn't if you're willing to write reams of debate about how you object to having to conform to a hard parser restriction. Also, I take it you haven't tried to use CVS / SVN in a team with people that run commits through a code beautifier first (generally a Good Idea for the sake of consistency and general readability - noone likes terminal-widening doc comments). If two people happen to have to edit the same source file, and each one wildly repositions the braces, any and all method signatures (for C-likes) stop matching and all hell breaks loose as suddenly the file is in conflict in umpty places that none of those people remember editing. Much groaning and valuable time lost doing a manual merge follows. I'm not particularly interested in random references to your external brain. Especially if you don't bother to read it. "?: is a ternary operator that is part of the syntax for a basic conditional expression" C's if is syntax for a conditional statement, not expression. Yes. Don't confuse arrogance with being confident in one's skill / experience. I don't have much of either in absolute values, but I've already got a fair pile of irksome screwups of which some were relevant to the topic at hand collected which I've seen, and of course done. If I was being actually arrogant, I'd say I consider your tone moany, your nitpicking at trivial issues childish, and your rants ill-informed. Whoops, looks like I just did. Well, I'm glad the formal pleasantries have been exchanged. Why, yes, I am. And? David Vallner Troll --------------enig7D67C73E474C8DC75375704F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFJxeMy6MhrS8astoRAp2HAJ4hk/fLLgpiS/kxJPG1qrzNjijcFQCcDCYC lGcSAoZ623/T03ahjxFJkC4= =I+9X -----END PGP SIGNATURE----- --------------enig7D67C73E474C8DC75375704F-- [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
What is the reason for this syntax?
Top