Sign in to follow this  
Followers 0

Getting started FAQ

71 posts in this topic

Posted

A recurring question on these boards is
8 people like this

Share this post


Link to post
Share on other sites

Posted

Generally a good post, but I disagree with a lot of what you say and would argue against pinning it. A lot of it is opinion and highly subjective.

Some points:
I disagree that C/C++ is a bad first langage. I personally think that C# (and Java) is a terrible first language. If you're teaching basic programming of imperative languages (functions, conditionals, loops, etc), then C# is far too complex. You get caught up in syntax, memory management ('new' is too much) and program structure instead of focusing on the basics. In this case, Python is a much better choice. If your user is a future computer science or engineer student, then C# contains too much 'sugar' and hides too much of the basics. I've seen my fellow classmates that started with C# have nothing but problems in future courses like OSs, compilers, and computer architecture. In these cases, I view C# as setting the user up for failure. Of course, all of this is my opinion based on my experience. As I said, very subjective.

IDE support is not essential. I would argue that IDEs get in the way. For one thing, they're quite complex and having your user navigate something as large and feature rich as Eclipse or Visual Studio can be daunting. If you're starting with the basics, the best 'IDE' is really notepad with a run button and 'print' should be your debugging mechanism. Anything else is too much and distracts from the basics.

On languages, your description of the various languages is also something I disagree with. For one thing, your lumping of library features with languages is a bit deceiving. The two are orthogonal. Your observation that the C language provides nothing is the whole point of C. It was designed as essentially a high-level assembly, where there's a trivial mapping from every C construct to the equivalent machine code. C++ being a complex, bloated, inconsistent language is just an opinion, and one that I for one do not share (except the complex part, but I wouldn't phrase it like that). As someone who's primary coding language is C++, I don't find it unproductive, if anything, the opposite.

I could say a bunch of other things about some of your other points, but the jist of it is that the advice given is bad for a wide class of people and that what you're written is too opinionated.

P.S. Don't say things like "same as C# except crappier" or "ugly". It sounds unprofessional, to a point that's beyond neowin's unprofessionalism (and boarders childishness/fanboyism).

Share this post


Link to post
Share on other sites

Posted

This is definitely worth a pin, and you've earned some rep too :).

A few points to add:

[b]1) "Productivity" is relative.[/b]
Dr_Asik mentioned that C++ is highly unproductive, and to an extent I agree, but it depends highly on what you want to do. For graphical applications with buttons and images, you're best off going for a .NET language or similar since the IDE provides immensely extensive tools for GUI development. However if you're looking for low level development, then something like C#, Java or Python would be immensely unproductive since you can't (or in the case of .NET, struggle) to escape the runtime environment. C or C++ are built for the task of high speed, low level interaction. For a business programmer, or a high-level developer, high-level languages like C#, Java and Python are obviously more productive, but their vision of "productive" is different than from, say, a mainframe developer who needs to code as close to the metal as possible, and would prefer to program in C/C++ or even assembly!

[b]2) Use the right tool for the right job.[/b]
Similar to point 1. A good developer can write in a variety of different languages, and chooses the best language for a specific job. If you're knocking together an operating system, C is usually the best way to go, if you're developing a Windows application with a graphical interface, C# or VB are the way to go. If you're looking to do something very high level without too much work, then Python's extensive collection of modules can make life very simple. The worst mistake you can make when writing code is to try and use a language in a way it wasn't supposed to be used; it makes your life needlessly hard and usually produces crappy and inefficient results. You wouldn't use a power drill to hammer a nail, and you wouldn't use Python to write an operating system.

[b]3) Don't jump in at the deep end[/b]
A lot of beginner programmers, and I mean a LOT, will try to write a web browser or an anti-virus program for their first program, and to put it plainly: "it ain't gonna happen". Web browsers and antivirus packages take years to develop with team of highly trained developers, and trying to emulate their work in your first attempt will lead to fruitless results and endless frustration. Baby steps are what is required. Start off with a [url=http://en.wikipedia.org/wiki/Hello_world_program]"Hello, World"[/url] application and go from there to write bigger and better programs as you get better.

[b]4) Programming is Hard...[/b]
Writing simple applications is easy, especially with the IDE support we get today. Software development suites like Microsoft's Visual Studio can save you hours and hours by writing a lot of code for you and letting you get on with what you want to do. However, writing GOOD code is hard. Efficient programming requires extensive design, and a lot of hard work. If you've jumped straight into a big project, don't expect your code to work well; you might surprise yourself, but it takes a long time to become a true code ninja. At the time of writing, I've been writing code for 6 years through 5 years of education and a year in work, and my code is still far from the best, but its getting better!

[b]5) ... But its immensely satisfying[/b]
I said that programming is hard in point 5, but if you get it right, its one of the greatest non-sexual satisfactions you can get. The feeling you get the first time you compile your code and run it successfully is addictive, and what keeps programmers loving their jobs. Programming is something of an emotional roller coaster, there are times when you could just throw in the towel from frustration, but the feeling of success and pride you get when you solve a problem, and especially when you do a good job of it, can't be beat.

[b]6) Tops down or bottoms up?[/b]
The concepts used in programming can be learned in two different ways (in my opinion). The first, top-down, encourages you to start off with high level languages such as VB or C#, and to use the graphical designers and gently ease into writing code. Bottom-Up encourages you to start off at the base level using languages such as C++ (not so much C these days) and to learn the core concepts such as algorithm design and dynamic programming, and then building on this knowledge to build great software. The first approach provides you with results very quickly, although you're at risk of not understanding the underlying concepts and struggling with complex code. The other approach teaches you good programming practices, and teaches you good problem solving techniques, but puts you at risk of "burning out" since visible results come much more slowly.

The top-down approach to learning is generally taken by home-schooled programmers who just want to dive straight in since, like I said, it provides results very quickly. The bottom-up approach is usually schooled by university courses on software development, since it gives you a good education and sometimes a more transferable skill set.

Neither approach is invalid per say, but each approach has its advantages and disadvantages, and at the end of the day, its up to you to choose how you want to learn. Everyone learns differently, and in most cases a combination of both approaches works well for most people.

[b]7) Get a text book[/b]
A lot of people contest this, but I stand by it that text books can be invaluable for programmers, particularly language specific ones. The best ones are great for teaching you the language you program in, and at the same time can be great tools for debugging your code, as well as great ways of propping up your monitor, as has happened to one of mine.
1 person likes this

Share this post


Link to post
Share on other sites

Posted

I have to largely go with MrA. The most important part is to learn underlying concepts.

Anyway, the main problem with your post is that it's not really about programming languages, it's about development environments (and it seems a bit Windows-centric at that.)

You say that C makes it difficult to do "something graphical," whereas C# makes it easy. What does that have to do with the language? That's a matter of libraries and IDEs. You appear to be actually be comparing C-based APIs like GDI and USER with .NET libraries like Windows Forms/Presentation Foundation and the Visual Studio GUI editor, rather than C and C#.

You then call C++ complex, which is debatable. C# 4.0 is also a very complex language. As for calling C++ bloated, I guess you might mean that you have to write more code, but then we're really back to the library issues rather than the programming language.

Share this post


Link to post
Share on other sites

Posted

[quote name='hdood' date='08 May 2010 - 17:16' timestamp='1273335391' post='592599206']You say that C makes it difficult to do "something graphical," whereas C# makes it easy. What does that have to do with the language? That's a matter of libraries and IDEs. You appear to be actually be comparing C-based APIs like GDI and USER with .NET libraries like Windows Forms/Presentation Foundation and the Visual Studio GUI editor, rather than C and C#.[/quote]

That's a very good point. Its unfair to compare C/C++ without a library to C# with the WinForms or XNA libraries since C++ can be extended with something like TCL/TK or Qt for fast GUI support and plenty of different game engines. I think its also necessary to distinguish that the "Drag-n-drop" features of .NET as part of the IDE, and not of the language.

I do think that discussion of languages is a good idea though since someone learning to program has a LOT of choices in regards to programming languages, as well as a choice to make in which version of a programming language to use (C# 1.0 is [i]vastly[/i] different from C#4.0 feature wise), and it would help to have input from those who do use the various languages to provide information about what languages are good at, as well as what they are bad at.

Perhaps its worth avoiding the bias towards C#. I know its the OP's preferred language, and it is a good language in general; however, someone looking to get into programming needs a balanced view. Lets at least get a second disadvantage to C#.

Its still worth pinning as a replacement to the "Easy Programming Language" topic in my opinion, but it needs work first. :)

Share this post


Link to post
Share on other sites

Posted

Thanks for the feedback. I agree with some and disagree with some, so I'll go through it in order:

[quote name='MrA' date='08 May 2010 - 06:51' timestamp='1273315908' post='592598526']
I disagree that C/C++ is a bad first langage.[/quote]I didn't say that (in this post at least :p ). I said like most popular, general-purpose programming, it can make a good choice, although like every other it has both advantages and drawbacks.

[quote]I personally think that C# (and Java) is a terrible first language. If you're teaching basic programming of imperative languages (functions, conditionals, loops, etc), then C# is far too complex. You get caught up in syntax, memory management ('new' is too much) and program structure instead of focusing on the basics. In this case, Python is a much better choice.[/quote]At the same time, many will say early exposure to some memory concepts is vital, which is why many recommend C or C++ as first programming language. C# provides a decent middle ground: it makes the stack/heap concept explicit, but provides garbage collection. Again, syntax is complex, but it's a middle ground; sometimes it's Java-like (writing Hello World), sometimes almost Python-like (lambdas etc). But mainly I find your comment weird because I 100% agree that Python makes a FINE CHOICE; I say it explicitely and do praise it lavishly.

I get the sense that this post is interpreted as an apology of C#, because I start by saying it's my personal recommendation. It's not, really, I'm taking the most commonly recommended languages and comparing them based on a few criteria. I felt giving a "short answer" would be useful, even though it can never be much more than a personal opinion since several languages make fine choices. I think I did make it quite clear in my formulation that this was my personal opinion however, no?

[quote] If your user is a future computer science or engineer student, then C# contains too much 'sugar' and hides too much of the basics. I've seen my fellow classmates that started with C# have nothing but problems in future courses like OSs, compilers, and computer architecture. In these cases, I view C# as setting the user up for failure. Of course, all of this is my opinion based on my experience. As I said, very subjective.[/quote]I made that clear when I said C and C++ go hand-to-hand with a course on computer architecture, and that a drawback of C# is that it shields you from the OS.

[quote]IDE support is not essential. I would argue that IDEs get in the way. For one thing, they're quite complex and having your user navigate something as large and feature rich as Eclipse or Visual Studio can be daunting. If you're starting with the basics, the best 'IDE' is really notepad with a run button and 'print' should be your debugging mechanism. Anything else is too much and distracts from the basics.[/quote]The reason Visual Basic got so popular is not because it was a great language (it wasn't) but because the IDE let you do stuff quickly. With a good IDE, a beginner can quickly make a functional GUI-based application, and the debugger can be a vital learning tool as you get to see your program running line-by-line, inspecting the value of variables simply by hovering your cursor over them; it's very intuitive and I didn't see beginners struggling with that (I did see beginners struggling to find out what was going on when the only tool they had was print). It's also much simpler to set up, and there are tons of tutorials including quality videos on the net to help you out with the basics of the IDE. Finally I find it pointless to learn how to setup a "barebones" development environment when that's used neither in academic or professional contexts. Majestic makes a similar point:

[quote]Its unfair to compare C/C++ without a library to C# with the WinForms or XNA libraries since C++ can be extended with something like TCL/TK or Qt for fast GUI support and plenty of different game engines. I think its also necessary to distinguish that the "Drag-n-drop" features of .NET as part of the IDE, and not of the language.[/quote]It hardly matters from a beginners point of view. [b]He wants to learn how to make applications, not how to learn the language-specific features of a certain language[/b]. To make applications, you need to learn a language, sure, but preferably one that has good IDE and libraries to help you get the job done.

And sure you can add librairies to C++, but the point is that you have to do it yourself, and with no understanding of programming concepts it's a tough call you'll be able to do that. I view the out-of-the-box integration as an important asset for a beginner.

Besides if you want discuss semantics, a language can hardly be considered separately from it's standard libraries/platform. What is Java without the Java librairies and Java platform? What is C++ without the STL and standard library? A language, sure, but one you can't do much with. hdood also makes a similar point:

[quote name='hdood']Anyway, the main problem with your post is that it's not really about programming languages, it's about development environments (and it seems a bit Windows-centric at that.)[/quote]It's about both, and both matter from a beginner's perspective. A good, popular IDE will help him get started faster, get rewarding results faster, see his program in action, find appropriate tutorials on the net more easily. I do explain this reasoning in my post.

[quote]On languages, your description of the various languages is also something I disagree with. For one thing, your lumping of library features with languages is a bit deceiving. The two are orthogonal. Your observation that the C language provides nothing is the whole point of C. [/quote]I do make it a positive point that it is barebones. However I also point out that the lack of libraries make it hard to get any results done, which can be discouraging. I think this is a nuanced, correct point of view.

[quote]C++ being a complex, bloated, inconsistent language is just an opinion, and one that I for one do not share (except the complex part, but I wouldn't phrase it like that). As someone who's primary coding language is C++, I don't find it unproductive, if anything, the opposite.[/quote]C and C++ are among the few languages that a beginner can't use to make any sort of graphical application, because it involves a lot of code, installing and linking to external libraries, etc. Even making text-based applications is hard because processing user input is touchy, writing/reading text files is touchy, etc. Of course you learn your way around that stuff eventually, but in the meantime, in Python or C# you'd be done already and would be learning some other programming concepts. Hence it is unproductive, at least for beginners (and even for advanced programmers, but that is another discussion).

It is bloated because of the duplication of features between C and C++, including both language and library features. Also because it forces you to learn how header files work, concepts of very little use such as private/protected/virtual inheritance, difference between a reference and a pointer (as if pointers weren't hard enough) friends, various meanings of "static", and I could go on. All of these simply don't exist in most languages, so it's something to be aware of. Hence I point it as a drawback, which is correct. I am not advising against C++: I am saying it is a recommended choice, but be aware of that, it's not going to be a walk in the park.

[quote]P.S. Don't say things like "same as C# except crappier" or "ugly". It sounds unprofessional, to a point that's beyond neowin's unprofessionalism (and boarders childishness/fanboyism).[/quote]Agreed. I was getting a bit tired at the end, but that needs much better phrasing.

[quote]You then call C++ complex, which is debatable. C# 4.0 is also a very complex language.[/quote]C# is very complex, but it allows you to do a lot without having to deal with much of that complexity, unlike C++. It's easy to learn, hard to master. C++ on the other hand is both hard to learn and hard to master. How many posts do we get here asking why some text input code using cin doesn't work? We don't get that for any other language. Even the most simple tasks are hard to do right in C++. Again, that's something to be aware of.

In general again I think this post is interpreted like an apology of C# and encourages not to try other languages. This wasn't its purpose so I will try to reformulate it as to make my intent more clear.

Share this post


Link to post
Share on other sites

Posted

I just edited the OP. Please re-read before making more comments about it.

Still looking for advice for Mac tools/IDE.

Share this post


Link to post
Share on other sites

Posted

[quote name='Majesticmerc' date='08 May 2010 - 10:38' timestamp='1273329537' post='592598906']
A few points to add:[/quote]Thanks, I will try to integrate this in the post. Keep in mind I'm trying to keep this short and to-the-point. This is a "where to start", not a "all you need to know" FAQ, so I'll probably trim down.

Share this post


Link to post
Share on other sites

Posted

[quote name='Majesticmerc' date='08 May 2010 - 10:38' timestamp='1273329537' post='592598906'][snip]
[/quote]I've carefully read your post and I although it's interesting and I agree with it, I decided not to add it to the FAQ for the following reasons:
- it's right below the OP, formulated in your own words, so if the reader is interested in more discussion he will see it immediately
- it's too high-level for the purpose of the FAQ, which is just to point the beginner towards a language, an IDE and some tutorials.

I agree that books are useful, if you have recommendations in particular (preferably with links) I could add a section for that.

Also I'd just like to point that at least two operating systems were written in C#: Singularity and Cosmos. ;)

Share this post


Link to post
Share on other sites

Posted

[quote name='Dr_Asik' date='08 May 2010 - 20:33' timestamp='1273347191' post='592599772']
It's about both, and both matter from a beginner's perspective. A good, popular IDE will help him get started faster, get rewarding results faster, see his program in action, find appropriate tutorials on the net more easily. I do explain this reasoning in my post.[/quote]
Your posts are mostly about environments. There's nothing wrong with that, it's just that you phrase it so that it seems like the pros and cons are somehow inherent to the programming languages, which is not true.

A GUI framework is not part of the C# language, it's part of a library, just like in C/C++. You could easily have Windows Presentation Foundation in native C++ (or even C), and it wouldn't be noticeably more difficult.

What you're really saying is that a C++ environment made up of Windows and Visual Studio is harder to develop for out of the box, because it doesn't come bundled with libraries like that. I think this distinction [i]is[/i] important, and I'm not just trying to be pedantic.

The rest is mostly ranting.
1 person likes this

Share this post


Link to post
Share on other sites

Posted

So after "Productive for GUIs" you want me to add "(not because of the language itself, but the libraries and IDE integration that comes with Visual Studio Express which is what recommend installing)" ? I don't even expect someone reading this post to understand the difference between a language and the librairies it comes bundled with.

Besides the distinction is almost meaningless in some regards. In C#, int is defined as System.In32; C# is simply undefined without the BCL. And no you can't use WPF in C even if you wanted to.

Share this post


Link to post
Share on other sites

Posted

[quote name='Dr_Asik' date='08 May 2010 - 22:31' timestamp='1273354270' post='592600114']
So[/quote]
How you want to write things is up to you.

[quote name='Dr_Asik' date='08 May 2010 - 22:31' timestamp='1273354270' post='592600114']
And no you can't use WPF in C even if you wanted to.[/quote]
Yes, you could. There's nothing magical about it. The fact that no one has bothered to write it has nothing to do with the language. I'm a little surprised that you don't understand this.
1 person likes this

Share this post


Link to post
Share on other sites

Posted

[quote name='hdood' date='08 May 2010 - 17:39' timestamp='1273354799' post='592600144']Yes, you could. There's nothing magical about it. The fact that no one has bothered to write it has nothing to do with the language. I'm a little surprised that you don't understand this.[/quote][url="http://msdn.microsoft.com/en-us/library/ms742522.aspx"]You cannot call WPF APIs from a true unmanaged program.[/url] You might be able to write some kind of wrapper and then use that, but the fact that no one has bothered to write one leads to believe that it's probably impractical and mainly pointless. And what's the relevance to a "getting started" FAQ anyway? As I said I don't expect someone reading this to understand the difference between a language and a library. C# lets you easily create GUI applications because WPF and Winform are well integrated with it in the Visual C# IDE; for beginners I can simply say "C# lets you easily create GUI application" and leave the rest for future discovery. It's not misleading. It's incomplete, but my point is to be helpful, not complete. Someone starting with C isn't going to make GUIs anytime soon; they need to understand just that, nothing more for now.

Share this post


Link to post
Share on other sites

Posted

[quote=Dr_Asik]Someone starting with C isn't going to make GUIs anytime soon; they need to understand just that, nothing more for now.[/quote]
I spent 2 weeks learning almost everything to do with C. After that. it took me a couple days to get my first fully-authored GUI program done using the Windows API. Sure, I followed a tutorial the first couple of days, but who doesn't? It's not that hard. All it takes is an intelligent person with the right mindset. If you give up too quickly, you'll never get anywhere. That's true in almost any case, programming or not.

It took me 3-4 months to learn C GUI programming in Windows AND Linux(Gtk+/SDL).
It's not that difficult. Sure, C# simplifies it, but ALL .NET applications are SLOW.
I wrote the exact same program with both C, C# and VB and it was no contest.
(2.6 GHz Intel Pentium 4,2GB RAM,7200rpm HDD)
C load time: 0.46 secs.
C# load time: 2.35 secs.
VB load time : 2.46 secs.

Fact: Everything you can do in C# or VB you can do in C.
The Windows API is very simple once you get to know it.

It seems as if you're trying to draw attention to yourself, starting a thread with a title that you might find pinned to the top. I'm just saying, that's what it looks like.

Share this post


Link to post
Share on other sites

Posted

[quote name='Dr_Asik' date='09 May 2010 - 00:02' timestamp='1273359779' post='592600312']
You cannot call WPF APIs from a true unmanaged program.[/quote]
Uhm, I said that you could easily have Windows Presentation Foundation in native C++ (or even C). As in that you could implement the same thing in C++ because it has nothing to do with the programming language, not that you could call the .NET version. Reading comprehension. There's nothing inherent about the language that makes it impossible to have modern APIs.

[quote name='Dr_Asik' date='09 May 2010 - 00:02' timestamp='1273359779' post='592600312']
And what's the relevance to a "getting started" FAQ anyway?[/quote]
It wasn't supposed to be a huge deal, just to point out that your post appeared to be trying to highlight pros and cons of programming languages, when that's not really what it does. What you're doing is giving your opinion of what out of the box experience one can expect when using Visual Studio under Windows, rather than discussing programming in general. Nothing wrong with that in itself, and it's certainly what a lot of people want.

[quote name='Dr_Asik' date='09 May 2010 - 00:02' timestamp='1273359779' post='592600312']
C# lets you easily create GUI applications because WPF and Winform are well integrated with it in the Visual C# IDE;[/quote]
Then you're saying that Visual Studio lets you do it, not C#. WPF isn't part of C# (and isn't even available on anything other than Windows.) The ability to automatically generate GUI code is not part of C# either, it's part of an editor/IDE. The actual WPF/Forms APIs are not really that simple if you had to write the code yourself, and I suspect the same is true for whatever .NET GUI APIs are available on other platforms.

Hell man, you could probably become comfortable with the good old Windows GUI/graphics APIs faster than it takes to figure out Expression Blend.

[quote name='Dr_Asik' date='09 May 2010 - 00:02' timestamp='1273359779' post='592600312']
Someone starting with C isn't going to make GUIs anytime soon; they need to understand just that, nothing more for now.[/quote]
Debatable. No, you're not going to just instantly load it up and start dragging and dropping controls to make your own "browser" without actually understanding what you're doing and then go post on a forum asking how to compare a variable to some value, but then that is taking "learn as you go" too far and is not a good strategy. Is the goal to actually learn, or just patch something together as fast as possible? Once you've got the basics of the language down, it's not that difficult to get something graphical up and running in C or C++ on most platforms. In that sense your post seems a little clumsy and gives off a kind of biased vibe.
1 person likes this

Share this post


Link to post
Share on other sites

Posted

[quote name='hdood' date='08 May 2010 - 17:08' timestamp='1273363716' post='592600450']
Once you've got the basics of the language down, it's not that difficult to get something graphical up and running in C or C++ on most platforms. In that sense your post seems a little clumsy and gives off a kind of biased vibe.
[/quote]

Exactly.

[quote name='hdood' date='08 May 2010 - 17:08' timestamp='1273363716' post='592600450']
No, you're not going to just instantly load it up and start dragging and dropping controls to make your own "browser"
[/quote]

But you could use something like ResEdit to design a dialog box.

Share this post


Link to post
Share on other sites

Posted

[quote name='Dr_Asik' date='08 May 2010 - 14:33' timestamp='1273347191' post='592599772']...
I made that clear when I said C and C++ go hand-to-hand with a course on computer architecture, and that a drawback of C# is that it [b]shields you from the OS[/b].
...[/quote]
You keep saying that, as if it were a bad thing. Certainly for learning programming, and quite a few applications, there is no advantage to have to deal with things on an OS (or OS-specific) level. A higher-level language may be preferable. I think I disagree strongly to categorizing that as an absolute "negative".

Other than that, I think this is shaping out to be a good thread. (Y)

Share this post


Link to post
Share on other sites

Posted

I agree with Dr. Asik. C/C++ is absolutely the worst language to start off with.

1. When you are learning to program, you shouldn't have to worry about the intricacies of pointers/references/etc. [b]Most[/b] people that have no knowledge in programming get really frustrated with this.
2. Lets face it, C/C++ are old and a lot of newer techniques and concepts either aren't supported or a huge cludge (classes, lots of stuff in the STL).
3. Anything beyond a console program is difficult. For reference, it takes about 100 lines of code for a basic window. Yes, there are a libraries and such out there, but the Win32 API is not the most elegant code.
4. Lots of things are difficult to do in C/C++ that are fairly easy in higher level languages. GUI, networking, graphics, sound, parsing, threads, etc are fairly difficult without outside libraries.
5. Programming should be [b]fun[/b]. If the language is restricting you from what you want to do because of difficulty, [b]most[/b] people will quickly become put off.

Why spend hours learning complex API's, memory management, etc when you could spend a fraction of the time to do the same thing while learning to [b]program[/b] and have fun doing it?

I do OS programming for a job. This involves C and an extreme amount of memory management and pointers. I wouldn't want any noob to have to mess with that stuff. It's a nightmare sometimes.

Share this post


Link to post
Share on other sites

Posted

[quote name='Xilo' date='08 May 2010 - 17:45' timestamp='1273365939' post='592600540']
I agree with Dr. Asik. C/C++ is absolutely the worst language to start off with.
[/quote]For anyone under 15, maybe. C is probably the best language out there for beginners [i]because[/i] it teaches you more about how programs run.

[quote name='Xilo' date='08 May 2010 - 17:45' timestamp='1273365939' post='592600540']
3. Anything beyond a console program is difficult. For reference, it takes about 100 lines of code for a basic window. Yes, there are a libraries and such out there, but the Win32 API is not the most elegant code.
[/quote]
res.rc
[code]
100 DIALOG 100,80,25,25
STYLE WS_POPUP|WS_VISIBLE
CAPTION "Proof"
FONT "MS Sans Serif"
BEGIN
PUSHBUTTON "How's This?",IDOK,0,0,50,14
END[/code]
main.c
[code]
#include <windows.h>
BOOL CALLBACK DlgProg ( HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(100),NULL,DlgProc);
return 0;
}

BOOL CALLBACK DlgProg ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg){
case WM_INITDIALOG:
return 0;
case WM_COMMAND:
switch(wParam){
case IDOK:
EndDialog(hwnd,0);
break;
}break;

default:
return FALSE;
}
}
[/code]32 lines. BOOYAH!

Or, just:
[code]
#include <windows.h>
int main(int argc, char argv[]){
MessagBox(0,"4 lines","of code",0);
return 0;}
[/code]Now [i][b]that[/b][/i] is a basic window. :D

[quote name='Xilo' date='08 May 2010 - 17:45' timestamp='1273365939' post='592600540']
5. Programming should be fun. If the language is restricting you from what you want to do because of difficulty, most people will quickly become put off.
[/quote]No pain, no gain.

Share this post


Link to post
Share on other sites

Posted

[quote name='dramonai' date='08 May 2010 - 20:27' timestamp='1273368422' post='592600636']
For anyone under 15, maybe. C is probably the best language out there for beginners [i]because[/i] it teaches you more about how programs run.
[/quote]
I disagree. There's more to programming than memory management. Memory management just gets in the way of learning concepts.

[quote name='dramonai' date='08 May 2010 - 20:27' timestamp='1273368422' post='592600636']
[code]
#include <windows.h>
BOOL CALLBACK DlgProg ( HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
DialogBox(GetModuleHandle(NULL),MAKEINTRESOURCE(100),NULL,DlgProc);
return 0;
}

BOOL CALLBACK DlgProg ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg){
case WM_INITDIALOG:
return 0;
case WM_COMMAND:
switch(wParam){
case IDOK:
EndDialog(hwnd,0);
break;
}break;

default:
return FALSE;
}
}
[/code]32 lines. BOOYAH!
[/quote]
I said a window. As in a program window. As in not a message box. That is also really bad code. No error handling?

[quote name='dramonai' date='08 May 2010 - 20:27' timestamp='1273368422' post='592600636]
No pain, no gain.
[/quote]
If you want to be a masochist and spend more time debugging and working with complex API's than anything else, well more power to you. The rest of us can be productive. :)

Share this post


Link to post
Share on other sites

Posted

[quote name='Xilo' date='08 May 2010 - 18:52' timestamp='1273369979' post='592600702']
I disagree. There's more to programming than memory management. Memory management just gets in the way of learning concepts.
[/quote]But it gives the programmer a better understanding of the machine. Which is important.

[quote name='Xilo' date='08 May 2010 - 18:52' timestamp='1273369979' post='592600702']
I said a window. As in a program window. As in not a message box. That is also really bad code. No error handling?
[/quote]A dialog [i]is[/i] a program window.
Bad code? I just whipped up an example.

[quote name='Xilo' date='08 May 2010 - 18:52' timestamp='1273369979' post='592600702']
If you want to be a masochist and spend more time debugging and working with complex API's than anything else, well more power to you. The rest of us can be productive. :)
[/quote]I'm not a masochist. A masochist is someone who obtains pleasure from receiving punishment.
I meant: "One must be willing to endure some inconvenience or discomfort in order to achieve worthwhile goals."
So there. Stay on topic.

Share this post


Link to post
Share on other sites

Posted

[quote name='dramonai' date='08 May 2010 - 21:21' timestamp='1273371681' post='592600770']
But it gives the programmer a better understanding of the machine. Which is important.

A dialog [i]is[/i] a program window.
Bad code? I just whipped up an example.

I'm not a masochist. A masochist is someone who obtains pleasure from receiving punishment.
I meant: "One must be willing to endure some inconvenience or discomfort in order to achieve worthwhile goals."
So there. Stay on topic.
[/quote]
Lol, man. The only thing I keep seeing you do on the Programming board with the whole C/C++ vs Others debate is twist people's words and shy away from things that put you in the wrong.

Share this post


Link to post
Share on other sites

Posted

[quote name='Xilo' date='08 May 2010 - 20:11' timestamp='1273374671' post='592600844']
Lol, man. The only thing I keep seeing you do on the Programming board with the whole C/C++ vs Others debate is twist people's words and shy away from things that put you in the wrong.
[/quote]What exactly puts [i]me[/i] in the wrong?

Programmers can do whatever they like. If he/she chooses to program in a simplified language because they don't want to have to work at it, that's his/her decision.

Share this post


Link to post
Share on other sites

Posted

[quote name='markjensen' date='08 May 2010 - 20:45' timestamp='1273365917' post='592600536']
You keep saying that, as if it were a bad thing. Certainly for learning programming, and quite a few applications, there is no advantage to have to deal with things on an OS (or OS-specific) level. A higher-level language may be preferable. I think I disagree strongly to categorizing that as an absolute "negative".[/quote]I made it quite clear in the original post:

[quote]Shields you from the OS (the .NET framework act as an intermediary), a [b]good thing in many ways except for learning how computers work[/b][/quote]

There. A NUANCED point of view. It could be in the positives or the negatives, it's not clear-cut, I chose one because I'm trying to keep things simple. If I didn't, many people would inevitably point out that you'd better learn with C/C++ because they teach you how to interface with the OS (which is why C and C++ are usually taught for CS degrees). And they would be right, except that C/C++ also have their drawbacks which must be accounted for.

In short I'm not rooting for any particular language in the post; I'm not rooting for high-level vs low-level languages; I'm comparing all approaches in as a few words and examples as possible and give beginners an idea of what to look for and what to expect before their attention span runs out. It's not an introduction to programming and it doesn't try to be that.

It would be more useful if instead of discussing semantics and the speed of .NET programs, you [people on this thread in general] provided suggestions for reference material such as how to get started on Mac (I got nothing on that) or books.

[quote]Uhm, I said that you could easily have Windows Presentation Foundation in native C++ (or even C). As in that you could implement the same thing in C++ because it has nothing to do with the programming language, not that you could call the .NET version. Reading comprehension. There's nothing inherent about the language that makes it impossible to have modern APIs.[/quote]But... I am in no way implying that it is impossible to implement modern GUIs that are callable from C++. I'm just saying you are going to have a much easier time, as a beginner, making GUIs by going with C# than with C or C++, considering the whole package, language + libraries + IDE. I make it clear when I list what you should be looking for when choosing a programming language. If someone actually gets misled into thinking WPF can't be implemented in C++, which I sincerely doubt can ever happen, the forum is there for that.

:whistle:

[quote][i]dramonai:[/i] For anyone under 15, maybe. C is probably the best language out there for beginners because it teaches you more about how programs run.

[i]Xilo:[/i] I disagree. There's more to programming than memory management. Memory management just gets in the way of learning concepts.[/quote]Please notice that although the post do lean towards Python/C# more than C/C++, it compares both approaches according to their respective advantages and drawbacks and doesn't clearly take a side on the issue. C/C++ are better for teaching Computer Science, C#/Python are better for getting stuff done and having fun doing it. I am aware of this, so please keep this on topic. I am looking for suggestions to improve the OP so that this section can have a helpful "Getting started" FAQ.

[quote]Then you're saying that Visual Studio lets you do it, not C#. WPF isn't part of C# (and isn't even available on anything other than Windows.) [/quote]But Visual Studio won't let you do it in C++. And from the purpose of a non-programmer I see no purpose in trying to explain the difference between Visual C#, C# and .NET, since in 99% of cases if they take this path they will download Visual C# express and start using the three in combination. Again, if I have to be more precise, this drags on the post and makes it less useful. I link to MSDN which has excellent explanations on what is C#, what is Visual Studio etc., if the reader is interested.

The same goes for Python. Python is not an interactive shell, but 99% chances are you are going to download CPython from python.org and start messing around with the IDLE, and this is a superior learning experience compared to using a build-and-run IDE. Python makes a great learning tool precisly because of that, even though the IDLE is not a language feature. Most argumentations in favor of Python point that out, if you care to look around. (http://www.stanford.edu/~pgbovine/python-teaching.htm) Are they misleading? No. Same goes for C# and its related GUI design features.

[quote]I spent 2 weeks learning almost everything to do with C. After that. it took me a couple days to get my first fully-authored GUI program done using the Windows API. [/quote]I spent a day creating my first VB program, and it was a WinForms Tic-Tac-Toe which you could play against, with three levels of difficulty. You can't really argue that GUIs isn't a strong point of C# and VB, especially compared to C.

Besides I'm not saying C makes it impossible, I'm saying it makes it hard, in the context of a comparison with C# and Python.

[quote]Fact: Everything you can do in C# or VB you can do in C.[/quote]Sure. Hence I'm recommending C as an excellent first choice. Just because I list some drawbacks doesn't mean it's not a recommendation. I listed drawbacks for all languages.

[quote]ALL .NET applications are SLOW.[/quote]If startup time is your one and only concern, why not use NGEN? Besides this kind of blanket statement leads me to think you have no idea what you are talking about. .NET applications can be faster than the fastest code C++ compilers can generate in some cases due to run-time optimizations by the JIT. Besides, [url="http://www.codinghorror.com/blog/2005/05/on-managed-code-performance-again.html"].NET makes it easier to write fast code[/url]. :rolleyes:

Share this post


Link to post
Share on other sites

Posted

Unless you have a goal to program low-level code... C# is the way to go, has the best libraries for Windows Phone 7 development which are really sweet developer tools. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.