[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 471 KB, 1280x1024, CODE____C.jpg [View same] [iqdb] [saucenao] [google]
5396911 No.5396911 [Reply] [Original]

Hey /sci/, /g/ is asleep so I'll try my luck here

I really want to learn programming. I'll be taking intro compsci courses at a university while self-studying. I want to commit 4 hours a day for the self-studying, and this is a realistic goal (I spent 4 hours a day last semester self-studying chemistry). I'll also spend a couple of hours at the evening/night playing around with cool/funny coding exercises etc

>Where to start?

>What language to learn first
I've heard C is the way to go, and then learn C++, Java, Python etc

>General advice?

Help me excel!

I've bought the following supplement books:

- C Programming language (Brian W. Kernighan and Dennis M. Ritchie)
- C Primer Plus 5th Edition (Stephen Prata)
- C All-in-One Desk Reference For Dummies (Dan Gookin)
- Code Complete: A Practical Handbook of Software Construction, Second Edition (Steve McConnel)

And also related:

- Gödel, Escher, Bach: An Eternal Golden Braid (Hofstadter)


I'd like to learn several programming languages, and then later on choose a career/path.

>> No.5396915

Java

>> No.5396950

>>5396915

Please elaborate

>> No.5396961

read the books, solve algorithmic problems (try spoj, icpc live archive, codeforces, uva, etc...), learn new algorithms and data structures as you need them
or
read the books, establish a program as a goal, write it, repeat

also

learn C first. Then, if you like, start using C++ (or any other language) as you start understanding what it's doing behind the curtains

>> No.5396981

Kernighan and Ritchie is the gold standard for C texts, but it may not be appropriate if you have no programming experience at all. It won't explicitly teach you good coding style. The O'Reily "Head First X" series does a good job, however stupid they may look. Though reading it may make you feel dumber, it will make you smarter.

As far as what language to learn first:
It depends on what you want to do and how motivated you are. C is a fantastic all-purpose language and will translate well into any language based off of it (Java, C++, C#) should you choose to study them later. That said, it's not a particularly friendly language to start with.

Personally, my first language was C++. If I could go back and change this, I don't think I would. Though I certainly would have progressed a lot faster with another language, I was made aware early of a lot of issues that many modern languages hide from you. Java, for example, is easier to learn, but because it hides memory management from you, it tends to create programs which are outrageous resource hogs.

If you want the easiest meaningful intro to programming, start with Python. There are many excellent tutorials for free online and many excellent books (probably available from your university library) if you prefer to have a book. Python also enjoys good use in many fields (even in scientific computing, where C is generally king). Still, if you want to learn C, you can do it, it just will take more time and determination to become competent. If you are really able to devote four hours a day to working on it, then I see no reason why you couldn't pull it off.

>> No.5396982

>>5396961

Thanks for input!

My first goal is to make a small free iPhone/Android (not very sophisticated) before summers over. Doable?

>> No.5396986

>>5396982
yes

>> No.5396991

>>5396981

Thanks alot for taking the time to write that post. I think of my university courses will be about C, so at least I'll get some help there on the side of self-studying.

I've been trying out codecademy and watched some khan lessons about python, very interesting so far!

>> No.5397010

Once you feel more comfortable programming. Consider reading a computer architecture book. I recommend
John L. Hennessy and David Patterson's books.

>> No.5397020

>>5397010

What exactly is a computer architecture book about? Care to elaborate? Thanks

>> No.5397017

scheme
/thread

>> No.5397064

>>5397020
Its about what goes on inside the ICs of a computer.
How does a Computer knows where to get a value, how to calculate adresses in Memory, the different architectures of CPUs, what sort of memory are there etc....
It is NOT about how to assemble a PC.

>>5396911
With absolutely no knowledge in Programming I would recommend you Python.
C will work but it will be a lot less fun.
With Python you can start being productive after, at most, a week. C will take much longer.
Python has a massive Library of already implemented functions which you just need to import to use.
After you have gained a decent understanding in Python, then, I would switch to C or C++.
This is to gain a deeper understanding of what the computer actually does with your instructions, this will enable you to write more efficient programs, should the need arise.

Android uses a certain flavor of Java, so learning this should also be one of your priorities, but if you know Phyton and C or C++ you will pick up Java over the Weekend.

>> No.5397108

I reccomend learning C first as it will give you a good background for other programing. I learnt to program using a book titled engineering problem solving with C. It teaches you how to use C, teachs good coding style, and solved problems. The key to learning to code well is practice, learning syntax is easy but it's up to your cleverness and expiwrence to apply it to solve complex programs. YouTube is also a good tool to learn how to use various functions / structure etc. They key is to not give up, and keep practicing.

>> No.5397121

>>5397108

Thanks, that what I'm probably going to end up doing

>> No.5397125

>>5396911
Don't listen to these faggots. Learn C#, C++ and Java if you want.
P.S i hate java
must learn c++

>> No.5397132

>>5396911
>What language to learn first
Imperative. The basics of C, C++, Java, Python, etc. are all the same. It does not matter which you pick; just learn one and stop trying to incite language wars. Only stupid people participate in language wars so it is a surefire way to get bad advice.

>> No.5397134

>>5397125
Ejoy being locked down on Windows XP-7 (not even Win8 because MS dropped C#).

C# is nice but only if you want to write stuff on Windows, and the stuff should not need to run fast, or have to watch how much memory it needs, or care if the one who runs it has installed .NET Update 0x456523.234.012

>> No.5397287

>>5397132

Didn't really try to start any language-war, because I didn't even know that they 'were all the same'

>> No.5397301

>>5397287
Well, it's just the basics that are the same. But you have to learn that first.

>> No.5397327

>>5397287
i self taught myself into to comp sci and started with python found it extremely easy and intuitive. dont have any experience past that.

>> No.5397336

People are masochists, OP. They want you to feel the same pain and frustration they did. They want you to beat your head in agony and despair, asking yourself, "Is this really what programming is about? Is it really?" So they recommend you learn C++. It's like a rite of passage.

Don't do it. C++ is a horrible language and you should only ever dig into it if you have no choice. But you have a choice. Choose not to do it.

>> No.5397340

>>5397287
they're not all the same, he is trolling

>> No.5397361

http://www.trollope.org/scheme.html
http://home.adelphi.edu/sbloch/class/hs/testimonials/

http://mitpress.mit.edu/sicp/
http://www.ccs.neu.edu/home/matthias/HtDP2e/

>> No.5397374

>>5397361

Good sir!

>> No.5397383
File: 45 KB, 256x284, heart.png [View same] [iqdb] [saucenao] [google]
5397383

>>5397374

>> No.5397414

Perhaps a stupid question, but is it necessary or strongly recommended to make iPhone apps on Macs? I guess you can just dual boot iOs and Windows, but I'm just wondering since I'm most familiar with windows

>> No.5397435
File: 2 KB, 128x150, sicp.gif [View same] [iqdb] [saucenao] [google]
5397435

>>5397361
>>5397374
>>5397383
I like what I'm seeing.

>> No.5397462

>>5397435

Almost no shitposting in a thread for once..

>> No.5397485

start with C# and Unity you'll have more fun learning it thus making you learn it faster after that try C++ it differs only a little switching will be easy ;) your welcome

>> No.5397511

>>5397414

Apple has wallgardened their App Store. You can't develop and sell apps in the official App Store without buying all their bullshit, first. There are some clandestine (not illegal though) app stores for things (like porn and stuff) that Apple does not allow in their own App Store.

In reality, it's a pretty darn big investment. About $1500 in hardware and licensing fees and a lot of bullshit to have your app there and many app will end up being a failure.

>> No.5397518

>>5397340
Not really. By and large, programming languages are the same and are converging to a standard set of features. The biggest gap is the functional vs. imperative language gap. A FORTRAN programmer can write in COBOL, Ada, Java, C/++/#, Python, etc. They won't use the language properly, but they can still get things done. Moving to Scheme, Haskel, LISP, ML, or any of the other functional languages will be much more difficult (and I lump Prolog in here with LISP et al) for a FORTRAN programmer. The Church-Turing Thesis implies that all languages are functionally the same, but some languages are easier to use than others. Delegates in C# are easier to use than interfaces with a single function (Java) or function pointers (C++).

As for me, I started with BASIC. QBASIC and Casio calculator BASIC. I would also recommend Python (though I don't know any Python), as it is starting to replace FORTRAN and C in scientific applications.

>> No.5397532

>>5397518
>also
Sorry, I would recommend Python. I would NOT recommend BASIC, as there aren't really any good BASICs these days.

>> No.5397586

>>5397518
the problem is that it is hard to go from C++ to scheme, but it is not at all difficult to go from scheme to C++ (if you absolutely must, and you won't, you'll go to C). It is remarkably difficult to grasp higher-order concepts in C++ because the language gets in the way of what you're trying to learn, explain, or otherwise accomplish.

Anyone who says "but you get down to the metal" or "you really learn what's going on"
a) has no idea what's going on
b) hasn't read their SICP

In SICP you learn about
1) functional programming
2) imperative (stateful) programming
3) basic OO concepts
4) how to analyze algorithmic performance
5) how to write an interpreter (which some say is a "design pattern"---I will resist the urge to shitpost on this topic)
6) how to write a compiler
7) how to embed new languages in your interpreter
8) how to simulate a fairly realistic model of a machine

I would argue that anyone that has actually completed SICP knows more than anyone who used C++ for two years. And this is just an introductory textbook. To work alongside How to Design Programs with SICP I think anyone with programming aptitude (re: the camel has two humps) will be an excellent amateur in about 1 year. In the meantime I think they will know whether or not they actually enjoy programming, itself an important bit left out of self-taught "schools". Many people enjoy solving problems and the popular imperative family (python, C, C++, and Java) definitely give you lots of problems. So they think they enjoy programming. I think they're wrong; they may enjoy what they're doing, but it isn't programming.

>> No.5397620

These days it's pretty easy to hit the ground running. Free compilers and interpreters everywhere.

Be a man and learn C, and spend some time dabbling in assembly so you are aware of and appreciate what the machine is actually doing. status flags, stacks, conditional jumps, bitwise math, etc.
C/asm are so you know what's going on under the hood when you're using any of the other dozens of shitty languages out there.

>> No.5397680

>>5396911
>Where to start?
DONT PANIC! Make sure you understand everything before you move on. Other than that books you got look like a good start.
>What language to learn first
I would say that C is a good place to start. Its simple yet powerful. From that you could move to some OOP languege like Java or C#. Go with C++ only if you really really badly want to end up in game industry or other OOP languages are too large step for you from C (C++ is just C with OOP duct taped on top of it).
>General advice?
Code a lot. There is nothing more important if you want to learn programming than pratice. Uni should give you enough exercises and you can also make some stuff of your own. When you think you are done with some language, find some open-source project and it will show you how much you truly know about real programming.
Good luck.

>> No.5397705

Learn the very basics in java, like getting aquainted with loops and objects. Start with eclipse since it has real time syntax error finding. Just remember it's a learning language and very good for lighter tasks, starting with C or C++ would probably be very frustrating.

>> No.5398186

>>5397586
>>5397620
>>5397680
>>5397705

Thanks, this is really helpful for a newbie trying to figure out what to do!

>> No.5398248

Doesn't matter what you learn first, really. Your path is fine. For the first year or so, just worry about C/C++, if that's where you want to start, and get really good at them. Understanding the concepts underlying them will make picking up other object-oriented languages like Java and Python really quickly.

Also, you might like to plan on learning a functional language, like LISP/Scheme (I like the Racket variant, as apparently do others in this thread!) or Haskell.
http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html
http://tryhaskell.org/

These will introduce you to a different way of thinking about programming, and will be incredibly useful if you do a comp sci degree and take programming language theory. If I could go back, I'd learn Scheme first.

>>5396982
Easily doable, except that graphics programming tends to be a total bitch, and has more to do with learning APIs, and less to do with learning programming in general... except that it leads to something fun, so you might stick with it.

>> No.5398258

>>5398186
Anything else you want to know?

>> No.5398268
File: 74 KB, 500x394, GOTTA_GO_FAST.gif [View same] [iqdb] [saucenao] [google]
5398268

well if you've got about an hour learn lua. It's used in various videogames like garry's mod and what not, so it's fun to play around with.

It's a nice starter language, but I'd recommend that you learn C++. Almost every library out there is written in C++. C++ is also fast, and more often than not, YOU GOTTA GO FAST!


Personally, I use C#, though that's only because my advisor loves it. C# is also pretty fast, but keep in mind it was developed by microsoft, so be wary if you want to write linux compatible stuff. But because it's from microsoft, you can find lots of documentation and tutorials for it. Visual studio pretty much taught it to me.

>> No.5398293

Hmm
I'd say Java, definitely. C++ isn't bad, neither is C#. But if I remember right, C# is dependent on .NET Framework, but I could be wrong.

I started out with VB.NET (both bad and good things about that) and learned a tiny bit of C++ and C#. Now I'm heading to Java, where I'll stay.

To some it all up, Java is the way to go.

>> No.5398355

>>5398293
I don't think there's any language that's the best at anything. C works well for microcontollers, Java works well for big well organized programs, Python works well for magical handy scripts. You should see that religiously holding to one language is limiting, they all exist for a reason.

>> No.5398363

>>5396911
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-7.html
This is a really really cool book. It introduces concepts common in a lot of languages through Lisp. An old language with an extremely simple logical structure.

It seems like a really good place to start to me. I'm a second year Comp Sci student, we learned by jumping into Python, then Java, then C++ introducing relevant concepts along the way. I think that worked just fine, but I'm getting a lot of insight from this book that I wish I had from the beginning.

>> No.5398385

As for the language, it depends on what you want to do. You a big linux geek? C is nice for that. Want to develop professional games? C++ is the industry standard. Web? Javascript + your serverside language.

As for getting good. Code. Code, then code some more. Have small enough project plans that you can finish them realistically, then do. Don't fall into the common beginner trap of "Why make snake, that's so easy and has been done before". You can call it easy once you've written it. Don't try to start an MMO or an OS in your first 20 projects.

>> No.5398393

What about R?

I saw a few books on it at Barnes and Noble the last time I went to it, and they were in the "mathematics" section. A friend of mine who works at Spansion said they were looking for new employees who knew it.

I don't believe I've ever heard it mentioned on either /g/ or /sci/

>> No.5398413

>>5398393
R is industry standard but it tends to go with knowledge of stats. That is I'm not sure if it's worth learning R outside the context of stats courses.

>> No.5398428

>>5398393
R is a very specific scripting language.
You use it to perform statistical analysis and nothing else.
If you need data analyzed however, you wont find a better language for it.
Even the best Exel-VBA is a joke compared to R.

>> No.5398857

>>5398258

Getting a lot of useful information here, I'll just start out and see where I end up. Prob going to make a new thread some time in the future

>> No.5398859

>>5396911
C++ is a mess IMO, but can be useful

>> No.5399783

>>5398859

But from what I understand it's a vital part in a lot of programming jobs (Video games etc?)

>> No.5399784

you should try learning game maker