I know I've sure transferred a lot of habits between languages. I found that I tried transferring Python style to C# a lot. What sorts of habits did transfer between langugages like this?
views:
309answers:
9Mixins in C++ use multiple inheritance.. Something that's not available in a lot of modern languages. I used to use this kindof approach a lot.
I wouldn't say it what as a bad habbit though, I just needed to rethink the way I did things :) (If any Mixin reads this, I still love you. You are my one true love <3 )
Assembly Language mind set makes me think every now and then, "yeah, but how many clock cycles is that using"
Well, using hashes like a normal person without thousands of superfluous and stupid key-existence checks, like one does in, say, Perl, is a bad habit in PHP.
Though I don't exactly feel like it's the habit that's bad, there.
After cutting my teeth as a classic VB desktop programmer in the 90's I'm very used to code-behind and the whole event-driven model of programming. So I easily transitioned to ASP.NET webforms with similar events and code-behind, but many people now say that is bad design and doesn't follow the ways of the web (unlike ASP.NET MVC).
The "bad" way just seems so natural to me...probably due to my VB6 days.
In the D programming language: Using template metaprogramming for everything. I've gotten so spoiled by D's templates that I have no idea how anyone gets anything done in any other statically typed language anymore.
returning closures in Lua and Python is very natural and convenient. The same in JavaScript works, but it's a great PITA and requires a bit too much extra typing to be readable.
In FORTRAN 77, it's very common to use I, J and K as loop control variables in a DO loop. I still use i, j and k when writing FOR loops in Ada, C, C++ or whatever language I'm coding in, even though I haven't written a single line of FORTRAN for over 10 years.
People often make comments about it but I refuse to accept that there are better loop control variable names! I also feel the compulsion to rewrite other people's FOR loops to use i, j and k because the code looks too verbose otherwise!
I learned to program (truly) with C++, which meant I was stuck with the clunky STL, as I didn't know how to use external libraries at the time. Needless to say, I wound up rolling my own solutions to a number of standard api-solved problems.
The biggest thing I learned in my transition to Java was to trust pre-existing solutions over my own. The Java API has a wealth of obscure classes that fit extraordinarily well to certain problems, with the added bonus of a defined standard usage.
After using Haskell and Lua, it bugs me that I can't write this in C/C++:
int, int foo() {
return 2, 3;
}
int a, b;
a, b = foo();