Want to learn a language

I want to learn to code, but I can't decide between Java, or C#/C++ (whatever is best).

Can anybody help me out here?

Also, what sites/books are good for learning this stuff?

Strawpoll (for fags): 11921655

Learn C. That way you'll already know the rest.

Skip C++, go to Java. It's more elegant.

Python is only for the gay. So is Go.

Learn c. The book written from the creator of c is free to download.

Java, since its the most likely one to get you employed then you can fork into another language.

Lean C, then you can learn the basics of just about every language

like what is a variable, what is a type, what is a control structure look like, what does a loop do?

In C, that's basically all you have, so it's easy to mess around with those concepts. Where as something like Java you have objects and classes and a bunch of horseshit you're not going to understand, but are forced to use.

Aspects of Java will be a mystery without learning C first.

>using printf over puts to print an unformatted string with a newline at the end

some fairly important concepts will fly over your head if you don't learn C first, especially how memory is laid out and managed by programs

Learn Python, then C if you want fundamentals, then Java or C# for employment opportunities.

Actually LEARNING TO PROGRAM is going to be millions of times harder than dicking around asking what language you should pic, so just fucking pick one and get on with it.

...

>pointing that out instead of the fact that the printf format argument should never be the only argument

printf("%s", "Hello, World!\n");

> Python

Lua is more friendly for beginners

Zuckerberg is making a suggestion for a small child.

From the languages OP asked about, C# is the most modern full developed and noob friendly and will teach him the object oriented stuff he needs to know.

Not really, for a first timer java is easier to grasp alot of courses teach java first too.

Python is an extremely popular language that is also very easy to learn. Like Perl, there are a ridiculous number of packages available for it. You can use it as a starter language, and you can also get a fair number of jobs in the real world using it as a back-end language.

LOGO is more user friendly than either, but nobody is going to suggest learning it in 2016.

>not knowing that the compiler optimizes it to puts anyway

> Learning concepts through commercial languages.

He should learn OOP through a pure language like Smalltalk or Eiffel.

Javascript is probably the best for beginners.

It isn't about jobs or popularity senpai, but just learn the basic concepts. Lua is far more simple than python.

if gay = 58096354:
print("ssssssssss")

I learned C# (basically Java + portability issues) as my first language in university, and my experience was as described by:
C is a nice first language because it's like 'how computers work' the language.

C# is a patent trap on linux and android

To kill themselves

Sure.

>using printf instead of fprintf(stdout, ...)
>not just using fprintf for everything because it's most consistent
>wanting an implicit newline

>C#
it's Java with a few random features that aren't particularly important. Just use Java.

1. There is more production grade open-source code written in C than any other language.

2. C is the basis for hundreds of syntaxes

3. C is both fundamentally simple, yet ultimately powerful.

4. C can be used medium-level OR low-level

5. C teaches hardware level concepts that produce better algorithms & explain other languages' choices.

6. C does not include OOP, but does have structs, so is simpler to learn yet segues into higher level languages on solid principles.

This isn't a "what's the greatest programming langauge" thread.

It's just modern, easy to learn, "Java done right".

The standard library is excellent, LINQ is great, plenty of modern features.

Why are you advocating that people waste their time?

Python is:

* Extremely popular.
* Simple. If you find Python too hard then you shouldn't be programming, period.
* Very well supported as a starter language.
* Likely to be a reasonably popular language for various tools and back-ends for the rest of the developer's career.

There is no reason NOT to start with Python, other than your subjective, idealistic fetish for Lua.

Why should I learn C over C++?

1. Sit down and show someone Hello World in C and let me know how that goes.

C is better than C++ for beginners, but it's still a TON of magic until they get reasonably far in. printf is like a wizard's incantation for beginners.

Learn C first, go from there. I made the mistake of learning python first and now it's taking far too much time to understand things like pointers.

>Why should I learn C over C++?
1. It's more complicated than C
2. Some people think C++ is bad.
3. Few projects use it anymore, Java is a better OOP.
4. Operator overloading isn't transferable

In general, C++ will just lead you astray as a beginner. Learn C, then Java, and C++ will be easy when you hafta.

Judging by the replies, Python first, then C, then Java?

Or does it even matter?

if youre serious about programming for the rest of your career/life then honestly just start with C.

Starting with Python is like learning how to drive an automatic, C is like learning to drive a stick,

>C is the basis for hundreds of syntaxes
you'll just learn the C syntax from the other languages, if you don't learn C.

>C is both fundamentally simple, yet ultimately powerful.
You can say this about most languages. Turing completeness aside, I find vtables and some other features that C++ added to be more annoying to work with in C.

>C can be used medium-level OR low-level
this is meaningless

>C does not include OOP
C includes OOP. You can easily implement inheritance, you can easily implement vtables, as well as most of the other features C++ added. It's just a little uglier in C, in most cases; especially templates.

All of this being said, I hate working with C++, so it's an enternal struggle to choose C++, despite how much it makes me angry and to choose C, despite how much extra work I need to do in a few cases.

I think you best take java. All that crap about really understanding "computers" is nonsense. Then you beter learn physics or assembly or turing machines etc.

Java has extremely nice IDE'S and enormous amounts of beginner stuff online. You can learn prgrammig it without the oop stuff and gradually progress.

#include

int main(void)
{
std::cout

What should I learn if I'm more focused in making something functional? I was planning on learning C++, since I kinda blundered my way around C#. I need to properly sit down and learn a full language instead of dissecting and stringing together code examples.

Not necessarily hung up on oop, too

why are people still pretending Python 3 doesnt exist

>Eiffel
would be the worst language to learn OOP because it allows covariant input parameters/arguments

That image is shit and shows that its creator has never actually written in C. First what the fuck is "char ** argv" the proper statement is "char *argv[]". Second where the fuck is their return statement, you should end that shit with a "return 0;" for fucks sake. This image was clearly made by a retarded 12 year old who thinks python is the BEST EVAr because it's the only language he's ever written in.

>Starting with Python is like learning how to drive an automatic, C is like learning to drive a stick,

And it's better to learn on an automatic, where you can focus on learning how to *drive a car* and *not hit things* instead of worrying about clutch modulation and gear selection.

You can learn to drive stick after you've learned the more important parts of *driving a car*.

So what should I learn if I want to make something functional? Am

#include
main()
{
printf("Hello, World!");
}


That is a solid fundamental starting point for functions, statements, and dependencies right there. Next is variables, then arguments, then control flow, then return values.

>C++ is missing a lot of nice C features
>C++ has some of the most confusing traps of any programming language
>C++ has the most horrific linker errors in existence

For example, if you have struct foo : bar. struct bar does not have a virtual destructor specified, but does have virtual functions. If you delete foo as an instance of bar, you'll get a sigsegv with some compilers. A beginner is not going to have a good time with that.

>those quads

stop being autistic and learn JavaScript

>implicitly declaring main as an int (illegal as of C99)
>declaring main with unspecified parameters (specified as deprecated as of at least C99)
>not putting a newline at the end of printf

> I'm more focused in making something functional?

I strongly recommend against C++

I'd go C first, then Java.

For "something functional" that's a really fun way to learn, write a game!


1. Keep your 'map' in a 2D array of bytes
2. Draw your map on the screen
3. Write a loop to animate the screen w/ a delay
4. Catch keyboard events to control your player
(use the smiley character ASCII 02)
5. Save & load maps to/from files
6. Sound effects
7. Moving AI mobs
8. Shooting a gun

After that you either pick a web language or learn Assembly to achieve godhood.

> He went full retard mode.

lulz.
Ok user, use python instead.

C++ doesn't really have any place.

In your dreams.

you're right, that was hurried copypasta, and terrible code. the points you made are all very good things to learn early, which supports the argument. here's your complaints fixed:

#include

int main(void)
{
printf("Hello, World!\n");
return 0;
}

>C
K&R, the one and only

>Java
Objects First With Java - A Practical Introduction Using BlueJ

>C++
Whatever, once you learn C and Java it will be a breeze, stick to a subset of C++ and treat it as C with classes and easier string handling

>C#
It's shit and dead, don't bother with corporate Microsoft trash

fun fact: C implicitly returns EXIT_SUCCESS at the closing brace of main. I think it also implicitly translates 0 to EXIT_SUCCESS on some extremely obscure systems where 0 != EXIT_SUCCESS. OpenVMS is an example of this.

IMO, one of the best reasons to learn C is because you get to know so much random trivia about ancient computer systems.

HOLD EVERYTHING.

You need to learn Brainfuck before you do anything else.

++++++++++[>+++++++>++++++++++>+++>+.

Literally why?

How with your way you would write
printf("variable x has value of %d\n", x);


Why write more and stick to an imaginary correctness when the compiler will spit out the exact same assembly?

printf("%s", "Hello, World!\n");
Will not produce the same assembly as
printf("Hello, World!\n");

Without some really special-case optimization.

imo, the best reason to learn C is pointers.
really.

What's the best OOP language? I'm hearing Java and C#

>C#
>modern
>"Java done right"
>standard library is excellent
>LINQ is great
>plenty of modern features

Nice shilling you got there

What's C# success?

15 years after the introduction of C# and .NET Windows Explorer is still on Win32 and has not been rewritten in .NET because it's so shit

Windows is still mostly Win32 and C++ as most good applications on Windows

ATI/AMD Catalyst Driver frontend was written in .NET and it was shit and slow, now with Radeon Crimson AMD is dropping .NET because is bloated and slower than Java and even many interpreted languages

Silverlight is dead, XPS (Microsoft's replacement for PDF) was misguided and dead, the Metro/Modern/UWA are not using .NET and C#, Windows phones is not using .NET and C# and is dead too

The only moderate success with C# is Paint.NET and even this is worse than Gimp and much less powerfull

C# and .NET is a failure of epic proportions

This guy is right.

C
Java
Assembly
Reprogram the robot overlords thus saving humanity

>image implies that less code to produce a "Hello, World" program is a sign of a superior programming language

Well then, that means my hypothetical "Hello, World"-lang is the best programming language because in "Hello, World"-lang everything compiles to "Hello, World", even an empty code file.

I can guarantee you that there exists some esoteric language where you can do hello world with a single letter. There is one where you can do fizzbuzz with the letter f.

Nope, you are full of shit
$ cat foo.c
#include
int main()
{
printf("hello world\n");
return 0;
}

$ cat bar.c
#include
int main()
{
printf("%s", "hello world\n");
return 0;
}

$ gcc -S foo.c

$ gcc -S bar.c

$ diff foo.s bar.s
1c1
< .file "foo.c"
---
> .file "bar.c"

Start with Python as an introduction to basic computer programming concepts. Then go to C for a deeper understanding of what is actually happening beneath the surface.

rekt

>Strawpoll (for fags): 11921655
just post the strawpoll you ugly faggeth

>Without some really special-case optimization.

>unspecified parameters
"C++ is totally a superset of C" programmer detected.

Okay, nice post, but I just refer you back to here:

>This isn't a "what's the greatest programming langauge" thread.

He's trying to learn to program, not write an operating system kernel or Microsoft Office killing app.

Whatever, hear is the output of clang
$ clang -S foo.c

$ clang -S bar.c

$ diff foo.s bar.s
2c2
< .file "foo.c"
---
> .file "bar.c"
18a19
> movabsq $.L.str1, %rsi
34a36,40
> .asciz "%s"
> .size .L.str, 3
>
> .type .L.str1,@object # @.str1
> .L.str1:
36c42
< .size .L.str, 13
---
> .size .L.str1, 13


Your form has more instructions so it's shit and you write more stuff

try turning on optimization

It's all same shit, you can start your learning from fucking pascal and you'll still end up in same place.

C# will be easier to understand, c++ will teach you real memory management and bring many problems with that. But in the end, for your beginner level, literally anything that allows you to build bunch of loops and ifs will do. The choice you're trying to make has no significance at all, at least right now.

We must protect newbies from MS shills

C for low level stuff and understanding how a computer works and dealing with pointers and implementing many interesting structures and algorithms

Java for the most elegant and complete expression of OOP concepts and with an extremely rich, mature and cross platform since inception standard library plus many commercial applications and successes (eg android)

Python for quick solutions and solving problems in a few lines (though I don't believe it's particularly good for a beginner because it's very different than the rest and a beginner may be trapped in python's way)

Haskell for an elegant introduction to functional programming and extending your programming horizons

Other languages are good too

Except C#, C# and .NET belongs in the trash and it's an evolutionary dead end and a patent trap

>Your form has more instructions

my form was foo.c

>so it's

you're not seriously about to make a fool of yourself are --

>shit and you write more stuff

-- how many wait states does indirect relative addressing take?

(despite the fact that foo.c was my form)

"number of instructions" is not how you judge an algo. fyi.

what you do, is
1. optimize I/O
2. pay attention
3. quit gnashing at everything that moves
4. get a girl since you're so nice

>this much damage control

>my form was foo.c
your form was bar.c I will continue to use the foo.c form as K&R says and as K&R explains in the variadic arguments chapter. I'm sure he knows better than you.

That wasn't my post.

Then I wasn't answering to you, so why are we arguing?

Because you claimed that parsing %s and interpolating a string would compile to the same code as not parsing %s and not interpolating a string if you didn't use optimizations, which was false.

You then proceeded to use optimizations to support your fallacy and subsequently turned into a dick on the basis of an assumption toward someone who actually can write Assembly.

So, we argued a bit and I chuckled.

Learn Haskell. It's a meme but it's also the only road to salvation.

My original objection was about the bar.c form because it's less obvious, more verbose, unlike anything taught in any book and (as you say and I trust your assembly knowledge and gcc proves) it doesn't make a difference once you enable optimizations

So I don't think there is a disagreement between us

I'm glad you chuckled though :^)

OP has no idea what he's getting into. :^)

Side note: What happened here today was a fucking miracle. it just optimized that shit right away. *poof* GCC just clown'in all over us and shit.

There are serveral ways. In the end it doesn't really matter. But some routes you might take:

>start with C

+
C is a "small" language, it doesn't have many features. You can learn the basics in 1-2 month. It is also very good to know C, even if you don't use it afterwards.

-
It is pretty anal about something. Even some basic tasks (read in two numbers, add them, return result) does already touch some intermediate concepts. So the first few weeks might feel pretty difficult: You have to manage your own memory, you have to get the difference between compiler and linker, you have header files, you have to write makefiles.. It's only a few things, but each of them is a little bit tricky. Once you mastered some fundamentals, you're halfway there, but for a beginner it can be frustrating.

tl;dr:
Start with C if you have enough motivation to not get frustrated the first two weeks. It's good to know C and it's not really hard, but especially for beginners it has some pitfalls.


>start with Java

+
Java protects you from a lot of trouble you have in C. It is easier to "get results". The learning curve starts somehow softer.

-
Java is a big language. There are many features and concepts than can be irritating, since they are made for large scale software development. They are not difficult, but a lot of things will feel unnecessary for a long long time. Most features only make sense if you are a pro-programmer.

tl;dr:
Not frustrating in the beginning, but it will take much longer until you really understood the language. Java is very "explicit" you write a lot of code that seems verbose in the beginning.


>C#

Basically the same as Java. If you know Java, you know 90% of C# (and vice versa). So learn Java and change to C# when you are an experienced Java programmer.


>C++

If you want C++, learn C for at least 1-2 month. If you really like C, then take a look at C++. But be aware that C++ is a really big and complex language. It takes some time to learn.

Any compiler would optimize that to puts anyway.

>Comparing a structured, a generic and a script language
gj m80

>You have to manage your own memory
This won't be much of an issue learning the basics since you'll statically allocate test cases, and understanding this one thing becomes a big asset when you go pro.

It can't be stated strongly enough that C is the foundation of most other productive languages.

"Not using C" at all is unlikely. Even if it helps you debug a broken make build on your linux box, it's worth knowing.

Agree with what you said about Java, except OOP shouldn't be thrown in on a first language; for many purposes its detrimental, and superfluous to learning.

I wouldn't change to C# ever. Strong case for it being DoA.

C++, if you really like C, yeah, okay. That's fair. But a lot of people rightfully consider C++ harmful. (I don't, I'd say it's the closest to 'complete' of all the production languages; you're right, it's big.)

Apparently GCC parses printf formats and pre-interpolates string literals too!

While it is retarded to think you can only learn one language and you should learn the same language independently of what field you will be using it in, I would say C++.

You can learn high level and low level stuff depending on what you want.
It is much better than C as it has more built in features and you can get very far with just the STL.
It is easier to read than Java because you can use mathematical operations instead f writing the names of the functions.

The only disadvantage is you have to compile it.

that just proves that pythons main purpose is print "Hello World" like a newbie language it is

>Skip C++, go to Java. It's more elegant.
found the pajeet

SCHEME

or at the very least, c. Get acquainted with the gdb

if you are white and know java you will be employed over a disorganized clueless panjeet

#include

using namespace std;

int main(void)
{
cout

>a lot of people rightfully consider C++ harmful
In what way?

Smalltalk

A lot of people are mentally retarded.

I personally learned Java before C, and I think it's better that way. There are a lot of concepts in C that might be hard for newbies to grasp(ex: Java has a garbage collector, array limits, strong types, no pointers, overall easier to start with). C though is really good in that it's "close to the metal". It actually translates directly into assembly, while Java is translated into an intermediate language that gets interpreted by a special program.

While C has a lot of horrible traps, C++ makes C look like babbies first programming language. There is so much random shit that can go wrong, as well as so many stupid useless language features that shouldn't exist.

If you program C++ is a specific way, it can be fine, but there's a lot you have to be careful of.

My question is how do we actually start to learn. How can I practice?

x86 Assembly