|
A programmer walks into a job interview and is asked to write the most efficient program to output the first five primes. To the whiteboard!
|
|
|
|
|
its a one-liner:
print("2, 3, 5, 7, 13");
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
KarstenK wrote: its a one-liner:
Ingenious! Because I thought the same thing.
We are geniuses.
|
|
|
|
|
Already posted (see eighth post below this one).
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|
One of the most common questions we receive is if Microsoft is going to charge for updates to Windows 10. 100% guaranteed. Maybe. Ask again later.
|
|
|
|
|
The astronauts on NASA’s Apollo 10 mission in May 1969 paved the way for a pivotal moment in human history, but in the process, introduced an entirely new kind of space exploration mystery. "To boldly go..."
Ah, the romance of space travel
modified 26-May-15 22:20pm.
|
|
|
|
|
The Internal Revenue Service is warning that intruders stole tax data for 100,000 people between February and May by taking advantage of a flaw in the agency's transcript website. Have a nice day (US-only)
|
|
|
|
|
Yagni originally is an acronym that stands for "You Aren't Gonna Need It". It is a mantra from ExtremeProgramming that's often used generally in agile software teams. FWIW
|
|
|
|
|
But then when you realize that you actually do need it it'll require a week of refactoring to add it later.
A stitch in time saves nine.
|
|
|
|
|
That's "YAPGNI" (You Are Probably Gonna Need It). Of course, some Architect Astronaut would just sprinkle another layer of pattern pixie dust to try making it better. "Just apply a Visitor to the collection of Abstract Factories"
TTFN - Kent
|
|
|
|
|
Ah, There's A Chance You Will Need Several Similar Things As Well .
|
|
|
|
|
If you'd paid more attention...
"Yagni only applies to capabilities built into the software to support a presumptive feature, it does not apply to effort to make the software easier to modify."
I think Martin Fowler, of all people, is aware of the cost of Refactoring.[^]
Of course I've seen plenty of developers only capable of refuctoring.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Following on the success of Java, Microsoft likewise chose to distance itself from its strong roots in C and C++. "They've still got one foot in the Dark Ages — if I tell them the truth they'll panic and think it was witchcraft."
|
|
|
|
|
So.. is it a good thing or a bad thing?
And... I might be wrong, but I don't think C# is that slow.. only startup time seems to be an... "issue"
EDIT I have no care about possible "C# issues", I just wonder what he is talking about... to me it just sound like "we (C++ developers) are not loved enough" moaning without much insight into whether or not there is even a problem!...
EDIT2After re-reading carefully... I got it!
Hiding in the rant is, in fact, a shameless plug of self advertising!
Why can't MS people promote Kenny Kerr work?![^]
modified 27-May-15 7:47am.
|
|
|
|
|
My mantra is: performance comes from the architecture and design. A fool is getting a C++ program slow.
C# is somehow like Java: once started it is internally well optimized (as C++) and only the GUI is someway slow.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Super Lloyd wrote: And... I might be wrong, but I don't think C# is that slow.. only startup time seems to be an... "issue"
Have the issues with garbage-collection occurring at arbitrary and inopportune times been solved?
When a C# game performs as well as the same game written in C/C++, running on the same hardware, I'll be convinced. Before then it seems just like it always has - one trades of development cycle time for program performance. In some instances, this is an advantageous trade-off (CRUD apps, etc) in others, this trade-off is fatal - (RTOS, games, ISRs in DSPs).
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
|
In fact I don't care much about alleged C# issues, I am just trying to understand what he is complaining about!
Sounds like "they don't like us, C++ developer, enough" to me... a vague rant without substance...
|
|
|
|
|
Super Lloyd wrote: Sounds like 8< - SNIP - >8 a vague rant without substance...
Hear, hear.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|
|
|
Heh heh.
Nice work. I did notice the continued use of the term Modern C++, but like you, missed that this was a self-plug, which I'd be happy with if the fact weren't hidden in the detail. I wasn't so blind as to miss that in the page's header.
At least the article's comments provided much mirth.
Have a 5.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
modified 27-May-15 8:10am.
|
|
|
|
|
Thanks hey!
|
|
|
|
|
I don't think it's that. The way I understand it is the library that he wrote is merely a shim that introduces features to the Windows Runtime that have existed in "standard" C++ for the past 4 years. Here it is 2015, and Microsoft's compilers & runtime both still don't implement 100% of C++11, and if memory serves, they're still only in the low-teen percentage of completeness on C++14. gcc just finished delivering 100% C++14, and had 100% C++11 coverage years ago. So it's no wonder that the Windows Runtime doesn't support the features he's shimmed. I don't think it's about "Use my stuff" it's more about "Why doesn't the Windows Runtime use the best features of the language?".
That's his complaint, and in my opinion, a valid one.
|
|
|
|
|
you are wrong on the first half of your message!
his code is meant to be used and is compiling and working on MS compiler right now!!!
it's NOT about MS C++ compiler not supporting C++14, it's about the way they package their library for C++ developer, they can do much better, he demonstrates!
|
|
|
|
|
In an ideal world, the ability to bridge the gap between user frustration and developer attempts to fix problems would be part of the build. The alternative is bug reports like: "It's broken" (like I got last week)
|
|
|
|