|
I find it interesting that many seem to think 'var' is such a bad thing. In C++, there's the auto keyword, and there's even the complementary keyword decltype which is particularly useful when you want the result type of an expression, or the return type of a function.
As I understand it, auto fills a similar role as var does in other language(s?), and there's actually a coding guideline promoted by Herb Sutter, no less, to 'aaa', or 'almost always [use] auto'. One of the main reasons is to help enforce type safety, which of course is outstandingly important in C++, probably more than in any other language. Another reason is maintainability: every use of auto probably doesn't need to be changed when you change some type in your code later.
That said, I often deliberately don't use auto, for one (or both) of two reasons: helping with autocompletion (the editor sometimes won't know what member variables and methods to suggest when dereferencing an auto variable), readability (provided the type name is easy enough to read, rather than a nested<type>::with<template_arguments>), and disambiguation (when I want the value to remain unchanged - i. e. const - rather than modifiable). I suspect the former will no longer be a reason when we finally manage to switch to a newer IDE version later this year, that's why I said two reasons
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
I agree with Sutter about almost always using auto and will even do this:
const auto& item = ... ;
Another advantage of auto is that there are fewer affected-bys when you rename a type.
Another advantage is that auto reduces the number of line splits, which I like to avoid.
|
|
|
|
|
A slight variation on "that will never happen."
I guess I don't have to explain myself
The customer always does an export at the end of the day, at least according to the customer.
They can't even not do it because their business depends on it.
Needless to say, that's not how they work at all and I just got a month worth of exports all at once
Of course, my code can't handle this because of reasons (mostly because of a ridiculously complicated pre-XML format that I have to use).
The project is over budget and I can't spend any more hours on it.
Sometimes I think I've chosen the wrong profession
|
|
|
|
|
If they told you a daily export was mandatory, and you can prove it is not the case, then maybe you have some leverage because original agreement was broken?
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
We're going to try and make the supplier of the export fix this.
If they export a separate file per date, even when there's x dates, it's fixed too
|
|
|
|
|
My experience: When a customer says "never", it happens about 5% of the time.
|
|
|
|
|
Terry Pratchett said (in Discworld) that when something is a one-in-a-million chance, it occurs nine times out of ten.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
When a customer says "never" I'm about 95% sure it'll happen.
I was pretty sure the "always" part was a bit exaggerated as well
|
|
|
|
|
Yes, there is a translation step necessary when dealing with customers and those terms. Never means more like in around 10% of cases. Always is more like 75% of cases. Exceptions are definitely the rule.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
|
Sander Rossel wrote: Sometimes I think I've chosen the wrong profession Like I've always said: plumbing is the best job, because there's at least a good reason why you're up to your neck in sh1t.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Allow a penalty perhaps? (8)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Nice one but quick question, What is the significance of ? in a CCC
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
|
Just visited the 'About us' page and realized why Bob is such an excellent member... Bob holds a spanner in one hand and a glass of beer in the other...
We should learn from the best!!!
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
modified 20-Jan-20 2:42am.
|
|
|
|
|
A glass of Bear? That explains why they abduct animals, I guess.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I was probably thinking of the upcoming snow...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
Now that you mention it, I can't really think of too many devs I've known whom I'd trust with a spanner.
Or a stove, for that matter; they can stay on the other side of the kitchen, with the microwave.
And there's no way I'd let any of 'em near my windows registry.
Or powerpoint. God forbid they get within a mile of that.
Or any documentation tool, since we're in that area.
Sewing needles? Get plenty of lemons in, for the bloodstains.
And if you like your home in an un-burned-down state, don't ask them to change a fuse or a lightbulb.
Basically, we're a pretty useless lot, except for messing about with code and spending hours deciding what haircut and eye colour a man-at-arms should have.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
The three most dangerous entities:
A hardware guy with a computer program
A software guy with a soldering iron
A manager with an idea
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
too true!
|
|
|
|
|
I can:
Fix a motorcycle engine.
Cook a gourmet meal.
Sew curtains, curtain liners, tablecloths, napkins, pillow cases, mostly via the sewing machine.
Change fuses and lightbulbs, wire a house, wire a motorcycle loom from scratch, fit a shelf, heck - create furniture including shelves, solder, desolder, read a circuit diagram, fix a PCB (with a circuit diagram).
Oh, and I can bang out code too.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What a wuss.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I prefer "Multi Talented Wuss", if you don't mind.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Mark_Wallace wrote: I can't really think of too many devs I've known whom I'd trust with a spanner
WARNING: WAR STORY INCOMING
When I first started my current job, my test machine was in a hardware lab. I used to pick up a screwdriver with an intent look on my face just to mess with the technician.
Software Zen: delete this;
|
|
|
|
|
Mark_Wallace wrote: Or any documentation tool, since we're in that area.
As a dev I would just like to know what this 'documentation' thing is and why I would need a tool for it?
I, for one, like Roman Numerals.
|
|
|
|