Thanks for the article! It is a nice syntax comparison of both languages. I find the dictionary section a little misleading though. Your code samples compare the syntax of a C++ std::map to a swi...
It looks like - at least syntax wise, they are both very similar. Any comment as to, if i want to learn both (fully), which one to start with. I have a little experience of both. Thing i dont lik...
A simpler way to use auto with std::string is to use a suffix operator: auto str = “no explicit constructor needed”s;
Thanks for the solid article. I think the little criticism received comes from people misunderstanding the author’s intention This was not some comparison of design philosophies or language inf...
Thanks for the solid article. I think the little criticism received comes from people misunderstanding the author's intention This was not some comparison of design philosophies or language influ...
i dont think this author knew exactly c++, why he try to make c++ so dark with his wrong syntax???
Although I appreciate this little cheery comparison, it completely disagree with the conclusion. First, even if the basic constructs of those modern languages tend to be similar (due to the long ...
In reply to Jugănaru Călin. Good catch looks like a ...
Are you sure this code works auto nums = std::vector {1,2,3,5,7,11}; ?
Dont you need to specify vector
s elements type?
In reply to kirsch. Thanks Kirsh. That's a good point ...
I think this article focuses on syntactic details but not on he high level design philosophy of each language. Swift tries really hard through its design to help programmers avoid the most common...
What're complete differences between Swift and C++? Biggest difference is, in swift there is no ; and in c++ there is. In addition, there are a lots of difference. Swift is much ...
swift unless sub-classed using an NSObject type behaves with static binding.I am told it does have a vtable of sorts.If suclassed with NSObject, the runtime opts for dynamic dispatch
In reply to Utkarsh. Thanks for the comment. I'm not s...
The main difference lies in OOPs with smalltalk (dynamic dispatch/late binding) adopted by swift/O-C vs. simula(static/virtual binding only) style adopted by C++. Then there is ARC for memory man...
I just realized by looking at my own comment that it must be WordPress that swallows the angle brackets - so I guess your code is right in principle. Maybe the angle brackets need to be escaped s...
Nice article, but you should correct the lines showing std::vectors like so std::vector v {1,2,3}; where the mandatory template parameter is missing (and which cannot be inferred)! A vector of in...
for another great guest blog post from Bradley Needham to follow up on his very popular Swift vs. C++ post.
In reply to kirbyfan64. Thanks! Bradley has more comin...
I like this article. At long last, someone doesn't treat modern C++ like some weird, 80's-era language. C++14 now has a string literal suffix, so the code in the strings section can be shortened ...
Comparison of Modern C++ and Apple’s Swift Programming Language Syntax
Comparison of Modern C++ and Apple’s Swift Programming Language Syntax (Michael Kennedy)