Forgot your password?

typodupeerror

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43664513) Attached to: Are Contests the Best Way To Find Programmers?

This would be mitigated by making it an optional feature.

It wouldn't, because if you use a library that inadvisedly uses the "optional" feature, you have no way to turn it off.

but more than once I've found myself cursing this omission.

You know what, so have I. But then I thought about the design for a bit and realized I could do it a much more better way. I like reflection when I'm doing rapid prototyping. Personally I find lambdas more useful than reflection, and luckily it's a major part of C++11 already implemented in most compilers.

But then you're optimising. Not the compiler.

There has to be some kind of manual optimizing. No compiler can fix people using the wrong data types or algorithms. Incidentally, C++11 templates can help the compiler optimize more efficiently. For example, std sort is faster than qsort, because qsort can only take in a function pointer, whereas std sort can embed the sorting function as part of the type once the template has been fully realized. But back to strings. What if an array of chars is the only efficient way to implement something, but the language has hijacked all string literals as built-in strings which are necessarily less efficient than a plain old array?

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43664501) Attached to: Are Contests the Best Way To Find Programmers?
So you're the type of person to make far reaching generalizations from one question and refuses to look for an underlying purpose for those questions. I very wish programming was like that, but it's not. You often have to find patterns that allow you to generalize into a meaningful design/protocol/policy that is not immediately on the surface.

Your employment prospects at this imaginary company are slim :)

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43663457) Attached to: Are Contests the Best Way To Find Programmers?

If it prevents useful features from existing, this is a poor design decision. Plus, you'd only need to include it if it was actually used. It could even be added as an optional feature to classes.

No, it's a good design decision. Why would anyone want their program to pay for something they don't use? Others have argued too many unneeded powerful features already exist in C++, thus contradicting your own definition of a poor design decision. I personally would side more with you than those who argue C++ has too much stuff, but there has to be a limit, and the limit of not bogging down a whole language just to include certain features is a sensible limit, because it is something that can be measured. Much more sensible than ideologically impose limitations like the OO or pure functional paradigm fanaticism.

This is a problem with the library. Not C++.

You simply cannot make a blanket statement like that. A library, especially highly generic concepts like containers, iterators, and algorithms, needs to cater to as many types as they can with minimal configuration. You can't fault a library or a language so absolutely.

The above code can optimise to {return 11;} if strings are built in. If it's a type then it involved allocating at least 3 chunks of memory and 2 memory copies.

If that kind of optimization is needed, people can use a string literal. If the string in your example needs to be modified later on, then that optimization cannot be done in any implementation. As for excessive allocations, this is now solved with rvalue references and move semantics.

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43663237) Attached to: Are Contests the Best Way To Find Programmers?

Can be implemented as static members. Performance cost is a little bit of static data per class type.

Yes, but the point is that it breaks the "you don't pay for what you don't use" design principle of C++.

Not at all. If you don't use it then the string conversion function won't be linked.

You can't guarantee it. For example, if some library happens to use some kind of generic conversion function for its templated type, and you include the enum, then you've automatically dragged in a whole bunch of stuff.

A built in type means that the compiler is allowed to know what a string is and is and can handle strings differently for optimisation.

Any implementation of a string in any language boils down to a char array, whether it's built in, or a library data type.

It also means that we can have third party libraries that don't rely on an assumption that we're using the right std::string implementation.

Those would be bugs in the string implementation, which do not disappear by becoming in-built. If the standard defines strings as a built-in type, you've just shifted the problem from the library to the compiler which doesn't fix anything.

If I want that I'll add a lisp macro as a precompile step. Templates add a lot of complexity for limited benefit.

If you want that, you can just use templates. If you don't use the full power of templates, then you don't need to expose yourself to that complexity. The complexity is pushed to compile time, and the "limited benefit" often means greater performance because virtual functions and class hierarchies aren't needed to achieve polymorphism.

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43660171) Attached to: Are Contests the Best Way To Find Programmers?
Candidates who go meta right off the bat are candidates to avoid. Going meta on a question is such an easy and hackneyed way to appear intelligent without being so. Similar techniques that people use to appear intelligent without being so are: being self-referential; speaking in acronyms; using elaborate words; correcting the use of the word "irony".

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43660123) Attached to: Are Contests the Best Way To Find Programmers?
Hi, I notice that you took the questions as a window to the soul of the interviewer, but I would hope that in your extensive career experience, you would know they don't care :)

#1 - It is hard to learn. But considering you're interviewing for a job, I would hope that when you learn new things (as you would need to in any IT career), that you make progress and not stay stuck at the same learning stage. Several ways of doing the same thing, but each way has their own strengths and weaknesses that could help future development if chosen properly. In modern C++, you don't really need pointer manipulation, so compile time pointer safety misses the point of using safer constructs to begin with. C++11 has lambda functions now. The list of new and cleaner features goes on and on.

#2 - But they're not. They're frequently answered questions.

#3 - Explain the "less ways of doing the same thing" with examples.

#4 - Automatic memory management is one of those things that C++ can do and most fresh grads don't seem to know that since their lecturers keep repeating the horrors of new/delete. A candidate's failure to know these things is indication they don't form their own opinions and do their own research, and that is not what anyone needs as a programmer.

Your turn :)

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43659965) Attached to: Are Contests the Best Way To Find Programmers?
#-1: Wrong.
#0: Your answer to the first question means you didn't think about it and don't understand C++.
#1: True.
#2: Wrong. C++ is not about OO only. C++ can do things the other languages can do without always going OO, which I would think is the point of the question.

Because interviews aren't programming languages and I don't waste my time changing trivial things to display my creds. Your turn :) Oh, and explain, if hired, would you be able to control your impulses of changing things in our product purely because you don't like it (or you feel a need to display your prowess) and probably delay schedules.

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43659841) Attached to: Are Contests the Best Way To Find Programmers?
Reflection: if they make reflection a feature of the language, then users pay for its performance penalties even though they don't use it.
Enum to string: same as above.
Inbuilt strings: While the std string library leaves a lot to be desired, I don't see why an inbuilt string type is needed. Now C++11 has regex as well.
Templates: I find if you think of templates as less powerful LISP macros that only works on types.

Your turn :) Aren't interviews fun?

Comment: Re:The best way to find programmers (Score 1) 260

by The Evil Atheist (#43659789) Attached to: Are Contests the Best Way To Find Programmers?
If that's what you left it as, yeah, you probably would have failed the questions.

But a longer exposition on your answers may not fail the questions.

Most interview questions are just to get you to explain your thinking, and your failure to recognize that in this situation, hypothetical though it is, makes a bad impression.

Comment: The best way to find programmers (Score 4, Funny) 260

by The Evil Atheist (#43653927) Attached to: Are Contests the Best Way To Find Programmers?
Interview question #1: Explain why you hate C++ Interview question #2: Justify why you repeated soundbites about C++ and not formulate your own explanations Interview question #3: Explain why you like Java or C# better Interview question #4: Justify why you didn't know that C++ can also do those things

When Dexter's on the Internet, can Hell be far behind?"

Working...