[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Stop telling newfags asking what programming language should
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 63
Thread images: 9
File: 1392663512389.jpg (315 KB, 800x1100) Image search: [Google]
1392663512389.jpg
315 KB, 800x1100
Stop telling newfags asking what programming language should they learn first, to learn C.

Seriously, stop that shit.

It's not funny.
>>
It's the best first programming language
>>
>>52692238
Everyone should learn it at some point, because its important to understand how the machine actually works, but it's better as a second or third language, once they have actually gotten the taste for programming.
>>
File: 546b4222d7f5f_-_917-h9qydx-lg.jpg (85 KB, 1280x720) Image search: [Google]
546b4222d7f5f_-_917-h9qydx-lg.jpg
85 KB, 1280x720
>C++
>Audi
>not superior Porsche

Audis are pants in head retarded yuppie cars
>timing belt on the back of the engine
>front end and engine need to all be removed for a simple 90k service
>>
>>52692238
What is the Tesla?
>>
>>52692538
javascript
>>
>>52692538
node.js ;^)
>>
>>52692538
Scratch
>>
No. A beginner who is serious about learning programming should learn C.

In terms of syntax, it's fairly simple. There is no object-oriented nonsense to explain just to explain how Hello World works. Nor is there a large number of keywords, or a large amount of sugar syntax that may make beginners confused as to what the meaning of a particular statement does. It's not the simplest language, but it's simple enough.

In terms of benefits to the beginner, however, C is more attractive. C does not do a lot to hide what a machine is doing from the programmer. While one is not explicitly calling machine instructions, one does end up getting a general sense of how various operations move data around in memory. This becomes important to know when programming in higher level languages, particularly where optimization is concerned. It is difficult to make software more efficient if you don't know how the methods one is using are working. A C programmer, when writing Python, Ruby, Java, or similar languages, is capable of looking into the source code of the VMs for these languages, and seeing how various methods are implemented. This is good both because it enables them to use those methods more efficiently, but also because it encourages curiosity. A good programmer should often be questioning "how does this work?" when presented with a useful tool.

And if neither of these convince you, just remember that it makes it so people who can't grok C give up and find another profession quicker.
>>
>>52692238
What I don't understand is why someone would "learn C". Why not just learn C++? I learned C++ first and when I found myself with a C compiler written for a microcontroller I had zero problems. It took me five minutes to figure out oh I can't use classes anymore. Everything else is the same.
>>
>>52692238
Why would anyone bother learning a language instead of using a tool like Gamemaker?
>>
Beginners should learn machine code
>>
>>52692562
>Everything else is the same
No it isn't. C++ has namespaces, whereas C does not, but makes clearer distinctions between named special constructions.

Also, C++ is an overly complex language by almost any standards. It manages to have all of the complexity of something like java, without the nice safety features. It's incredibly powerful if you truly know what you are doing, but it sure as fuck isn't the language to learn about for loops on.
>>
>>52692238
>C++
>not a mustang with dildos and blenders taped to it
Hahaha no
Also, C is objectively the best starter language to learn if you're seriously about learning. Not some shitty toy language like Python.
>>
>>52692589
i386 assembly is actually kinda nice
>>
File: 1453711140113.jpg (92 KB, 500x375) Image search: [Google]
1453711140113.jpg
92 KB, 500x375
>>52692238
C is a god tier language faggot
>>
>>52692562

Try explaining to someone what cout is without explaining what an object is, what a template is, and what an overloaded operator is. Much easier to explain that printf is a function with side effects.
>>
>>52692238
You're right. They should learn Haskell.
>>
>>52692238
Newfag to programming.

So Python is fun as fuck, just not taken seriously?
>>
>>52692238

No this is C++
>>
>>52692615
>objectively

Guess how I know you're a retard
>>
>>52692753
No, it's shit, boring and not taken seriously
>>
>>52692764
Objectively is the right word to use when you're right
>>
C++ is a trash language with trash libraries where trash programmers can create a clusterfuck of trash code that has zero established standards.
>>
>>52692615

>Also, C is objectively the best starter language to learn if you're seriously about learning.

Naah, C is good if you want to be close to the harwdare.
C sucks for building abstractions.
If you start with C you can cripple yourself by thinking in C when using HLLs.
>>
>>52692899
Nah, you need to understand how everything works down at the machine level so you don't get too lost in abstractions. Stuff like list comprehensions and generator expressions are great and all, but you need to be comfortable doing the same stuff on a bare array
>>
>>52692938
>2016
>Still being a human compiler
>>
>>52692978
At least I have a mechanical dick
>>
>>52692659
You don't explain cout to a beginner by going in to what an object, template, or overloaded operator is. You show someone how to use it. Any book on C++ aimed at beginners is going to say something like

cout << "Hello world." << endl;

cout represents the console output. You send stuff to it using "<<". "Hello world." is a string and endl is like hitting enter. We'll show you how strings are represented a little later. When you show them variables you show them how you can send any variable to cout. You show them how to format cout.

Then later when you're ready to learn to make your own classes you learn what an object is. Once you learn that you learn how too overload operators. There's no point in worrying about overloading << when you can't create your own types yet anyway. Once they know how to overload operators and use templates you realize, "Oh hey that's what they already did with the built in types and that's how they get that functionality."

I could teach a 10 year old how to use cout like a boss in 2 hours. If wasn't easier to use cout than printf, then they wouldn't have invented cout. printf is available to the C++ programmer and to the teacher of C++. So if you really don't know how to teach cout, printf is still there.

Also an operator is a function and << is a function with side effects. It's easier to teach x + y than it is to teach add(x,y).

>>52692607
>No it isn't. C++ has namespaces
Okay there are other differences, I admit to being hyperbolic. The thing is namespaces aren't taught to the beginner. They'll be shown how to use the statement using namespace std. Same with constructors.

>but it sure as fuck isn't the language to learn about for loops on.

Writing a for loop in C++ isn't any harder than any other language. The thing is you don't have to know how everything works before you can use C++. The thing is that once you learn the simple parts of C++ that knowledge applies to the more complicated stuff.
>>
>>52692238
Add a Reliant Robin in there somewhere.
>>
>>52692753
It's considered a toy software to have fun scripts and to entertain kids.

It's extremelly usefull as scripting language.

I have heard C+python is the master race combination.
>>
File: HA.png (13 KB, 480x323) Image search: [Google]
HA.png
13 KB, 480x323
>dat python

fits so damn well. what a joke of a programming language
>>
File: Toppest kek.gif (1 MB, 200x200) Image search: [Google]
Toppest kek.gif
1 MB, 200x200
>>52692762
You're right. Its just bloatware.
>>
File: delorean[1].jpg (303 KB, 2000x1236) Image search: [Google]
delorean[1].jpg
303 KB, 2000x1236
Lisp
>>
>>52693018

>You don't explain cout to a beginner by going in to what an object, template, or overloaded operator is. You show someone how to use it

And thus you have answered their question of what it does, and not how or why it does it. Beginners should not need to be told "I'll tell you what all of these mean and how they work later."
>>
So you want to learn programming?

You will need to pick a starting language. You will learn more later, but for beginners, there are generally two recommended "programming families" that you can choose to start learning:
-Dynamic programming languages, such as: Python, Perl, Ruby, Lisp
-Structured programming languages, such as: C, C++, Java, C#

These are amongst the most popular languages in use worldwide, including 4 from the top 5. Both approaches are perfectly fine, and well-documented.
-Dynamic programming may be a bit more suitable for those who need their programs to do heavy mathematics, and thus it is more popular in academia.
-Structured programming is a bit more suited for making general applications, and thus it is more popular in industries.
If you cannot decide, flip a coin.

If you choose dynamic programming, you may want to start with Python. It is very easy to pick up. Here are some good sources:
http://www.learnpython.org/
http://learnpythonthehardway.org/book/
http://www.codecademy.com/en/tracks/python

If you choose structured programming, you may want to start with C or C++. C is very well documented, and C++ is generally "C, with a few extra concepts added". Sources:
For C:
http://www.cprogramming.com/tutorial/c-tutorial.html
http://c.learncodethehardway.org/book/
http://www.learn-c.org/

For C++:
http://www.learncpp.com/
http://www.cplusplus.com/doc/tutorial/
http://www.cprogramming.com/tutorial/c++-tutorial.html

>BUT I WANT MORE SOURCES!
Read: https://wiki.installgentoo.com/index.php?title=Programming_Books

>BUT I WANNA START WITH [LANGUAGE X] INSTEAD!
Sure, if you like. But the languages shown above are considered very good for beginners.

>BUT I WANNA MAKE iPHONE GAMES!
Learn Objective C.

>BUT I WANNA MAKE ANDROID GAMES!
Learn Java.

>BUT I WANNA MAKE A COOL WEBSITE!
Learn HTML, CSS, and Javascript.

>BUT I WANNA MAKE PC GAMES!
Learn patience.
>>
>>52693111
>You're right. Its just bloatware.

More like an incoherent mess.
C++ can be very useful.
Still not a very elegant language.
>>
>>52693111
>Programming language
>Bloatware
Are you, by any chance, a winbabby?
>>
op is clearly frustrated.

go back to python you fuckboi.
>>
>>52692531
Bullshit they should learn assembly if that's your argument
>>
>>52692532
Wrong again, should be a Volkswagen.
>>
>>52692762
C++ is great for projects where you're the only developer. The amount of features in the language makes it hard for other people to know your code as well as you.
>>
>>52693124
>Beginners should not need to be told "I'll tell you what all of these mean and how they work later."

You do this no matter what language you teach. What you need to do is create a model in the beginner's brain that accurately predicts what a language will do. When you teach a beginner to output variables you teach

unsigned int number = 1;

cout << number << endl;
number = 2;
cout << number << endl;

You tell the beginner an unsigned integer can store integers greater than zero. You tell them the assignment operator stores stuff in a variable. You tell them you send it to cout with <<.

Even if you teach printf you still have that element of I'll show you later. You don't show how printf actually converts everything to a string by doing conversion to base 10(oh but only if you don't use the binary,octal,or hex functionality), then doing an ASCII table lookup and then calls on the operating system, usually through an interrupt, to send that data to the emulation of a console that exists as a window in the OS.

In fact teaching all of that right away defeats the purpose of a HLL. cout and printf are supposed to be OS independent. What exactly happens when you call printf or cout.<< depends entirely on how the language was implemented on your platform. The purpose of HLLs is abstraction. A programmer needs an abstract model of what the << function or the printf function does. An abstract model necessitates "there's more to it than this, but here's what you need to know." The truth is << is a simpler model. That's why cout was created. what makes C++ unique as a teaching language is if the student wants to know more you can teach them to build null terminate strings a byte at a time. You can teach them to use printf to do the same thing. Hell if you want you can stick in some inline assembly, do the base 2 to base 10 conversion, create an ascii lookup, and call the software interrupt. But you don't have to so it doesn't get in the way.
>>
>>52693463
Someone said that you only have to use the safe subset of C++.
The problem is that every programmer has a different subset.
>>
>>52693236
So throw in some inline assembly, and have them try writing linker scripts by hand.
All c is is a slightly higher level shorthand for assembly.
>>
>>52693463
>makes it hard for other people to know your code as well as you.

I seem to have that problem no matter what language I use. I cut my teeth on an ancient version of Pascal. I was in a high school class and I was one of about three people with a natural coding ability in a class of 25. So that means I got a couple weeks worth of work done in a day or two. That meant everybody came to me when they needed their code debugged.

I found it 100 times harder to debug someone elses code than my own. Looking at someone elses code was like reading code in a language I didn't know but could figure out what was going on if I thought about it.

In python I have the same problem. In C++ it's way worse because there are so many ways to do something. Like you can divide by 2 or shift to the right by one bit. But is that person shifting bits as a division by a power of two or are they setting up a bit mask? I knew better than to try with assembly. Fuck that shit. I even find myself going crosseyed when I look at someone elses code in a *.m file in GNU Octave. It was a simple and straightforward piece of code and I had to concentrate very hard.

I don't know if it is something I would get better at if I worked a job where I regularly looked at people's code and had to edit it. As a student who helped other students, a hobbyist, and user of open source software that looks at the source every once in a while I find the process baffling.
>>
>>52693127
This
>>
>>52693560
Nah i mean a whole course on assembly/micro architecture. Let them use something like MIPS and make them understand how it effects the hardware.
>>
>>52692238
>std::list pop_front and back remove item and return nothing
>need to get the elements before popping
my fucking sides

>>52692532
>C++
>not being a russian fighter with no translated manual
>>
>>52693785
>not being a russian fighter which is actually a copy of an american fighter made from stolen blueprints with intentional errors thrown into them
>>
requesting ganoo/car pic.
>>
>>52693646
Make friends who don't code like shit. 90% of programmers suck donkey cock, and luckily for you, you seem to be in the 10%. don't waste your talent with other ppl's shit code.
>>
File: F1FjJ[1].jpg (68 KB, 500x367) Image search: [Google]
F1FjJ[1].jpg
68 KB, 500x367
>>52693857
Classic
>>
>>52693842
>not beeng the 20 thousand soyuz missions that always blew up
>>
>>52692238
Honestly, it's a really good beginner's language. I feel that objects and classes muddle things up a lot and people should learn where the structures come from first. C is elegant and fast, and pretty easy to learn and grasp the syntax. It's really nice to aid people in knowing the tricks of imperative, procedural languages and gives people a lot of oversight over what happens in a class from pointers. There aren't too many annoying libraries in the way either, but it's easy to link one or implement it yourself. Either way, C is great for learning, and decent in practice.

There are reasons to dislike C, but they definitely don't come from ease of use, speed, or versatility. C is old, so a lot of code is pretty legacy and not really attuned for multithreading, although it gets better everyday. C lacks a lot of support for abstract libraries as writing structs are becoming the norm for massive monolithic routines. C is still, in the 21st century, woefully difficult to debug, even with lldb, let alone gdb, which gives little insight on code breakages. However, if there's any language to learn first, it's C. With it, you're granted knowledge of basically any procedural and structural langauge in existence. Knowing it hardly makes you a wizard; honestly, C and LISP are babby's first languages.
>>
PHP
>>
>>52694063
php is not a toy for newbies
>>
>>52692538
getting recalled again
>>
>>52692769
Except it's taken very seriously in scientific computing, data analytics, I.T. security, and Web application development. The python is a meme thing is a meme.
>>
I think C is a good language to learn but not first. It gives a good pathway to learning assembly and hence how a cpu works. I believe it is good to have an understanding of the base working of the computer.
>>
>>52693510
why are you wasting posts this high-quality on /g/?
>>
>>52692238
What does haskell look like
>>
C makes the most sense as a first language. It isn't any different than learning math the hard way first before learning all the shortcuts and easy ways. You have to understand the underlying functionality before it is all handled for you.
Thread replies: 63
Thread images: 9

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.