Pages: [1] 2 3
|
 |
|
Author
|
Topic: Let's learn to program (Read 14876 times)
|
NiX
Wiki Admin
Posts: 7770
Locomotive Pandamonium
|
I mean it! You and I, we'll learn it. Together.  Seeing as I'm still unemployed, I figured I might as well learn something that I can actually use instead of wasting time in FreeRealms. Schild, though I think he was joking, said I should learn Objective C, which lead to some Googling and the overall suggestion of learning C before Objective C. So, lay it on me! I've downloaded Dev-C++ and have this tutorial bookmarked. Any advice, better tutorials and/or resources.
|
|
|
|
Trippy
Administrator
Posts: 23657
|
If you want to do Mac or iPhone development, learning Objective-C is a good thing. If not, there are better languages to learn.
|
|
|
|
Yoru
Moderator
Posts: 4615
the y master, king of bourbon
|
I wouldn't recommend starting with C++. If you're just starting out with programming and you just want to learn the basics, as opposed to making a career out of it, I'd recommend starting with one of the very high-level languages that has a lot of support. Starting with a low-level language will lead you into the burnout zone, as you'll get tangled up in a morass of very basic stuff. Higher-level languages let you bang out a working, indie-grade program in a lot less time, and the reward of seeing your work work will help keep you going. Python is a good one; there's a lot of python libraries out there for accomplishing different tasks, a lot of documentation and a lot of code samples. You can pick up O'Reilly's excellent " Learning Python" pretty much at any large bookstore. It's a relatively easy language to learn, as you don't need to worry too much about low-level constraints like memory management. Weak type checking may ingrain some bad habits, though. The best part about Python is that all the basic dev tools are free. C# and Java are also okay choices, although they're more complex. C# requires more expensive development tools. The advantage of Java is that you can make Java mobile games for some cellphone platforms. If you want to do websites, I'd recommend PHP.
|
|
|
|
Kageru
Terracotta Army
Posts: 4549
|
Buy Kernighan and Ritchie "The C programming language" and read through it, do some of the examples. Alternatively any university library should have a bunch of copies. It's still the best and most concise introduction to the language I've seen. And C is still quite an elegant language and a good foundation for any procedural language.
|
Is a man not entitled to the hurf of his durf? - Simond
|
|
|
Miasma
Terracotta Army
Posts: 5283
Stopgap Measure
|
Can you tell us why you want to do this? If it's a serious thing to get a job or something you might want to put some more research into which language to learn than a suggestion which was possibly made in jest. If it's just as a hobby or something to do I really don't think of C as something which is so enjoyable I'd do it in my spare time... It's a very bare bones low level language that can be quite unforgiving, it also takes a lot of work to get stuff running.
If this is just to learn programming itself I'd go with Java as it is widely used, there are plenty of free online books and the most popular tools and IDEs are free as well. It's also much easier than C++. If you want to do web stuff I'd stay away from Java though, they haven't managed to come out with a decent framework in quite some time, everything is fragmented between different open source projects so none of them are doing very well. I'd go python or php for web right now (even though I really don't like php) or bite the bullet and go .net where there are plenty of projects.
|
|
|
|
Ghambit
Terracotta Army
Posts: 5576
|
Learn Flash and actionscript 3.0  Otherwise, in all honesty C# is where it's at right now. It's fully-managed code and the IDE is really nifty, not to mention the resources are vast, it's easy to learn, and you can progrom for the x-box via the XNA framework. Go to 3dbuzz.com for the best XNA tuts; great way to learn C# in a fun way. Studio express is free. If you're talking website work, I'd definitely get cozy with Adobe CS4 and go actionscript.
|
|
« Last Edit: June 03, 2009, 05:19:17 AM by Ghambit »
|
|
"See, the beauty of webgames is that I can play them on my phone while I'm plowing your mom." -Samwise
|
|
|
Trippy
Administrator
Posts: 23657
|
For the love of god DO NOT learn PHP unless a job depends on it.
|
|
|
|
Ghambit
Terracotta Army
Posts: 5576
|
For the love of god DO NOT learn PHP unless a job depends on it.
/signed PHP is like the C+ for websites, only with shittier IDEs and a more obscure language. You're better off learning Flash/actionscript and mySQL. Or, perhaps Ruby on rails, if you want something more pure code with a great syntax.
|
"See, the beauty of webgames is that I can play them on my phone while I'm plowing your mom." -Samwise
|
|
|
Yegolev
Moderator
Posts: 24440
2/10 WOULD NOT INGEST
|
I was doing pretty well with the freebie C# kit: go http://www.microsoft.com/express/ and you can figure out where to get the particular VisualStudio Express (read: Free) IDE or SDK or whatever they call it... back when I had more free time. If you want to do Real Programming then sure, you'll want to buy something (or learn C) but if you're just fucking around on Windows it will more than meet your needs. I'm finding one big issue with writing something useful in C# is that I have to both learn C# and learn the .NET framework. This is why PowerShell made me happy in the pants, since it is really a Windowy version of a UNIX shell that can also access the framework. This means I can make calls to .NET objects (and learn where things are) without writing an entire C# prog... but maybe you want to do something else. Also my C# bookmarks to save you time: http://delicious.com/Yegolev/C%23Really, people I talk to all tell me that Windows development is all about C#.
|
Why am I homeless? Why do all you motherfuckers need homes is the real question. They called it The Prayer, its answer was law Mommy come back 'cause the water's all gone
|
|
|
Tarami
Terracotta Army
Posts: 1980
|
I'm of course biased, but C# is really a very good starting point. It's a very alive language and the Internet is shock-full of people using it. C/C++ (incl. Obj-C) are languages that won't find everyday use. They're blazingly fast and powerful and are, indeed, sometimes needed, but the times you have a mundane problem of some kind that could be solved through programming a small app, C/C++ aren't the languages that will be there for you to make it easy. Just about ALL (alive) languages but actual assembly are easier and faster to "just get working," especially if you want something resembling a Windows application instead of a console window. Trust me when I say it will be important for you, as a beginner, to be able to think "I can actually program something my mom/computer-illiterate friend could use." Also, if you do use C#, which I do recommend, I will not recommend learning XNA (the game programming framework for .NET). It's cool and everything to spin 3D models on the screen for a while, but not particularily helpful nor useful. It teaches you amazingly little about the actual language/.NET and surprisingly much about the XNA-specific rendering implementations. But I'm just an old, grumpy college teacher, set in my ways!  You can get Visual Studio C# Express here, along with SQL Server 2008 Express, if you want it (it integrates very well into Visual Studio and is really the thing to run if you decide to go MS anyway.) http://www.microsoft.com/express/download/
|
- I'm giving you this one for free. - Nothing's free in the waterworld.
|
|
|
Salamok
Terracotta Army
Posts: 2803
|
Personally I think web apps are more fun to write (and share!) than desktop apps, go the LAMP route and throw in some AJAX and Flash. I also enjoy developing with scripted languages more than compiled. IMHO It is also easier to transition hobby to career on the web side than it is on the desktop side.
|
|
|
|
Kageru
Terracotta Army
Posts: 4549
|
For initial programming doing some C in a console has the advantage of keeping things simple. No gui's or huge system frameworks and API's to concern yourself with. And most of the programming skills you learn will be a good foundation for whichever way you go.
|
Is a man not entitled to the hurf of his durf? - Simond
|
|
|
tmp
Terracotta Army
Posts: 4257
POW! Right in the Kisser!
|
Any advice, better tutorials and/or resources.
Free PDF version of "Thinking in C++", does very decent job with introduction to the whole object-oriented programming thing and C++. Like others said though, it might be more practical to focus on some 'easier' language first if you want to see some tangible results early enough.
|
|
|
|
Miguel
Terracotta Army
Posts: 1298
कुशल
|
Bah. Python and PHP are *excellent* first languages: interpreted languages like PHP are great for first languages because a) no compiling to complicate things, b) largely compatible semantics, and c) weak typing. Trying to learn a managed language like C# can be challenging for a newbie, because the vast meat of programs is done through the standard class libraries, and not through standard code provisions. Hell, entire semesters are devoted to OO programming methodologies like inheritance, polymorphism, covariance, etc...not things to be tackled in a first programming language.
Most important are:
1) Learning basic syntax. The grammar of PHP and Python is largely the same as Java and C/C++/C#. 2) Learning about atomic operations. 3) Basic code constructs: looping, flow control, functions, procedures, etc 4) Keywords: if, else, case, return, etc 5) Type safety 6) Data structures: arrays, hashes, structs, unions, etc
More advanced topics can be covered later, like pointers, function pointers, type conversions, etc. My experience is that once you understand the "Ritchie" type grammars you can learn just about any language (excluding fun stuff like Lisp, Haskell, etc).
|
“We have competent people thinking about this stuff. We’re not just making shit up.” -Neil deGrasse Tyson
|
|
|
NiX
Wiki Admin
Posts: 7770
Locomotive Pandamonium
|
Can you tell us why you want to do this?
Well, I like to learn, as weird as that sounds, but when I do learn something new I want it to be useful to me. I've always wanted to learn the basics of a useful programming language, be able to write simple programs to do something I need done. It's not like I'm learning "just cause" and it'll go to waste. It's something I'd like to keep doing. Thanks for all the info, you know, despite the differing ideas of what's better to learn at first. Guess I'll head the C# route, I have heard a lot of good things about .NET and programming, so why not.
|
|
|
|
Lantyssa
Terracotta Army
Posts: 20848
|
For the love of god DO NOT learn PHP unless a job depends on it.
I like PHP. 
|
Hahahaha! I'm really good at this!
|
|
|
Teleku
Terracotta Army
Posts: 10516
https://i.imgur.com/mcj5kz7.png
|
For the love of god DO NOT learn PHP unless a job depends on it.
I like PHP.  So do I. Why do you say this Trippy? Also, if not PHP, what do you recommend to use instead?
|
"My great-grandfather did not travel across four thousand miles of the Atlantic Ocean to see this nation overrun by immigrants. He did it because he killed a man back in Ireland. That's the rumor." -Stephen Colbert
|
|
|
Ard
Terracotta Army
Posts: 1887
|
I like PHP also, but I recognize that it's full of holes, most of the security related. It however is the easiest web language to learn if you're coming from any sort of C background, but not vice versa.
I personally recommend starting with any variation of C, and not a web language. Learn how to program for the metal and how to deal with memory and hardware constraints, especially if you're ultimately looking at any sort of cell phone development further down the line. Most web languages, and their tutorials gloss over that, and it's quickly becoming a lost art, which is bad bad bad and is leading to alot of the hardware and memory bloat we've been seeing lately.
|
|
|
|
Lantyssa
Terracotta Army
Posts: 20848
|
I would think that's just the bad programming which has always existed and the fact that the ever increasing memory and processing power of such devices allow for people to be even more sloppy.
|
Hahahaha! I'm really good at this!
|
|
|
NiX
Wiki Admin
Posts: 7770
Locomotive Pandamonium
|
So, C# it is! I'd like to learn PHP, but there's something about web programming that turns me off. I don't know what it is.
Free learning resources for C#?
|
|
|
|
Yoru
Moderator
Posts: 4615
the y master, king of bourbon
|
If it's largely for personal entertainment, then the choice of high-level or low-level depends on what sort of person you are.
If you're goal-oriented and like to "get shit done", choose a high-level language - Python, C#, Java. It's a much faster route learning those and their standard libraries towards building something recognizable as a modern or semi-modern application. Compare Swing to raw C++ Win32 or even MFC, for example. Personally, I'd take this route.
If you're a tinkerer, the sort of person that likes to really tweak little things and see how shit works, choose a low level language. C and/or C++ are good choices; any form of RISC assembly language if you're really into learning how computers work at the machine level. The advantage of these is that you can do little robotics projects and write code for commodity microprocessors if you're into the solder-and-circuitboards side of things. Trying to do modern GUI applications in these without substantial programming experience/eduction, though, will be about as easy as trying to win a biathlon when you've never skied or shot a gun in your life.
If you're blindingly insane and take a lot of acid, or if you're an idealistic hippie who hates dealing with things in The Real World, code in a functional language like Lisp.
On a side note, I learned BASIC as my first language, then Pascal and C, then C++, ColdFusion (ugh) and PHP. Really, once you've gotten one or two imperative languages down, the rest are quite easy as it's largely a matter of syntax and libraries. Like Miguel mentioned above, the core imperative constructs are largely immutable.
|
|
|
|
Yoru
Moderator
Posts: 4615
the y master, king of bourbon
|
So, C# it is! I'd like to learn PHP, but there's something about web programming that turns me off. I don't know what it is.
Free learning resources for C#?
Sorry, you opened up a long-running programmers' holy war about which language to learn and, by extension, which language is "better".  Free version of Microsoft's C# compiler/coding suite: here. That's as far as I can go for you; I did a little C# under ASP.NET once but I've not gotten into it very seriously. Edit: O'Reilly books are usually the gold standard in references. They have a C# section. Suggest picking up Learning <Your Language Here> and, if they have one, <Your Language Here> Cookbook. Once you've got a handle on it, Programming <Your Language Here> and <Your Language Here> In A Nutshell are often handy too. I learned Java largely via Java In A Nutshell combined with preexisting C++ knowledge and a very demanding professor. Edit: Forgot a 'not'. For clarity, in bold. 
|
|
« Last Edit: June 03, 2009, 09:53:17 AM by Yoru »
|
|
|
|
|
Ard
Terracotta Army
Posts: 1887
|
I would think that's just the bad programming which has always existed and the fact that the ever increasing memory and processing power of such devices allow for people to be even more sloppy.
Yeah, I don't disagree here, but it's getting worse, and it's actually becoming more important again with the rise of cell phone apps. Yes Android and the iPhone obfuscate away a lot of this, but that doesn't mean you don't have to know what it's doing and why to not screw it up anyhow. The ease of web programming frameworks and homebrew game development however seemed like it created a lot more bad programmers out there than anything I've seen before personally. Nutshell advice: learn the whys in a macro sense, they really are important, don't just learn the hows. edit: also of note, the whys carry over from language to language, no matter what the type, the hows often don't
|
|
« Last Edit: June 03, 2009, 09:32:36 AM by Ard »
|
|
|
|
|
Yoru
Moderator
Posts: 4615
the y master, king of bourbon
|
Learning to program and learning to be a good programmer are largely orthogonal things. One is learning, essentially, a subset of mathematics that can be applied to create magic phrases that make computers do shit. The other is learning how to not make other people want to stab you when they look at your magic phrases. This is why it's entirely possible to have wizardly programmers who bang out code that does amazing things... but no one else on earth can maintain that code.  That said, I used to believe it was difficult to 'retrofit' the mindset necessary to code with limited resources and understand how the underlying machinery works. These days I'm coming around to the mindset that we instead produce programmers suited for the work being demanded, and until the advent of mobile platforms, the demand for very fiddly low-level programming was fading away. If you absolutely must learn to program in MIPS assembly with only 8 registers and a limited heap, you'll learn it, even if your first language was something as bloated as Java. It may be a painful experience, but people are eminently adaptable when the need arises. Edit: Not disagreeing with learning the theory behind it. That's the basis of a good education in computer science, and will be portable as long as we have computing devices, whether any specific language comes or goes.
|
|
|
|
Murgos
Terracotta Army
Posts: 7474
|
Nutshell advice: learn the whys in a macro sense, they really are important, don't just learn the hows.
I think that to be a really good C programmer you have to have a more than passing familiarity with what the metal does, for any interpreted language though I don't think it really matters other than in a Big O sort of way.
|
"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
|
|
|
Ard
Terracotta Army
Posts: 1887
|
I'm not even saying necessarily to learn to program for embedded systems. Just have a general understanding of what happens when the compiler turns your code into assembly, and what the computer does with it. Understanding why things like byte alignment matter goes a long ways to not writing badly optimized code in general, in my opinion. edit: I think that to be a really good C programmer you have to have a more than passing familiarity with what the metal does, for any interpreted language though I don't think it really matters other than in a Big O sort of way.
It actually matters more for interpreted code, since you're running the code in real time. Blowing out memory on a web server is something I don't even want to ponder. edit again: I'm stepping away from this debate. This isn't going to help Nix any. My advice Nix, pick a language and stick with it until you understand programming and syntax basics. It doesn't really matter which for learning the basics.
|
|
« Last Edit: June 03, 2009, 09:49:32 AM by Ard »
|
|
|
|
|
Tarami
Terracotta Army
Posts: 1980
|
If you're blindingly insane and take a lot of acid, or if you're an idealistic hippie who hates dealing with things in The Real World, code in a functional language like Lisp.
I will steal this quote. 
|
- I'm giving you this one for free. - Nothing's free in the waterworld.
|
|
|
NiX
Wiki Admin
Posts: 7770
Locomotive Pandamonium
|
edit again: I'm stepping away from this debate. This isn't going to help Nix any. My advice Nix, pick a language and stick with it until you understand programming and syntax basics. It doesn't really matter which for learning the basics.
Thanks. I was reading this entire debate thinking "metal?"..etc. I needed a firm "Just do it." Luckily for me, almost all of my friends went to school for CompSci, so there is an insane amount of books at my disposal. Who knew people held onto stuff they bought for College/Uni.
|
|
|
|
Yoru
Moderator
Posts: 4615
the y master, king of bourbon
|
"Metal" in this case is programmer slang for the hardware itself; learning about processor design, how the hardware actually works, what the fuck a 'register' is, what L1 and L2 cache are for, pipelining, how memory works. Also, low-level stuff like byte-ordering and how to turn bit-level operations (AND, OR, XOR, NOT) into actual computing units.
It's way beyond the scope of what you want to do. GO BUY BORROW SOME BOOKS, FOOL.
Edit: compsci friends, yay
|
|
|
|
naum
Terracotta Army
Posts: 4263
|
|
"Should the batman kill Joker because it would save more lives?" is a fundamentally different question from "should the batman have a bunch of machineguns that go BATBATBATBATBAT because its totally cool?". ~Goumindong
|
|
|
Lantyssa
Terracotta Army
Posts: 20848
|
Thanks. I was reading this entire debate thinking "metal?"..etc. I needed a firm "Just do it." Luckily for me, almost all of my friends went to school for CompSci, so there is an insane amount of books at my disposal. Who knew people held onto stuff they bought for College/Uni.
Geeks are bad about that. I still have my p-chem books even though I hated it with a passion. Never know when I might need to look up Schrodinger's equation...
|
Hahahaha! I'm really good at this!
|
|
|
Ghambit
Terracotta Army
Posts: 5576
|
The 1st language I ever "learned" was Q-Basic and shortly after, Scheme (M.I.T.'s version of Lisp). We were lucky enough to have some of the originators of Scheme/Lisp teaching at my high school. It was awesome, loved it. BUT, like Yoru said Lisp languages are for hippies who believe they can functional algorithm their way to a conscious A.I. or some such thing. I will say, if you're into A.I. you should probably go for Scheme and then Lisp... and learn it alongside AIML and some kind of scripting language for microcontrollers, while you play with a bot-assistant.
As for free C# learning aides. MS has them all over the place (a lotta videos). It's one thing they're VERY good at doing. The learning resources are built into VS (it has its own browser) so you can pretty much find anything you need with a click. In 1 day you can be making your own fairly useful Windows apps. Console progs. are a bit tougher so start with winform stuff.
|
"See, the beauty of webgames is that I can play them on my phone while I'm plowing your mom." -Samwise
|
|
|
OcellotJenkins
Terracotta Army
Posts: 429
|
I'll be different and recommend VB.NET. I grew up on BASIC so the syntax is friendlier than C type languages to me. It's also equally as powerful as C#. I've tried to get into Objective-C for Mac development, but Xcode/gui design tools are just very backwards for people used to .NET. I wish there were more high-level development options on the Mac.
|
|
|
|
fuser
Terracotta Army
Posts: 1572
|
I'm with Trippy with a hatred on PHP. It's a totally write and hack up whatever you want language that's great for small DIY projects. Almost all the PHP I have to deal with in production is hackish (I'm guilty of writting terrible PHP) code, in which you have to sit down and decipher the original coders logic of how the program works. You'd be better off learning shell scripting as you'd learn functions, program logic, and it's something you can use daily. I don't think in any PHP application I ran into had a good framework. The language caters to the "write your own" way mentality and spending time debugging the way an original coder designed the database handling routines.
I won't even get into the asshat dev's behind PHP and their shocking handling of security or updates (hi you point release changes to code handling).
If you have to touch web stuff, run Python or Ruby and use their respected frameworks. PHP is fine if you want to learn some basics but why start with PHP when you can learn a good structured language and transfer that knowledge back to PHP?
Set aside some time pick a language, grab a good tutorial/book and think of a small project to do. Keep the scope small and simple! You want something to hack on more features down the road or as you go ;)
Back to your original post, I'd really would love to learn some C#/.Net and would be down for a learning buddy. Yegolev are you still working on it when you have time?
|
|
|
|
Ingmar
Terracotta Army
Posts: 19280
Auto Assault Affectionado
|
Every time I see someone mention Objective C I think of Ayn Rand.
Anyway, I would echo the recommendation for C#. It seems like I see it on a lot of job postings these days.
|
The Transcendent One: AH... THE ROGUE CONSTRUCT. Nordom: Sense of closure: imminent.
|
|
|
|
Pages: [1] 2 3
|
|
|
 |