00:00
00:00
Newgrounds Background Image Theme

Da-Birb just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Programming for beginners

8,200 Views | 54 Replies
New Topic Respond to this Topic

Programming for beginners 2011-12-13 07:53:45


I'm just starting programming and I was wondering if anyone had any tips for a beginner? I found a website that provided a link to a C++ compiler, I'm about to download it and read up on some tutorials quickly.


Sig by Shaun

BBS Signature

Response to Programming for beginners 2011-12-13 10:33:07


If you are new to programming then do NOT learn C++.
It is a very complex language, with a very steep learning curve. It is not a good idea for a beginner to be using it.

I would recommend that you instead learn Python. It's pretty much the perfect language for someone who is still learning.
Ruby would be a good choice as well, though I would recommend Python over it. Ruby has very unique syntax that could cause you some confusion later down the road.
Java is also a pretty good choice for beginners, though I personally don't like Java.

And here's a tip that will save you a tonne of grief: Avoid PHP whenever possible.

Response to Programming for beginners 2011-12-13 12:02:38


At 12/13/11 07:53 AM, ToBombThePanhandle wrote: ...and read up on some tutorials quickly.

Here's where you went wrong. You will never learn C++ "quickly" if it's your first language. You are going to end up getting frustrated, wondering why it's so hard, and giving up. I agree with Diki's suggestions, however you needn't stay away from PHP.
After you learn a couple of languages, you will be able to manipulate PHP to do your bidding. I agree you should steer clear of it for now, but just because it has a few flaws doesn't mean you should avoid it forever.

But that's an argument for a different time and when you learn a bit more. For now, stick with Diki's suggestions and be prepared to spend A LOT of time on learning and debugging.


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Programming for beginners 2011-12-13 12:35:08


PHP has far more than just a "few" flaws. Almost every aspect of the language is a flaw.
Hell, I would go as far as to say then entire language itself is a flaw.

It's developed by incompetent programmers, is incredibly inconsistent, has gotchas which make no sense, and overall has pretty lackluster performance.
Though I did not say to never use PHP: I said to avoid it whenever possible.

And since he is still learning: if he uses PHP he will start to learn bad programming habits. PHP is notorious for that.

Python is incredibly easy to get up and running for web programming. There is no reason in the world to use PHP, unless you have no choice.

Response to Programming for beginners 2011-12-13 14:33:19


At 12/13/11 12:35 PM, Diki wrote: There is no reason in the world to use PHP, unless you have no choice.

Its about getting the job done in the quickest possible way a lot of the time and PHP can let you do that because its typeless and the way its syntax works

You've just suggested Python their which is a good language but wont actually tell you about an error until you execute that part of the code, meaning you have a hell of a lot more testing to do!


PHP Main :: C++ Main :: Java Main :: Vorsprung durch Technik

irc.freenode.net #ngprogramming

BBS Signature

Response to Programming for beginners 2011-12-13 15:09:11


At 12/13/11 02:33 PM, Jon-86 wrote: Its about getting the job done in the quickest possible way a lot of the time and PHP can let you do that because its typeless and the way its syntax works

First of all: PHP is not typeless. It is dynamically typed.
Second of all: So is Python.

And you should strive to get the job done well. That is where PHP falls by the wayside.
But, if for some reason you would rather get something done fast instead of done properly, you can still write bad Python and get the job done sooner than in PHP.

Plus: if you're concerned with speed you should not be using PHP. Python executes faster.

At 12/13/11 02:33 PM, Jon-86 wrote: You've just suggested Python their which is a good language but wont actually tell you about an error until you execute that part of the code, meaning you have a hell of a lot more testing to do!

This is just plain stupid.
If you use PHP you're going to encounter a plethora of issues because of how poorly designed PHP is, which will result in orders of magnitude more testing than Python will.
Note: this only holds true for complex scripts/libraries/frameworks.
However: even basic scripts written in PHP will easily result in more testing required (Python doesn't have the asinine gotchas that PHP does).

Anyways you should be testing/debugging your code as you write it. Not writing all of it and then testing it.
If you program properly then Python's paradigms will not hinder you. In fact they will do the exact opposite.

Response to Programming for beginners 2011-12-13 15:40:19


At 12/13/11 03:09 PM, Diki wrote: And you should strive to get the job done well. That is where PHP falls by the wayside.
But, if for some reason you would rather get something done fast instead of done properly

Aye in an ideal world we would all like to be able to take our time and write decent code but thats just not the case most of the time. A remember farting out 3 quite complicated competition sites over a couple of days. Never had time to sit down and think about them just had to met the spec, and it was a loose spec at that.

PHP is makes it easier to get it done.

At 12/13/11 03:09 PM, Diki wrote: This is just plain stupid.
If you use PHP you're going to encounter a plethora of issues because of how poorly designed PHP is, which will result in orders of magnitude more testing than Python will.
If you program properly then Python's paradigms will not hinder you. In fact they will do the exact opposite.

No it's not, its not about design for me. If I write a throw away site thats only going to be up a week or so I can be fairly sure it will work in PHP with less testing than if I wrote it in Python. Not to mention Python relys on white space. We all use different IDEs and different operating systems, which makes Python murder to work with.

Believe me I like python for my own stuff but to say PHP should be avoided is short sighted. Each language has its strengths and weaknesses.


PHP Main :: C++ Main :: Java Main :: Vorsprung durch Technik

irc.freenode.net #ngprogramming

BBS Signature

Response to Programming for beginners 2011-12-13 15:42:12


At 12/13/11 03:09 PM, Diki wrote: Plus: if you're concerned with speed you should not be using PHP. Python executes faster.

Development time, not execution time!


PHP Main :: C++ Main :: Java Main :: Vorsprung durch Technik

irc.freenode.net #ngprogramming

BBS Signature

Response to Programming for beginners 2011-12-13 16:16:14


At 12/13/11 03:42 PM, Jon-86 wrote: No it's not, its not about design for me. If I write a throw away site thats only going to be up a week or so I can be fairly sure it will work in PHP with less testing than if I wrote it in Python.

If you write poorly structured code then a bad programming language will appeal to you.
So then yes: if you want to write very inefficient code, while still conforming to a language's standards, then absolutely use PHP.

However: when you do real work on applications which actually matter then PHP is just going to bottleneck your efforts at every turn.

At 12/13/11 03:42 PM, Jon-86 wrote: Not to mention Python relys on white space. We all use different IDEs and different operating systems, which makes Python murder to work with.

Any decent IDE can be easily setup to write Python without any issue. If you cannot figure that out then programming is not for you.

Hell you can write Python in Notepad++ with virtually no setup required.
I say "virtually" since if you're using a different operating system than the server which the code will be executed on you will need to change the line-endings in the settings.
Again: if you can't figure this out then programming is not for you.

At 12/13/11 03:42 PM, Jon-86 wrote: Believe me I like python for my own stuff but to say PHP should be avoided is short sighted. Each language has its strengths and weaknesses.

You might like it but you are not showing any evidence that you are experienced in or knowledgeable of it.
And the irony in this sentence puts a pretty big smile on my face: "but to say PHP should be avoided is short sighted".

To say PHP shouldn't be avoided is short sighted and just shows how little experience you actually have with PHP.
Or shows that you're just a glutton for punishment.

At 12/13/11 03:42 PM, Jon-86 wrote: Development time, not execution time!

I already explained how developing Python is faster than developing PHP.

Response to Programming for beginners 2011-12-13 16:42:18


At 12/13/11 04:16 PM, Diki wrote: However: when you do real work on applications which actually matter then PHP is just going to bottleneck your efforts at every turn.

The biggest bottle neck is and always will be database I/O

Any decent IDE can be easily setup to write Python without any issue. If you cannot figure that out then programming is not for you.

See people will use what they want, we have developers and designers separate but we work on the same sites. Say I wrote something in Python and then a designer opens that in Dreamweaver or something to make a change and saves it. They will have their spacing setup different from mine, bingo codes fucked.

Its not about figuring it out its about making it possible for everyone to work on the same files without breaking them by saving.

You might like it but you are not showing any evidence that you are experienced in or knowledgeable of it.
And the irony in this sentence puts a pretty big smile on my face: "but to say PHP should be avoided is short sighted".

To say PHP shouldn't be avoided is short sighted and just shows how little experience you actually have with PHP.

Nope if you take advantage of one of the many established frameworks out their, and are aware of the pit-falls you can develop something web-based thats decent.

Some of the biggest sites out their are PHP driven, if the language was that bad those sites would have been crippled and would have had to have been reimplemented using another language. I know PHP can be frustrating, believe me I do but it gets the job done.


PHP Main :: C++ Main :: Java Main :: Vorsprung durch Technik

irc.freenode.net #ngprogramming

BBS Signature

Response to Programming for beginners 2011-12-13 17:30:12


At 12/13/11 04:42 PM, Jon-86 wrote: The biggest bottle neck is and always will be database I/O

While I agree with this, I don't see what that has to do with what I said.
If you develop serious applications to be used in the "real world" (i.e. not some silly hobby project or a personal website) then using PHP is only going to slow you down.

At 12/13/11 04:42 PM, Jon-86 wrote: Say I wrote something in Python and then a designer opens that in Dreamweaver or something to make a change and saves it.

Why would you have a designer modify Python code?
That is the job of a programmer.

At 12/13/11 04:42 PM, Jon-86 wrote: They will have their spacing setup different from mine, bingo codes fucked.

Hence why you communicate with your developers. Not just pass code around willy nilly on a wing and a prayer.
And if you know what you are doing you will be using some form of SubVersion, and this won't cause any problems anyways.

At 12/13/11 04:42 PM, Jon-86 wrote: Nope if you take advantage of one of the many established frameworks out their, and are aware of the pit-falls you can develop something web-based thats decent.

I never said PHP cannot create good applications.
There's virtually nothing that Python can create that PHP cannot.
Python just does it better. Drastically better.

At 12/13/11 04:42 PM, Jon-86 wrote: Some of the biggest sites out their are PHP driven

So? This has nothing to do with anything. Someone making the poor decision to use PHP doesn't equate to PHP being a good programming language.
By that logic Internet Explorer would be a good web browser. Which it obviously is not (excluding version 9).

And besides that's not even true. The biggest sites are written in Python, Ruby or utilise CGI).
Do you honestly believe websites such as OkCupid, Facebook, and Google are written in PHP?

Note: if you were referring to Newgrounds as one of the "biggest sites" then you need to realise two things:
- Newgrounds is not a big website relative to others that are on the Internet.
- Newgrounds is poorly coded (not so much as in recent years; at least now passwords are not stored in cookies as plaintext).

At 12/13/11 04:42 PM, Jon-86 wrote: if the language was that bad those sites would have been crippled and would have had to have been reimplemented using another language.

They do. Why do you think Facebook stopped using PHP after their surge of popularity?

At 12/13/11 04:42 PM, Jon-86 wrote: I know PHP can be frustrating, believe me I do but it gets the job done.

I never said it can't.
I said: it is more cumbersome, error-prone, and time consuming to write PHP.

Response to Programming for beginners 2011-12-14 20:36:04


At 12/13/11 05:30 PM, Diki wrote: blah blah blah php sucks [sic]
I never said it can't.
I said: it is more cumbersome, error-prone, and time consuming to write PHP.

Just for kicks, I took a look at your Rabid Tutorial 3, and from what I saw there, it has become evident to me that you aren't exactly qualified to be bashing PHP as a language - you barely know HTML.
Also, you might be interested in this quote from Facebook's HipHop blog post:

HipHop programmatically transforms your PHP source code into highly optimized C++ and then uses g++ to compile it. HipHop executes the source code in a semantically equivalent manner and sacrifices some rarely used features - such as eval() - in exchange for improved performance. HipHop includes a code transformer, a reimplementation of PHP's runtime system, and a rewrite of many common PHP Extensions to take advantage of these performance optimizations.

n/a

Response to Programming for beginners 2011-12-14 22:47:39


At 12/14/11 08:36 PM, ZiggyZack99 wrote: Just for kicks, I took a look at your Rabid Tutorial 3, and from what I saw there, it has become evident to me that you aren't exactly qualified to be bashing PHP as a language - you barely know HTML.

Perhaps for kicks you should have learnt how to read instead.
Notice that 4 digit number near the title? That "2004"?

So, please relish me the details of how fantastic a programmer you were seven years ago when you were 15 years old.

In short: you're a retard.

Response to Programming for beginners 2011-12-14 22:54:07


At 12/14/11 09:45 PM, polym wrote: I think the irony is that attributing Python as a 'beginner's' language is by people who already have programming experience.

I don't think you understand the purpose of learning languages like Python or Ruby as a first programming language.
It's not because the languages are "basic" or "for beginners". It's because they're easy to learn.

You need to learn how to program before you can program. Why would you spend your time learning a complex language, which will just make programming appear more difficult than it truly is?

That's the equivalent of learning Mandarin as your first foreign language.

At 12/14/11 09:45 PM, polym wrote: On the other hand, in C++, a beginner can know to include a certain header file that does what he wants to do.

No. The beginner will know that including the header file accomplishes the task required. They will not know why.
And they sure as hell aren't going to be able to grasp references, pointers, memory leaks, the pre-processor, linker errors, macros, meta-programming or polymorphism.

Hence why beginners should avoid C++ like the plague.

Response to Programming for beginners 2011-12-15 13:49:53


Python, Actionscript 3 (OOP, not stage), C#, Unityscript, UnrealScript, pick one. All depends on what you want to do with them.

Response to Programming for beginners 2011-12-15 14:28:55


FIrst programming language i learned was Pascal, LOL.


Speed Beast 2 ! <-- If you have a listen..leave a review.

PFTBD's AUDIO

BBS Signature

Response to Programming for beginners 2011-12-16 02:52:11


I am going to have to disagree with learning python first. Even though python is an easy language to learn, that's what's going to hurt you in the long run. Being so loosely typed and a lot of low level things being done for you, isn't teaching anything.

Learning C++ first will teach core concepts like memory management and how the stack processes code. Going from C++ to another language is very easy. But go from python to another language is harder because python holds your hand.

I'm not dissing python in the least since, became I'm a very avid pythonist and love the language. I will, however not recommend it being a first language. Learning C++ is not as hard as everyone is claiming. Most jobs relating to programming require you know C++ even if its not what you'll be coding in.

On another note, it would in the end, depend on what you plan on doing. For game dev, mobile dev, and general app dev, C++ will reign. If your wanting to do web stuff like web apps, server dev, web crawlers, and network dev python would be the way to go.

But if your not sure on which direction you want to go in, C++ is it.

Response to Programming for beginners 2011-12-16 09:43:51


At 12/16/11 02:52 AM, TechB wrote: Learning C++ first will teach core concepts like memory management and how the stack processes code.

You're advocating that someone learn how to run before they can walk.
That is incredibly counter-productive and will produce inept programmers.

At 12/16/11 02:52 AM, TechB wrote: But go from python to another language is harder because python holds your hand.

When you are learning this is a good thing.
Do you scoff at people who learn how to ride a bicycle using training wheels because it's impossible for it to tip over, and thus is "holding your hand"?

And going from Python to other languages is not more difficult. Python will actually teach a beginner programming theory so that they can grasp any other language. C++ will just teach them C++.

At 12/16/11 02:52 AM, TechB wrote: Learning C++ is not as hard as everyone is claiming. Most jobs relating to programming require you know C++ even if its not what you'll be coding in.

Most jobs do not require C++. There are so many different jobs in the field of programming that you cannot create this kind of generalisation.
There are a lot of jobs which you would be writing C++ for. There are also just as many where you will never write C++.

At 12/16/11 02:52 AM, TechB wrote: On another note, it would in the end, depend on what you plan on doing.

I do agree with this, but before that you should be basing your decision on how much experience you have with programming.
If you have little to none, and do not require C++ for your task, then there is no reason you should be writing it in C++.
Why would a beginner ever want to use a programming language that looks like this:

template <class Ty, int Val>
class Foo
{
public:
	typedef Ty* Pointer;
	typedef Ty& Reference;
protected:
	Ty _mData;
public:
	Foo(Ty);
    bool equals(Reference) const;
	Pointer get_ptr();
};

template <class Ty, int Val>
inline
Foo<Ty, Val>::Foo(Ty init)
: _mData(init)
{
	//
}

template <class Ty, int Val>
inline bool
Foo<Ty, Val>::equals(Reference val) const
{
	return _mData == val;
}

template <class Ty, int Val>
inline typename Foo<Ty, Val>::Pointer
Foo<Ty, Val>::get_ptr()
{
	return &_mData;
}

They will spend more time trying to understand how all of that works and what keywords such as inline and typename are doing (or why there is an ampersand next to the _mData member variable), instead of learning how to program.

Even something as simple as iterating through a container will confuse a beginner:

for(std::vector<int>::iterator itr = vec.begin(); itr != vec.end(); itr++)
{
    //
}

Then you have Python:

for val in mylist:
        //
At 12/16/11 02:52 AM, TechB wrote: But if your not sure on which direction you want to go in, C++ is it.

If you are not sure which direction to go you shouldn't be doing any programming.
Do you also start writing code before you have a design document (I certainly hope you don't)?

Response to Programming for beginners 2011-12-16 09:51:11


And do not forget that in C++ arrays cannot change size and can only contain one type.
Good luck getting a beginner to grasp that concept.

Response to Programming for beginners 2011-12-16 15:06:39


Going from python to C++ isn't going to help you understand pointers or arrays any better. They are going still be just as confused. They actually might be more confused because they are going to wonder why you can't append anything to an array that is set up like a list.

On the other hand going from C++ to python, they will understand everything before they write one line in python. On the note of ridding a bike, yeah if your 3 years old trying to learn, training wheels and python is what your going to do. If your 15 or older, your either not going to ride a bike at all or start without training wheels.

C++ isn't as bad as everyone is claiming and is only going to help you in the end. It's not like I'm suggesting you start.with ASM and the x86 architecture.

Response to Programming for beginners 2011-12-16 15:38:35


At 12/16/11 03:06 PM, TechB wrote: Going from python to C++ isn't going to help you understand pointers or arrays any better.

You mean learning one programming language won't teach you features unique to another language.
Colour me surprised.

At 12/16/11 03:06 PM, TechB wrote: They actually might be more confused because they are going to wonder why you can't append anything to an array that is set up like a list.

You don't understand the reason for learning Python before C++, and I'm not explaining it again. It's a very simple concept.

At 12/16/11 03:06 PM, TechB wrote: On the note of ridding a bike, yeah if your 3 years old trying to learn, training wheels and python is what your going to do. If your 15 or older, your either not going to ride a bike at all or start without training wheels.

You also don't understand how analogies work.

Response to Programming for beginners 2011-12-16 17:07:20


The only thing python will help in learning a new language is logic control and looping. That's it. And you've been coloured.

You don't need to explain anything because it was invalid in the first place.

That was also an invalid analogy, because someone will learn to ride a bike or code a program their own way despite any thing we tell them. C++, python, java, lisp, php it doesn't matter. If you want your hand being held then fine. If not then who cares anyway.

Response to Programming for beginners 2011-12-16 17:18:12


:At 12/16/11 03:38 PM, Diki wrote:

Programming for beginners


Speed Beast 2 ! <-- If you have a listen..leave a review.

PFTBD's AUDIO

BBS Signature

Response to Programming for beginners 2011-12-17 02:01:48


At 12/16/11 05:07 PM, TechB wrote: The only thing python will help in learning a new language is logic control and looping.

I can honestly say I haven't the faintest clue how you reached this conclusion.
Though, I am more than willing to learn how Python cannot teach polymorphism, inheritance, sorting algorithms, type checking, resource management, file i/o, socket programming, gui programming (tkinter), implementing callbacks, threading, or metaprogramming.

At 12/16/11 05:07 PM, TechB wrote: That was also an invalid analogy, because someone will learn to ride a bike or code a program their own way despite any thing we tell them. C++, python, java, lisp, php it doesn't matter. If you want your hand being held then fine. If not then who cares anyway.

It's like I'm talking to myself when I was 14 and had only been programming for a couple years.
Feel like I'm in the Twilight Zone.

At 12/16/11 05:18 PM, preffertobedead wrote:

Not sure if it's fair to compare me to Kanye West, but I like it. :)

Response to Programming for beginners 2011-12-17 05:18:30


Throwing in my two cents.

lots of good points above, but i didn't notice one that i will add. I think java is a great place to start learning because it uses memory management, which frees the programmer up to learn the more fundamental (and universal) aspects of programming. by that i mean the programmer can focus on learning flow control, functions, the nuts and bolts that make a language turing complete.

now before you say python does the same things, the one HUGE thing that python doesn't do, is look like other languages. Java looks like C/C++ if you squint, which is PERFECT when you are going from java to C/C++ to learn the more complicated and lower level aspects of programming.

Python is great, but it is just lacking in that it doesn't set you up for the feel of C/C++ as well as java does. and lets face it, you are most likely going to be writing C/C++ at some point in your career. I can't imagine getting hired without having C/C++ knowledge on my resume.

and of course, my first self taught language was BASIC. if you've got the motivation you can teach yourself any silly language. also, did anyone else notice the OP never coming back? unless i missed it


Fear Popo Bawa!!!

John Goodman | ¥

while(<>){chomp;print;}

Response to Programming for beginners 2011-12-17 05:39:36


@Diki:

I come mostly from an embedded background. So I wouldn't expect someone coming from a high-level to know or even understand the importance of actually knowing how memory and the CPU stack handles code.

So I'll drop the flames and let you get back to holding hands, while I get back to bit twidling.

Response to Programming for beginners 2011-12-17 11:25:38


At 12/14/11 10:54 PM, Diki wrote: That's the equivalent of learning Mandarin as your first foreign language.

lolz

I read all the posts in this page, and I'd like to know what people think about C++ being better than C#. What do ya think, is C++ > C# and why.

Response to Programming for beginners 2011-12-17 18:36:03


At 12/17/11 11:25 AM, NinoGrounds wrote: I read all the posts in this page, and I'd like to know what people think about C++ being better than C#. What do ya think, is C++ > C# and why.

I wouldn't say one is better than the other. Really depends on what you want to do.
Say, for example, you want to make something that is heavily UI based, but not so much performance based, C# would probably be a better choice. GUI programming in C# is a lot simpler than in C++.

Response to Programming for beginners 2011-12-17 22:40:03


At 12/17/11 06:36 PM, Diki wrote:
At 12/17/11 11:25 AM, NinoGrounds wrote: I read all the posts in this page, and I'd like to know what people think about C++ being better than C#. What do ya think, is C++ > C# and why.
I wouldn't say one is better than the other. Really depends on what you want to do.
Say, for example, you want to make something that is heavily UI based, but not so much performance based, C# would probably be a better choice. GUI programming in C# is a lot simpler than in C++.

I agree. To extend a little, C# is what xbox uses along with XNA. C# is Microsofts attempt at Java. The only thing I don't care for C# is its owned by Microsoft. I don't have anything against .NET, just not my cup-o-tea.

Response to Programming for beginners 2011-12-18 06:34:28


At 12/17/11 10:40 PM, TechB wrote: I agree. To extend a little, C# is what xbox uses along with XNA. C# is Microsofts attempt at Java. The only thing I don't care for C# is its owned by Microsoft. I don't have anything against .NET, just not my cup-o-tea.

XNA is horrible, it only allows you to make XBox games with very crappy PC support. And they won't be listed with the arcade games, they'll be listed with the indie games which aren't even available in most countries.