2008-03-09, 13:35 | Link #1 |
Sleepy Lurker
Graphic Designer
Join Date: Jul 2006
Location: Nun'yabiznehz
Age: 38
|
Which programming language should I choose?
Got a small question here (I know this is a software/hardware subforum but it felt like the best place to ask this, and I do have a follow-up request for freeware).
I started studying programming a couple months ago to kill some free time and so far I've only touched Pascal (buddy of mine advised me not to try OOP at first, as he saw many people quickly getting confused by OOP's subordinated concepts such as classes, heritage, encapsulation, etc) and am about to have a look at its OOP counterpart, Delphi. I'm still in the procedural language stage but I wouldn't say no to learning some OOP in advance. However, I've been wondering, among the new object-oriented programming languages, which one would be the most interesting or useful, from a statistical, technical or practical standpoint: 1. Java 2. C 3. C++ 4. C# 5. Visual Basic .NET So, which one? I know Java lacks pointers and the like and that C++, while being an overextension of C (C++ being essentially 'C with classes'), suffers from backwards incompatibility with its parent language...and C# is rather new, since it's a Microsoft creation. I know some of you might say 'it depends on what you want to do with it', but I'd still like an idea of what seems to be, right now, the next best thing since sliced bread in terms of usefulness and the whole nine yards behind. Also, any free compiler to suggest here? I already know about the Eclipse and Bloodshed compilers but some of them have slight shortcomings (the last Bloodshed Dev-C++ compiler dates back to 2005 and it's still a beta with an annoying bug during the installation process - can't relocate the destination folder to within the C:\Program Files directory no matter how many times I try...and the Eclipse Europa Fall-2 doesn't even come with the <iostream> library) and I'd like some feedback. Thanks in advance.
__________________
Last edited by Renegade334; 2008-03-09 at 15:09. |
2008-03-09, 14:04 | Link #2 |
AS Oji-kun
Join Date: Nov 2006
Age: 74
|
First, if you're really committed to this, I'd leave the Windows world behind for a while and build yourself a Linux box. The distribution doesn't matter, since all them will include what you need: a full-range of languages and compilers and excellent development tools like Eclipse. All of these are, of course, "free" as in both "speech" and "beer," and most are licensed under the GPL.
I'm not competent to answer the language question, but perhaps rather than starting with a low-level language like C, you might also consider a language like Python?
__________________
|
2008-03-09, 14:26 | Link #3 |
Good-Natured Asshole.
Join Date: May 2007
Age: 34
|
For tl;dr people: Java teaches you high-level stuff like OOP perfectly fine. However, since Java is very forgiving, it also tends to breed bad programmers. C is very literal and teaches you how to do it safe.
=== Long answer: If you're absolutely clueless about basic programming semantics (If you don't know what a For-loop is, read this), I'd spend a little bit of time with Python before moving into C or Java. Python is very easy to learn, and I'd put it in between C and Java as both somewhat forgiving and minimalist. You can quickly learn the easy stuff like If-Then-Else statements and For-loops. Python also comes with an interpreter that works sort of like a graphing calculator, and you can feed it commands to see what it would spit out immediately. Java is built entirely around OOP, so it's a good learning tool for that purpose. It's also comparatively very forgiving with errors, so it's the way to learn high-level stuff. You also get to learn how to read documentation, because nobody really knows Java - it just depends on how many classes and structures you know how to use, and you have to read up documentation for new ones to figure out how to use them. Please be aware that since Java is very forgiving, many people develop bad programming styles and etiquette without knowing it (and that's why if you're into Computer Science, you'll soon believe that Java sucks). For that, I recommend C. If you try C, don't go too far with it, especially when it comes to OOP and manipulating memory. C is a minimalist language and doesn't support OOP that well. The way you have "classes" is you make "structs", write a little library of functions for it, and pretend it's a class. C, however, teaches you how to program right. C is highly literal and will smite you without reprimand for doing memory wrong. For example, if you run over an array (a list of variables), Java will stop and tell you what's wrong and where. All C would tell you is "segmentation fault", and you'll have to go hunting. However, it also teaches you some very good debugging and safe programming techniques that more forgiving languages like Java won't. Both C and Python are command-line-based, so be prepared to have the Windows Command Prompt open a lot. For C, I recommend using the gcc compiler. It's simple and straightforward. Python's official interpreter/compiler package is sufficient. Last edited by Claies; 2008-03-09 at 14:40. |
2008-03-09, 15:02 | Link #4 |
Senior Member
Join Date: Dec 2007
Location: England
Age: 37
|
Since you're already familiar with proecdural programming, I don't think you'll be uncomforable learning C++. You can use purely precedural code mixed in with OOP, which might benefit with your learning. Object Pascal is decent in this sense too, but 'Delphi' is more than just a language, it's a product, which includes the IDE, compiler, libraries, components etc for Object Pascal. I don't think it's a good idea to get accustomed to using product-specific libraries and such like you may end up doing with Delphi.
That's where C and C++ shine. There's a huge choice of libraries to use for whatever you want to do, most of the better ones are GPL'd, and ported on Windows. I wouldn't say it's necessary to start using linux like Seiji suggested, because all those resources are avaliable on Windows. What's important is using developing tools and libraries that are portable, so you're not hindered if you do want to change platform. C++ is much more than 'C with classes' though. It's certainly not easy to get to grips with everything, it's a big language that will take you years to completely familiarise yourself with. When you do so though, moving ahead to other languages is much less work, than say, someone moving from Java/C#. They would need to learn much more about how their hardware works, how memory is allocated and such that they would have previously taken for granted. That's why, as Claies shared, they breed bad programmers; people who don't fully understand the significance what they are coding. The choice of language is yours though, or do you want even more detail on the differences between them? In any case I'd just say, stay clear of VB.net, simply because it has finite resources for learning compared with the others. Compiler choice (for C): gcc/g++ of course. mingw is a windows port of the gnu compilers, they tend to produce chunky binaries though. Compiler choice isn't a major concern because if you stick to standards it should compile on anything. IDE is a matter of personal preference too. Most of them will allow you choice of compiler, allow makefile exporting etc too (avoid any that don't. Also, avoid DevC++ because it's no longer under development). I use Code::Blocks, which is completely portable, but has a few bugs of it's own. (If you decide to try it, get a recent/nightly build and not the latest stable). I can't actually think of a non-free compiler for Java. For C#, look into the mono project. |
2008-03-09, 15:46 | Link #5 | |
Knowledge is the solution
Join Date: Jan 2004
Location: St. Louis, MO
Age: 39
|
Quote:
Although of course, for people who will dedicate their efforts to other things like emulators, drivers, or anything that is a little more dependant on performance optimization I'd say that C++ is the best option among the OOP languages though, as you have mentioned, since in this case it is pretty necessary to have all the knowledge that you have pointed out. Again, this all relies on what will you use programming for. If you are only learning programming as a hobby, and your main focus right now is to learn OOP principles rather than proper programming (which is something that you should be carrying from procedural programming anyway) I'd agree that Python is the best option. I've helped as a teaching assistant in some programming courses, and in my experience Python is the fastest language to pick up. My IDE recommendations has always been Eclipse. Even though what it shines for is for its Java programming capabilties, it is a very flexible IDE whose plugin system allows it to be a programming interface for practically any language. As such, downloading the corresponding plugins will allow you to use it as a C++, Delphi or Python programming tool
__________________
|
|
2008-03-10, 11:33 | Link #6 |
Sleepy Lurker
Graphic Designer
Join Date: Jul 2006
Location: Nun'yabiznehz
Age: 38
|
Thanks for the feedback, I somewhat needed it as a few months ago I had a small chat with a long-time buddy of mine who went to university and was quite dismayed when he started, on his first year, to study OOP without lingering safely long enough on mere procedural language. Learning C++ at once, it seemed, caused a significant raise in dropout or failure rate - to such an extent that last year the said establishment decided to introduce Pascal before even considering OOP. Knowing that object-oriented programming ain't always a walk in the park (I have acquaintances who are relatively familiar with it and say they have no problem but others tend to disagree), I wanted to have an idea of what to try first, if it could help me not only master the subject at hand and slowly work my way up (or down, depending on how you picture it) to low-level languages.
I'll have a look at Python - and, yeah, indeed, Eclipse seems nice. I have the Java compiler (although it's not one of the recent builds as I need to add a 'patch' to enable keyboard input - a small nuisance that's been fixed in later versions from what I've been told). And, indeed, Dev-C++ is a goner for me...it hasn't been updated since 1995, so I believe the folks at Bloodshed have either dropped it or gone dormant. Only issue I have and I might look elsewhere for that is that the Europa Fall-2 compiler for C++ doesn't have the <iostream> file, which is used in the tutorial book I bought a few weeks ago. But I'll see whether I can circumvent this. Oh, and, by the way, is Borland any good? I know they make a lot of compilers (Delphi, C++) but I have yet to try any of them.
__________________
|
2008-03-10, 12:52 | Link #7 |
Senior Member
Graphic Designer
|
I fail to see how learning any high-level language is making you a bad programmer.
Sure, in high-level languages like Java and Python you don't have to worry about memory allocation but that's the whole point of it. And not knowing the low-level stuff isn't a disadvantage - in high level languages. Sure, if you know Python and want to learn C++ then you have to learn to do a lot of stuff that was given before but bad practices for C++ are not necessarily bad practices for Python. I say, most important is why you want to program and the language depends on the answer to that question. If you want to learn programming because computers fascinate you and you want to learn how they work, then a low level language is better. There are lots of concept you only need to know when programming a low level language and those concepts also teach you how a computer actually works. On the other hand, if you want to create an application and that application doesn't heavily rely on performance (95% of all cases), you're better off with a high level language. You simply don't have to bother with a lot of stuff you would have to when programming a low level language. High level languages make away with lot of stuff that's keeping you back and you can focus on creating an application. I also suggest to consider web programming with either a server-side language like Ruby, Python or PHP or with a client-side language like Flash. You are more limited in those environments regarding what you can do but you also have a much higher reach. Having to download and install an application is an obstruction to a lot of users. Having your application run through a browser will get a lot more people to give it at try.
__________________
|
2008-03-10, 14:41 | Link #8 | |
Good-Natured Asshole.
Join Date: May 2007
Age: 34
|
Quote:
In my C programming class (yes, we did C), my professor made a point to demonstrate to us at every lesson how things can go wrong and how we should prepare for it. There are commands that specify exactly how much input it takes, rather than eat everything it's given, and there are ways to restrict the range of events code has to handle. He also had a knack of being graphic about it: he'd write code that disobeys that defensive principle and we'll all watch it explode. Other professors who taught the same course paid no attention to this, and our class came out on top of a lowest-common-denominator final exam. I mean, you really don't need to learn every nook and cranny of the system, but sometimes a little bit of that just to teach people how bad things can get is better safe than sorry. I've seen truly terrible coding practices before and I can't bear how some people ignore protection against misuse over raw performance, simply because they've never been exposed to it. |
|
2008-03-10, 15:11 | Link #9 |
Knowledge is the solution
Join Date: Jan 2004
Location: St. Louis, MO
Age: 39
|
And again, it heavily depends on what you want to do. If your niche will be extremely optimized programming, to the point that every memory leak, every unused variable, and absolutely optimal and exact memory allocation matters, then you don't learn OOP, or C, or anything like that. You learn assembly and you are programming drivers or programming for microprocessors.
If you are programming an Intelligent Tutorial System targetted towards interactive education, then you obviously you want your program to be responsive within a reasonable frame of time, and obviously you will apply some good and general programming practices. You will take account of the most frequent exceptions and properly catch them, ad infinitum. But you won't really care about how the Pedagogical module interacts with the knowledge repository down to the last bit. Of course, there are some good programming practices that apply for any language (Modularizing, using design patterns, programming towards intefaces, you name it), and it is always useful to teach students all the work a high level language does for you, so that you can always have it into account whenever they migrate, however those principles and practices aren't in contradiction with the aspects high level languages try to cover from the programmer.
__________________
|
2008-03-10, 21:42 | Link #10 | |
Senior Member
Join Date: Dec 2007
Location: England
Age: 37
|
Quote:
What anyone should know though, is the advantages imposed by their HLL language, why the language has the features it does and how they improve on older methods. Imagine an interviewer asked you that, can you come up with more than a few words for what you know is different? Someone self-taught wont go through the same level of theory as a student, but a self-taught low-level programmer can see the advantages straight off, it's concepts they are already familiar with. That's all I meant by my point about it being easier to migrate and such. On the other hand, if someone is using a low-level language for the wrong reasons, I'd point my finger at them as the bad programmer. HLLs definitely have the upper hand for the most of modern coding, as long as the programmer understands what they're doing. However, there's plenty of times where they don't, and the result's can be an ugly mess, over-engineered code and real performance killers. thedailywtf will give you some insight into that, I have a few elegant tales of my own too. Ultimately, it's not neccesary to learn everything down to assembly; but there are certainly advantages in doing so. |
|
2008-03-11, 05:58 | Link #12 |
Fuwaaa~~~
IT Support
|
Well, maybe you want to try ruby instead? It's a very interesting programming language IMO altough i'm also still in the beginning of learning it.
Anyway, giving that choice i'll stick with Java. Java seems fit me well to create programs from business application to game (i've built a visual novel engine with Java). Altough i think it's rather performance demanding than C...
__________________
|
2008-03-11, 09:25 | Link #13 | |
Knowledge is the solution
Join Date: Jan 2004
Location: St. Louis, MO
Age: 39
|
Quote:
__________________
|
|
2008-03-11, 17:16 | Link #14 |
Obey the Darkly Cute ...
Author
Join Date: Dec 2005
Location: On the whole, I'd rather be in Kyoto ...
Age: 66
|
You can actually "program" in Matlab but its really as messy as the old BASIC in some ways and hell to maintain (e.g. taking responsibility for a program someone else wrote).
Its forte is all those lovely math packages and display functionality. First you have to decide --- are you doing this for a living or for fun? If you are doing it for a living, you need to research what industries use what languages and what platforms. Most of the "heavy-lifter" programmers I know have eventually migrated to Java because it doesn't tie them to a platform. But the realtime and systems programmers end up *nixing (RTOS and embedded fit more easily in that land). If you're focused on user apps or businessware .... the Visual Studio packages may be more appropriate though, really, I'd be ware of any attempt by MS to lock you into *their* environment. You can learn good or bad practices in any language or programming environment. Some are better at discouraging bad practice. I still think the best starter language for pure computer science purposes is a subset of C++ but Java has the advantage of all those GUI libraries for instant gratification, so its a toss up. If you're really hobbying this, you might look at the Lego Robotics kits and the RTOS packages that you can load in for Java or C(++). Its a few hundred dollars but you can get a good starting grasp on control systems and feedback loops if you want to do programming outside of the "car payment accounting system" type of computing world.
__________________
|
2008-03-12, 20:39 | Link #15 | |
Geek
|
Quote:
http://www.microsoft.com/express/vc/ http://www.microsoft.com/express/vcsharp/ For GCC on Windows you can use cygwin: http://cygwin.com/ Java JDK: http://java.sun.com/javase/6/ If you use something other than windows you can generally install GCC pretty easily. Most Linux distros come with it. It comes with the OS X developer tools. I'm not a developer but I have had to set up some simpleish development environments for others. |
|
2008-03-12, 20:47 | Link #16 |
ISML Technical Staff
Graphic Designer
|
I had this same problem a few years ago, but I also learned that the concept of all programming languages is pretty much the same, kinda like how if you played Mario before, then you will find Donkey Kong pretty similar (or any platform-based game for that matter). I like Java more because I personally found that it is way more useful than the other programming languages. (Again, this is based on my situations, so no need to flame.)
Short Answer: Go with Java, but it doesn't really matter (seriously).
__________________
|
2008-03-29, 18:09 | Link #17 |
Aria feels good....
Join Date: Jun 2007
Location: In my cube (it looked kinda rectangular though, he says)...
Age: 35
|
There is no need to change to linux to program, that's just a stupid thing to do if you don't want to do it.
You can program C/C++ easily with Dev C++ (which has a lot of devpak for everything, even opengl or directx). You can program Java or Python with Eclipse, there is no need to change your OS. I'd recommend C/C++ for most uses, it's just the best performance language next to assembly in most cases. Also, it has everything you need to program anything, and offers you the possibility to manage memory at will. However, there are some things that might not be easy to understand. Java is a bit more friendly and also has a very good performance (sometimes it can overtake C/C++, but the cases are not significant). Python's performance is something really ugly, but it's an incredibly easy programming language to program some utils that you might want to use either despite the time it takes for them to run or because you are not using much data.
__________________
|
2008-03-30, 09:43 | Link #18 |
sleepyhead
Author
Join Date: Dec 2005
Location: event horizon
|
Well, personally I don't really follow you're way of thinking although I understand your ambition. Please try to use and appreciate a high level language before going knee deep into a lower level one. Why? Because writing readable code is fun. Also higher level languages generally will present the newbie with proper programing concepts sooner rather then later...
As a general purpose editor I recommend Notepad++. I must say I find it's default styles horrid but it's so easy and intuitive to change it's default style to whatever please you in less then a minute (per language) that it's easily ignored as a disadvantage. (make sure to get it's brilliant hex editor plugin as well )
My personal recommendation...
Hopefully this helps you somewhat.
__________________
|
2008-03-30, 09:58 | Link #19 |
Senior Member
Graphic Designer
|
http://blog.magnetk.com/2008/03/26/h...e-development/
Interesting post detailing the advantages of using a high-level language even for an application like an SFTP drive. They were able to finish in 1/3rd of the time and have more time to invest where it actually matters.
__________________
|
2008-03-31, 04:11 | Link #20 | |
Asuki-tan Kairin ↓
Join Date: Feb 2004
Location: Fürth (GER)
Age: 43
|
Quote:
Lets presume good user code management, then it is more likely to run into random compiler/library problems using the managed (garbage collectors etc...) code coding languages than the more down to the architecture ones like C. Of'course managed code is nicer to program and to manage when you do not trigger one of the bugs or limitations that often comes with it. For instance I have wasted lots of time trying to work around "side-effects" caused by using C#. But what can one expect of a coding environment (C# is much more than just a language) when it is develloped in a short time, and supports/relies heavily on tons of transparent libraries (you cannot look inside them) to make high level functions available. ... Which is the main reason why one is screwed when running into problems that are related to buggy function implementations in libraries or compiler errors (a return address for a function is only then a usefull debug information, if there is corresponding source code available... *but that is in big part a problem with the non-open source MS-stuff only - C#). Other high level languages i.e., Ruby do not have the non-open source problem but evolve too fast. Functionality is added much faster, then reliability and bugfixing is taken care off. Lets say one uses version 1.x and has the bugs x,y,z and wants them corrected for this version... bad luck, since x is bugfixed in 1.x2 which contains the bugs a,b thanks to the new feature moo. Y is bugfixed in 2.x, which does not support some of the stuff in 1.x anymore. And z was never fixed. Well if one tries to do reliable code management with such a language as foundation, one will have "fun" for years to come.
__________________
|
|
|
|