Author Topic: Programming habits, standards, and learning.  (Read 41421 times)

Shaggy

  • Rogueliker
  • ***
  • Posts: 65
  • Karma: +0/-0
  • (╯°□°)╯︵ ┻━┻ <( !@#$ THIS, I'M OUT. )
    • View Profile
    • Not Quite ADoM
    • Email
Programming habits, standards, and learning.
« on: October 18, 2012, 09:57:52 AM »
I started programming when I was very young - 12 or 13 iirc - thanks to my dad. He showed me the fundamentals of Visual Basic 6, and gave me a few books to read. Fast forward and I took a single programming class in highschool. Other than that, I have no formal programming training.

Ive tried learning many other languages (C#, C++, Ruby, Python), but I always end up coming back to Visual Basic. Although Ive switched to .Net, I still feel like this is a 'beginners' language. I feel like it has somehow hindered my ability to branch out and to learn new languages or even styles of coding.

What can you advise for me to (in a way) re-learn to program, and how to program more efficiently and to a higher standard?
Check out my blog at http://NotQuiteADoM.blogspot.com/ !

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Programming habits, standards, and learning.
« Reply #1 on: October 18, 2012, 10:13:44 AM »
Ive tried learning many other languages (C#, C++, Ruby, Python), but I always end up coming back to Visual Basic.

The essentials of programming are not tied in any particular language, they are generic concepts. Languages are a way to express those concepts in different ways. The way people try to learn a language is often wrong, because they pay too much attention to syntax and trying to learn everything in that language. I think the proper way is just try to write programs and then see what is needed. Even C++ is thought as "low" level language, I almost never use templates (except STL ones). You don't need everything, just the stuff that makes program work.

kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: Programming habits, standards, and learning.
« Reply #2 on: October 18, 2012, 10:22:26 AM »
In terms of programming more efficiently and "to a higher standard," I think you shouldn't really worry about such things.  Just keep programming and such things will follow naturally.  As Krice said, just choose another language and start using it.  Don't worry about using the "correct" paradigms and whatnot.  Most people will tell you to just stick with whatever language you know best, but on the contrary I would say every language you learn to use makes you a better programmer in general.

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Programming habits, standards, and learning.
« Reply #3 on: October 18, 2012, 10:50:04 AM »
I would say every language you learn to use makes you a better programmer in general.

Especially if you try programming languages which are based on something completely different (say, functional ones).

Darren Grey

  • Rogueliker
  • ***
  • Posts: 2027
  • Karma: +0/-0
  • It is pitch black. You are likely to eat someone.
    • View Profile
    • Games of Grey
Re: Programming habits, standards, and learning.
« Reply #4 on: October 18, 2012, 11:55:15 AM »
Try out FreeBasic - the syntax will be familiar, and ultimately it's as good as C++ for making roguelikes.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Programming habits, standards, and learning.
« Reply #5 on: October 18, 2012, 05:11:23 PM »
VB.Net is good language. Worst part of it is the name, which people associate with old VB and think that the .Net one is inferior language compared to C# for example.

Learning a new language is often fun, but it can be a bit pointless. Differences between Jave, VB.Net, C# and C/C++ are not that big after all. If you would try completely different thing, like functional language as kraflab said, you would probably pick up some new skills.

It might be a good idea to dig around internet a bit and see what kind of programming concepts there are, pick one that sounds interesting and read a bit more about it. If it sounds good, try it in your game and see how it feels like. Rinse and repeat as often as you feel like.

Even better is if you have a specific problem with your code and you want to find a solution to it. Want to make your programs more loosely coupled? See if you can use dependency injection to solve it (Unity is a free library for that for example). Want to write code that is easier to maintain? See if your local library has a book about design patterns or designing software in general. Want to try writing automated tests? Play around with NUnit and NSubstitute and see what you can do with them.

You can do things in hard way (all by yourself, learning from your mistakes and trying to come up with better ways of doing things), or you can stand on shoulders of giants and learn what others have done and build on that. Both can be fun, but latter one is much, much faster.

Everyone you will ever meet knows something you don't.
 - Bill Nye

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Programming habits, standards, and learning.
« Reply #6 on: October 19, 2012, 05:46:25 AM »
Learning a new language is often fun, but it can be a bit pointless. Differences between Jave, VB.Net, C# and C/C++ are not that big after all.

Not really. Differences between Java and C# are indeed not that big and VB.Net is basically the same language as C#. But C++ is a completely different planet. It takes 8-10 years to learn C++ quite well, even if you had some Java, VB or even C# background, while a C++ programmer can teach himself Java in a month and become more proficient in it than an average Java programmer. Yes, both Java and .NET were highly influenced by C++ and they have similar syntax, but in practice they are totally different. It's like Formula 1 cars were inspired by normal cars, but it's not enough to have a driving licence to compete in Formula 1 ;).
Fame (Untitled) - my game. Everything is a roguelike.

Shaggy

  • Rogueliker
  • ***
  • Posts: 65
  • Karma: +0/-0
  • (╯°□°)╯︵ ┻━┻ <( !@#$ THIS, I'M OUT. )
    • View Profile
    • Not Quite ADoM
    • Email
Re: Programming habits, standards, and learning.
« Reply #7 on: October 19, 2012, 08:50:07 AM »
Wow! Thanks a ton for all of the replies!

Right now I think I'm going to stick with VB.Net, but I'm going to use the XNA Game Studio framework as my base. Later on I think I'll start looking into learning C++.
Check out my blog at http://NotQuiteADoM.blogspot.com/ !

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Programming habits, standards, and learning.
« Reply #8 on: October 19, 2012, 09:24:02 AM »
It takes 8-10 years to learn C++ quite well, even if you had some Java, VB or even C# background, while a C++ programmer can teach himself Java in a month and become more proficient in it than an average Java programmer.

I think this is nonsense. It takes time to become a good programmer and has little to do with any particular language. It's more how you can apply programming concepts in a real working program, not just in theory. However C++ is a difficult language, because it lets you do things wrong in so many ways. The special feature of C++ is a lack of memory management and it's the top reason why people spend a lot of time trying to fix bugs which in turn increases development time and makes things harder. It's possible to prevent memory management issues, but it requires experience and understanding what can go wrong.

kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: Programming habits, standards, and learning.
« Reply #9 on: October 19, 2012, 11:21:03 AM »
It takes 8-10 years to learn C++ quite well, even if you had some Java, VB or even C# background, while a C++ programmer can teach himself Java in a month and become more proficient in it than an average Java programmer.

I think this is nonsense. It takes time to become a good programmer and has little to do with any particular language. It's more how you can apply programming concepts in a real working program, not just in theory. However C++ is a difficult language, because it lets you do things wrong in so many ways. The special feature of C++ is a lack of memory management and it's the top reason why people spend a lot of time trying to fix bugs which in turn increases development time and makes things harder. It's possible to prevent memory management issues, but it requires experience and understanding what can go wrong.

Agreed, I found c++ very easy to pick up, even coming from a language with a gc and where everything was a pointer.  The reason is I've been programming for a while and the concepts, while presented differently, are the same.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: Programming habits, standards, and learning.
« Reply #10 on: October 19, 2012, 11:49:45 AM »
I think this is nonsense. It takes time to become a good programmer and has little to do with any particular language. It's more how you can apply programming concepts in a real working program, not just in theory. However C++ is a difficult language, because it lets you do things wrong in so many ways. The special feature of C++ is a lack of memory management and it's the top reason why people spend a lot of time trying to fix bugs which in turn increases development time and makes things harder. It's possible to prevent memory management issues, but it requires experience and understanding what can go wrong.

I think that you actually wanted to say that C++ does not have *automatic* memory management, but nevertheless the first part of your post negates the other part. If a language has features that make it more difficult than other languages, then it must take more time to "become a good programmer". I remember my own experiences with different languages. After a month of learning C++ I still didn't know what those damned pointers were about. After a month of learning VB I had written my first game. And... oh, wait. I forgot that you always put "I think this is nonsense" at the beginning of your post ;).
Fame (Untitled) - my game. Everything is a roguelike.

kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: Programming habits, standards, and learning.
« Reply #11 on: October 19, 2012, 04:15:36 PM »
I think this is nonsense. It takes time to become a good programmer and has little to do with any particular language. It's more how you can apply programming concepts in a real working program, not just in theory. However C++ is a difficult language, because it lets you do things wrong in so many ways. The special feature of C++ is a lack of memory management and it's the top reason why people spend a lot of time trying to fix bugs which in turn increases development time and makes things harder. It's possible to prevent memory management issues, but it requires experience and understanding what can go wrong.

I think that you actually wanted to say that C++ does not have *automatic* memory management, but nevertheless the first part of your post negates the other part. If a language has features that make it more difficult than other languages, then it must take more time to "become a good programmer". I remember my own experiences with different languages. After a month of learning C++ I still didn't know what those damned pointers were about. After a month of learning VB I had written my first game. And... oh, wait. I forgot that you always put "I think this is nonsense" at the beginning of your post ;).

I think perhaps what he meant is that:

If you're a good programmer and understand how things really work, c++ won't be any more difficult than anything else.

If you're a bad programmer, c++ will seem especially difficult because it amplifies your mistakes while other languages may just eat them up.

Darren Grey

  • Rogueliker
  • ***
  • Posts: 2027
  • Karma: +0/-0
  • It is pitch black. You are likely to eat someone.
    • View Profile
    • Games of Grey
Re: Programming habits, standards, and learning.
« Reply #12 on: October 19, 2012, 04:31:31 PM »
An excellent summation.

XLambda

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • MSN Messenger - tau_iota@live.de
    • View Profile
    • The Weird Rogue
Re: Programming habits, standards, and learning.
« Reply #13 on: October 19, 2012, 05:31:14 PM »
It takes 8-10 years to learn C++ quite well, even if you had some Java, VB or even C# background, while a C++ programmer can teach himself Java in a month and become more proficient in it than an average Java programmer.

I think this is a bit of an elitist statement. Yes, C++ experience can be very useful, but claiming that a C++ programmer would be better at Java than a trained Java dev just because he knows C++ seems a fair bit... exaggerated. Though the language is rather easy to pick up as a C++ dev.

I don't like how people look down on Java as a language. I know that Notch was criticized quite a lot for writing Minecraft in Java as opposed to *cough* a REAL programming language *cough*. In the end, nobody cares for the fanboys' flamewar as long as the result works as intended.

Just to make sure I don't come off as a flaming fanboy, I know both languages and have done large projects in them. Now excuse me, I am riding my garbage collector into the sunset.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Programming habits, standards, and learning.
« Reply #14 on: October 19, 2012, 05:46:37 PM »
If you really want to learn to think about programming intuitively, pick up Haskell or Lisp. Once you have an understanding of how these work, you can more effectively utilize highly productive languages like Java, HaXe, Python, Ruby or C#.

C++, however, is a mess. It forces you to do things that you HAVE to do anyway, allowing you to do them poorly if you don't understand the complexities of the SYNTAX. Only when you do them perfectly does performance begin to exceed Java or C#. C++ leverages mundane syntactical requirements on the user with built-in pot-holes, which ultimately makes you less productive. Your programs may technically run faster in C++ (unless it's a program that runs for more than a few minutes- then Java will be faster due to run-time optimizations and caching), but the difference is genuinely arbitrary. If you really want the explicit advantages of C++, check out HaXe- it compiles to C++ with very competitive performance. C++ also offers poor auto-completion and error-checking support. Potentially resulting in a lot of wasted time.

Programming shouldn't be about syntax. It should be about productivity. Once you intuitively understand how coding works, you don't want to waste time on syntactical hoop-jumping. You want to be productive.



Otherwise, If you want practice, check out the UVA library of programming problems.

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8
http://uvatoolkit.com/

You won't learn a whole bunch about how to structure large programs, but you'll get a lot of practice that will help you understand what your code does as you're typing it- as in, you learn to debug intuitively. I think if you actually want to submit solutions they need to be in Java, which is a pretty useful language to learn.
« Last Edit: October 19, 2012, 09:33:53 PM by requerent »