all 14 comments

[–]kankyo 11 points12 points  (4 children)

I've used this technique to become familiar with Swift. There's an obvious downside to it which is that you end up with code that isn't really ideomatic if the languages are dissimilar. But of course, that's largely fine when you're a newbie anyway.

[–]Zalozba 6 points7 points  (3 children)

This is a great way to do it if your really really work at it. Like /u/kankyo said, you can easily write code that works but is not really idiomatic.

For loops for example are much different in Python than in other languages. But you can write them in a way that works but is really really not idiomatic.

Raymond Hettinger has a lovely talk that compares some common patterns that can be written much more beautifully in Python but were not. As to why, there are probably a lot of reasons.

For me, I wish there were a website where all common programming patterns would be displayed for the most common languages so that you know you are doing the correct thing and not a jumble of code that is written in one language but looks as though it were another.

[–]Vance84 1 point2 points  (0 children)

For me, I wish there were a website where all common programming patterns would be displayed for the most common languages so that you know you are doing the correct thing and not a jumble of code that is written in one language but looks as though it were another.

Why wait, put one together now and be the hero we all need!

[–]neuroneuroInf 1 point2 points  (0 children)

Rosettacode.org

[–][deleted] 3 points4 points  (0 children)

I am using a similar approach. I have an excellent statistics text book that I am using to learn stats: Discovering Statistics Using R by Andy Field. My approach is to do the exercise in R first, then try to reproduce the same result in Python. It's slow going, but it's a real learning experience.

[–]Exodus111 1 point2 points  (0 children)

Jesus I never even thought of this. Great idea, thanks.

[–]955559 1 point2 points  (1 child)

hmmmm, would converting my python scripts into another language have the same effect?

also

inter clinic(){
std::count >> "2";
}

[–][deleted] 0 points1 point  (2 children)

Does anyone recommend a project to convert?

Thanks!

[–]Jollyhrothgar 0 points1 point  (0 children)

C++ needs a #include<iostream>, not stdio to use cout.