|
I am. Why the hell not? It's more aesthetically pleasing and in most cases it does not reduce readability (for me, for you - don't care).
I haven't use it much in C# before C++11 assigned new meaning to auto . Then I started replacing crap like this std::unordered_map<std::string, boring_class>::const_iterator with auto and then moved the habit to C#.
|
|
|
|
|
|
How often do you have to declare stuff like in C++ std::unordered_map<std::string, boring_class="">::const_iterator?
It's hardly the rule. If you're declaring
Tuple<Dictionary<int, string>, KeyValuePair<int,string>>
or something like that, maybe it makes sense.
But more often than not, it doesnt.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
Well ok, if it's some sh*tty long name it makes sense.
If it's int or similar, it does not.
|
|
|
|
|
Hardly the rule and only applicable for complex names.
Now, people use it on method returns and everywhere. I happen to be in a position that I have to read a lot of other people's code and it's a pain to read them when var is used everywhere. On generic types it's even more disrupting.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson
Our heads are round so our thoughts can change direction - Francis Picabia
|
|
|
|
|
PIEBALDconsult wrote: Same thing I see with Linq/Lambdas ; it's still just the Cult of Fewer Keystrokes .
I really like linq/lambdas. They unify the way many various things are accessed, and in my opinion make the code more readable.
Just my opinion. Your mileage may vary.
Once you lose your pride the rest is easy.
In the end, only three things matter: how much you loved, how gently you lived, and how gracefully you let go of things not meant for you. – Buddha
Simply Elegant Designs JimmyRopes Designs
|
|
|
|
|
JimmyRopes wrote: They unify the way many various things are accessed
To the lowest common, and therefore the least efficient, method possible.
And it's unreadable.
|
|
|
|
|
PIEBALDconsult wrote: And it's unreadable.
When done correctly, it is very readable and strongly encouraged in all of our software teams. However, I have seen it done poorly, which validates your comment, IMO.
|
|
|
|
|
PIEBALDconsult wrote: To the lowest common, and therefore the least efficient, method possible.
Is this just speculation or can you cite data to back up your psition?
PIEBALDconsult wrote: And it's unreadable.
I, personally, find this a lot more readable than the alternative.
XDocument xml = XDocument.Load(Environment.GetEnvironmentVariable("SystemDrive") + @"\manifest.xml");
var oledbconn = from el in xml.Root.Elements("webservice")
where el.Attribute("name").Value == ServiceName
select el.Element("OleDbConnection").Value;
OleDbConnectionString = oledbconn.FirstOrDefault();
You, of course, are entitled to your opinion.
Once you lose your pride the rest is easy.
In the end, only three things matter: how much you loved, how gently you lived, and how gracefully you let go of things not meant for you. – Buddha
Simply Elegant Designs JimmyRopes Designs
|
|
|
|
|
linq in the xml context is faster, less lumpen, and more direct. An awful lot of advantages over xsd-generated classes.
But I am forced by the seniors to use xsd because it requires less coding as it is automatic.
Tomorrow I'm running a marathon wearing lead boots.
|
|
|
|
|
I find this[^] to be somewhat therapeutic!
New version: WinHeist Version 2.1.1 new web site.
When you are dead you don't know it, it's only difficult for others.
It's the same when you're stupid.
|
|
|
|
|
Marc Clifton wrote: If you don't like typing, why are you a programmer?
Dunno, money? But seriously, it's the most boring part.
|
|
|
|
|
Marc Clifton wrote: If you don't like typing, why are you a programmer? Voice control is always an option.
I know devs who'd happily use it very loudly when inputting code that they (erroneously) believe to be genius, and only use the keyboard to input their dirty hacks.
I'd say that there's a possible connection between those guys and your guys.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Thank you, I needed a good chuckle this morning. I do enjoy your rants, they align with my thinking rather nicely.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Marc Clifton wrote: oh, I'm using this because it reduces the amount of code I have to type
Have you used LINQ? Do you know it reduces the amount of.....Oops.
|
|
|
|
|
I always try and reduce the amount of code I type. I live by Intellisense and code snippets, or ReSharper's Live Templates, but, I am not scared of typing out long and meaningful member names to start with. That is, I loath contractions and acronyms in code.
No object is so beautiful that, under certain conditions, it will not look ugly. - Oscar Wilde
|
|
|
|
|
Let's make the list a little longer:
- Use 'this' wherever you can. It makes things much more readable when every second word is 'this'.
- Use magic numbers, but not as a numeric type. Write only stringly typed code and use all kinds of error prone conversions where you can.
foreach(var MiscVal in LMAA)
{
var xdbrnf = this.DoReMiFaSo(MiscVal, 1);
if((xdbrnf == "0" || xdbrnf == "-1" || xdbrnf == "4") && int.parse(xdbrnf) < 42)
{
this.SlfDestrct();
}
}
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
You sound like me, sometimes; you must be getting old, too.
I once set out to master C++, and I spent many years trying to do so. But MS decided that everything had to run on an event-driven model, and get filtered through MFC, and have most of the code written by a robot and hidden from the programmer who was trying to learn the language. After 10 years, I gave up trying; coincidentally, MS gave up MFC about the same time. I come from a background in which, if there's no OS to work with, write one. If there's no off-the-shelf compiler, write one. If there's no language appropriate to the task, create one, and the tools to compile and link the modules.
We're dinosaurs, Marc. The kids want all the hard parts done for them, while they spend their time making pretty, politically correct GUIs to make the Great Unwashed feel like they know how to operate a computer. We all know better, but if we tell them what we really think about their silly ideas and idiotic notions about what computers can and should do for us, we'll probably get fired. Roll with it, and keep praying for that big Lottery win; that's my retirement plan, and I'm sticking to it!
Will Rogers never met me.
|
|
|
|
|
Roger Wright wrote: We're dinosaurs, Marc.
No. We have forgotten more about this stuff than some of them have ever known and by the time they catch up with us, they will be having the same discussions with the next generation of clowns who insist on commiting every old mistake in new ways.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
well, my boss pays me by the hour and he wishes to see results asap, that why..
oh! and i'm lazy
Life's like a nose, you've got to get out of it whats in it!
|
|
|
|
|
Marc Clifton wrote: If you don't like typing, why are you a programmer?
I'm a programmer because I like puzzles. Software development is usually the process of:
- identifying the 'puzzle'
- developing a solution
- implement the solution with whatever tools you are given/have available
Whilst 3 is still fun I don't want to write reams of code I don't need to so reducing the amount of code I type is fine by me.
(Sorry for the boring answer to a hilarious rant )
|
|
|
|
|
So you like assembly?
Everything else is just reducing the amount of code you need to type.
|
|
|
|
|
Really?
Writing (perhaps) a lable, an opcode and typically 0 - 2 operands actually looks quite spartan to me. Also, you have the single most important abstraction at your disposal: Structuring your code in subroutines or functions.
The biggest bonus: There is little room for religious wars over styles or language features.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
It would obviously depend on what you're doing, but let's just say that I wouldn't enjoy writing a website from scratch in assembly.
|
|
|
|
|
Who enjoys writing websites in the first place?
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|