f13.net

f13.net General Forums => Gaming => Topic started by: NiX on June 03, 2009, 02:15:46 AM



Title: Let's learn to program
Post by: NiX on June 03, 2009, 02:15:46 AM
I mean it! You and I, we'll learn it. Together. :heart:

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 (http://www.cprogramming.com/tutorial/c/lesson1.html) bookmarked. Any advice, better tutorials and/or resources.


Title: Re: Let's learn to program
Post by: Trippy on June 03, 2009, 03:14:14 AM
If you want to do Mac or iPhone development, learning Objective-C is a good thing. If not, there are better languages to learn.


Title: Re: Let's learn to program
Post by: Yoru on June 03, 2009, 03:21:41 AM
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 (http://oreilly.com/catalog/9780596158064/)" 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.


Title: Re: Let's learn to program
Post by: Kageru on June 03, 2009, 04:08:42 AM

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.


Title: Re: Let's learn to program
Post by: Miasma on June 03, 2009, 04:10:45 AM
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.


Title: Re: Let's learn to program
Post by: Ghambit on June 03, 2009, 05:13:32 AM
Learn Flash and actionscript 3.0   :grin:

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.


Title: Re: Let's learn to program
Post by: Trippy on June 03, 2009, 05:22:38 AM
For the love of god DO NOT learn PHP unless a job depends on it.


Title: Re: Let's learn to program
Post by: Ghambit on June 03, 2009, 05:28:08 AM
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.


Title: Re: Let's learn to program
Post by: Yegolev on June 03, 2009, 05:34:58 AM
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 (http://microsoft.com/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%23

Really, people I talk to all tell me that Windows development is all about C#.


Title: Re: Let's learn to program
Post by: Tarami on June 03, 2009, 06:09:34 AM
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! :why_so_serious:

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/


Title: Re: Let's learn to program
Post by: Salamok on June 03, 2009, 06:21:24 AM
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.


Title: Re: Let's learn to program
Post by: Kageru on June 03, 2009, 06:34:27 AM

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.


Title: Re: Let's learn to program
Post by: tmp on June 03, 2009, 06:44:37 AM
Any advice, better tutorials and/or resources.
Free PDF version of "Thinking in C++" (http://www.planetpdf.com/developer/article.asp?ContentID=6634), 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.


Title: Re: Let's learn to program
Post by: Miguel on June 03, 2009, 07:04:29 AM
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).


Title: Re: Let's learn to program
Post by: NiX on June 03, 2009, 07:41:45 AM
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.


Title: Re: Let's learn to program
Post by: Lantyssa on June 03, 2009, 07:44:18 AM
For the love of god DO NOT learn PHP unless a job depends on it.
I like PHP.  :sad:


Title: Re: Let's learn to program
Post by: Teleku on June 03, 2009, 07:51:34 AM
For the love of god DO NOT learn PHP unless a job depends on it.
I like PHP.  :sad:
So do I.  Why do you say this Trippy?  Also, if not PHP, what do you recommend to use instead?


Title: Re: Let's learn to program
Post by: Ard on June 03, 2009, 08:31:58 AM
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.


Title: Re: Let's learn to program
Post by: Lantyssa on June 03, 2009, 09:03:34 AM
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.


Title: Re: Let's learn to program
Post by: NiX on June 03, 2009, 09:06:30 AM
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#?


Title: Re: Let's learn to program
Post by: Yoru on June 03, 2009, 09:07:12 AM
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.


Title: Re: Let's learn to program
Post by: Yoru on June 03, 2009, 09:09:20 AM
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".  :awesome_for_real:

Free version of Microsoft's C# compiler/coding suite: here (http://www.microsoft.com/express/vcsharp/).

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 (http://oreilly.com/) books are usually the gold standard in references. They have a C# section (http://oreilly.com/csharp/). 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. :-)


Title: Re: Let's learn to program
Post by: Ard on June 03, 2009, 09:28:08 AM
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


Title: Re: Let's learn to program
Post by: Yoru on June 03, 2009, 09:35:27 AM
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.  :awesome_for_real:

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.


Title: Re: Let's learn to program
Post by: Murgos on June 03, 2009, 09:38:58 AM
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.


Title: Re: Let's learn to program
Post by: Ard on June 03, 2009, 09:42:38 AM
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.


Title: Re: Let's learn to program
Post by: Tarami on June 03, 2009, 09:50:15 AM
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.  :drill:


Title: Re: Let's learn to program
Post by: NiX on June 03, 2009, 09:53:14 AM
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.


Title: Re: Let's learn to program
Post by: Yoru on June 03, 2009, 09:57:28 AM
"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


Title: Re: Let's learn to program
Post by: naum on June 03, 2009, 10:37:12 AM
Ruby or Python as a high level language -  I recommend Ruby, but Python is preferred by many, and you can go do Google App Engine for web apps…
http://pine.fm/LearnToProgram/
http://poignantguide.net/ruby/
http://diveintopython.org/
http://www.python.org/doc/2.5.2/tut/tut.html

Definitely recommend LAMP (or RAMP/PAMP) for building web applications, C#, ASP, .NET, etc.… are platform specific and require licenses if you want to do something commercial down the road…

C/Objective-C (lots of folks making money writing iPhone apps these days…)
Kernighan + Ritchie "The C Programming Language" is still the textbook bible for aspiring *nix programmers

A list of free programming languages in a whole bunch of languages
http://www.e-booksdirectory.com/programming.php


Title: Re: Let's learn to program
Post by: Lantyssa on June 03, 2009, 10:37:50 AM
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...


Title: Re: Let's learn to program
Post by: Ghambit on June 03, 2009, 10:55:32 AM
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.


Title: Re: Let's learn to program
Post by: OcellotJenkins on June 03, 2009, 11:04:59 AM
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.


Title: Re: Let's learn to program
Post by: fuser on June 03, 2009, 11:09:25 AM
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?


Title: Re: Let's learn to program
Post by: Ingmar on June 03, 2009, 11:28:03 AM
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.


Title: Re: Let's learn to program
Post by: Murgos on June 03, 2009, 11:46:33 AM
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...

Well, for a 'hard' science subject your text books are actually filled with facts...


Title: Re: Let's learn to program
Post by: Ghambit on June 03, 2009, 11:48:23 AM
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.

My friend is a Comp. Sci master that works for local govt. and they recently forced their entire staff to learn C#.  He was originally a C++/Java man.
Also, a LOT of game schools are now teaching XNA and occasionally you see studios asking for it and/or C#.  Not to mention, most newer  game engines like UE3 now offer C# dev. methods to go along with their scripting languages.


Title: Re: Let's learn to program
Post by: Quinton on June 03, 2009, 12:07:46 PM
If you've never done any programming before at all (or very very little), I suggest picking a simple, well known language without a lot of fancy/complicated/excessive features, that runs on the commandline or an IDE that works on your machine.  Write some little toy programs.  Learn how to do simple things.

Once you've got a grip on basics -- writing some code that accomplishes something, you might want to pick some project that's interesting to you and investigate what languages/tools are appropriate.  Writing a web application, or a handheld game, or a commandline program to process logs from your favorite MMO to assemble statistics on weapon efficiency, all can be done in any number of languages/systems, but some will be more appropriate than others.

Don't tie yourself to a language or system forever -- the first language you learn will quite possibly not be one you use for the rest of your life, but learning any language will help you.

I'd advise against learning assembly to start with, but if you have any curiousity about how the underlying machines work (and this will help understanding higher level issues), it's well worth doing sooner rather than later.  x86 is everywhere, but ugly as hell, ARM is awesome (and is used in billions of mobile devices), etc.  It's good for my job security that few people learn C/assembly/embedded stuff, but it does make me sad because to my mind this is really where the magic happens.  Everything above the software/metal interface is abstraction ^^





Title: Re: Let's learn to program
Post by: NiX on June 03, 2009, 12:47:10 PM
I've started learning C# and made a contact program with the help of a book. Unfortunately, my program doesn't run because SQL Server 2008 Express is convoluted and ridiculously hard to update/install.

Edit: And every time I try reinstalling/updating with the service pack, it thrashes the shit out of my hard drive.


Title: Re: Let's learn to program
Post by: ezrast on June 03, 2009, 03:15:57 PM
Never used C# and maybe I'm missing something, but is it normal nowadays to be writing database-driven apps on the first day? Whatever happened to, like, hello world and guess-the-number games? I ask purely out of curiosity.


Title: Re: Let's learn to program
Post by: Tarami on June 03, 2009, 03:21:03 PM
Never used C# and maybe I'm missing something, but is it normal nowadays to be writing database-driven apps on the first day? Whatever happened to, like, hello world and guess-the-number games? I ask purely out of curiosity.
Modern frameworks happened. ;D


Title: Re: Let's learn to program
Post by: NiX on June 03, 2009, 04:17:20 PM
Whoo! Fixed it and my app runs. Somewhat, though the DB is broken because of all the un/installing I did, but the fact that it works is good. Course, I didn't actually do anything other than learn how to add graphics and link a DB to a program.


Title: Re: Let's learn to program
Post by: Lantyssa on June 03, 2009, 04:21:01 PM
I'd advise against learning assembly to start with, but if you have any curiousity about how the underlying machines work (and this will help understanding higher level issues), it's well worth doing sooner rather than later.  x86 is everywhere, but ugly as hell, ARM is awesome (and is used in billions of mobile devices), etc.  It's good for my job security that few people learn C/assembly/embedded stuff, but it does make me sad because to my mind this is really where the magic happens.  Everything above the software/metal interface is abstraction ^^
Assembly is fun if you like the nitty-gritty, but as a first language it is definately a bad pick.  One of the few computer courses I loved.  (The industry-based lecturer thinking I was a programming genius didn't hurt either. ;))


Title: Re: Let's learn to program
Post by: Ghambit on June 03, 2009, 04:29:59 PM
Anyone else been foolin around with Flash CS4 and actionscript3.0 lately?  I've dipped into it a bit.  It's a pretty damned powerful development environment.  Super hard because you can pretty much do anything/everything with it though, but if you master it you're set for life.



Title: Re: Let's learn to program
Post by: NiX on June 03, 2009, 04:32:10 PM
When I talked to one of my CompSci buddies, he actually said I might as well do actionscript  because it would be easier to learn and applies to a lot these days. With all the Flash gaming on the rise.


Title: Re: Let's learn to program
Post by: naum on June 03, 2009, 05:24:27 PM
Anyone else been foolin around with Flash CS4 and actionscript3.0 lately?  I've dipped into it a bit.  It's a pretty damned powerful development environment.  Super hard because you can pretty much do anything/everything with it though, but if you master it you're set for life.



Flash sucks.


Title: Re: Let's learn to program
Post by: Ghambit on June 03, 2009, 05:34:09 PM
Anyone else been foolin around with Flash CS4 and actionscript3.0 lately?  I've dipped into it a bit.  It's a pretty damned powerful development environment.  Super hard because you can pretty much do anything/everything with it though, but if you master it you're set for life.



Flash sucks.


Not anymore it doesnt. 


Title: Re: Let's learn to program
Post by: Viin on June 03, 2009, 07:16:19 PM
I still don't like Flash much, but it is very popular.

Stick with C# for a little bit, until you understand how the objects interact/etc. Then it's fairly easy to port that knowledge to Flash and start picking up how Flash does things if you want to go that route.


Title: Re: Let's learn to program
Post by: Trippy on June 03, 2009, 07:24:09 PM
When I talked to one of my CompSci buddies, he actually said I might as well do actionscript  because it would be easier to learn and applies to a lot these days. With all the Flash gaming on the rise.
JavaScript, which ActionScript is based on, is a "non-standard" OO language in that it uses prototypes instead of classes for objects. Because of that I wouldn't recommend JS (and therefore ActionScript) to be your first language.


Title: Re: Let's learn to program
Post by: Evil Elvis on June 03, 2009, 07:39:23 PM
I'd stay away from natural languages like Ruby or Visual Basic.  Learning a C-style language will make it easier for you to pick up another language.

Java, C#, or C++ are the best choices if you want something marketable.  C++ isn't too bad as long as you stick to just writing standard ANSI C++, and stay away from anything to do with Microsoft until you've got some more experience.  If you want to do Microsoft/.Net, stick with C#.  Java would probably be my first pick, since there are tons of examples out there, it's simple to pick up, and there's still jobs out there for it.  Download NetBeans + the javadocs, and you're good to go.  

There's a ton of web jobs out there, too.  Your best bet for those is to learn Java, then pick up Struts or Spring, or go with C# then ASP.Net.


Title: Re: Let's learn to program
Post by: Trippy on June 03, 2009, 07:43:25 PM
Ruby has a C-style syntax. It's just that it has features that make it easy to make "domain specific languages" (DSLs).


Title: Re: Let's learn to program
Post by: ghost on June 03, 2009, 07:47:47 PM
Dang, if we really learn some basic we can re-create that cool game "worm" that everyone seemed to do in the 80's.........

Seriously, I would just be happy to get networking down.


Title: Re: Let's learn to program
Post by: Sheepherder on June 03, 2009, 11:30:50 PM
I'm going to throw Lua out there as something to look into if you ever play computer games.


Title: Re: Let's learn to program
Post by: Amarr HM on June 04, 2009, 02:32:59 AM
Count me in.


Title: Re: Let's learn to program
Post by: Salamok on June 04, 2009, 06:57:53 AM
Never used C# and maybe I'm missing something, but is it normal nowadays to be writing database-driven apps on the first day? Whatever happened to, like, hello world and guess-the-number games? I ask purely out of curiosity.
Modern frameworks happened. ;D

If you are actually wanting to learn how to program this is a pitfall you should be aware of.  If you choose a framework that offers a designer oriented IDE to develop in then it is very easy to fall into the trap of learning/manipulating the framework/IDE without learning anything about the language it is based on.  For example in VB.Net you can easily write a simple program (like hello world) w/o ever seeing any code at all.  On top of this, if you have never coded before then using the "designer view" of a framework/IDE will probably come more naturally to you than just going straight to the code.

I am not saying you should avoid .NET, Flash or any other environment that does this, just saying be aware of this pitfall and avoid it.

Also, if you code in php an editor with code hinting is almost a must.  The language was grown by a crowd of people throwing shit (in the form of functions) at a wall and keeping what stuck.  One of the confusing (and annoying) results is that the language conventions are not consistent to any sort of master plan.  Sometimes your arguments are presented as Needle, Haystack and other times it is Haystack, Needle some functions have underscores others do not (stripslashes vs strip_tags), some functions use 2 instead of to (nl2br vs strtoupper).

edit: the point here is to truly master PHP to the point of coding on paper, you need to memorize all these inconsistent functions by rote where in many other languages you can learn the method behind the madness instead of committing all the madness to memory.


Title: Re: Let's learn to program
Post by: Miguel on June 04, 2009, 11:05:18 AM
This is exactly why I tend to caution people wanting to learn how to program from the managed languages:  it's difficult to understand how/why delegates are useful in C#, without knowing what a function pointer is, which is hard to understand without knowing what a pointer is, ...

To be honest, if your first 10 programs involve calling a ton of functions from a library (with the notable exceptions of print statements, or perhaps opening a file), or subclassing a ton of predefined standard classes in order to get your programs working, then you aren't learning how to program (application of algorithms and data structures), you are learning that languages specific framework(s).

Or if you decide to use a managed language like C#, concentrate on writing your own methods to accomplish tasks:  learn about pass by value, pass by reference, overloading, etc, which are ideas common to many languages today.


Title: Re: Let's learn to program
Post by: Quinton on June 04, 2009, 12:15:18 PM
There's definitely something to be said (to my mind), to writing some simple programs to solve simple problems just to learn the basics of math, conditionals, loops, functions, variables, arrays, etc before diving right in to fancy GUI/IDE interface builders and giant "batteries included" libraries.  Modern IDEs make a lot of things easier but they can also obscure the basic stuff that everything else depends on.

I was born in the mid-70s, and grew up on microcomputers (timex sinclair, c64, pc-xt, etc) in the 80s, so I did the BASIC, 6502 assembly, TurboC, x86 assembly, omg you can download a ton of languages from BBSes and they're all kinda different! progression over a few years when I was a kid.

One thing that was pretty fun about C64 BASIC was that you had the simple building blocks, and then with a little poking about you got graphics and sprites and sound.  You could do a bunch of stuff without being totally overwhelmed by the complexity of the language or environment.  Is there anything that is similarly good a "just getting started" environment these days?


Title: Re: Let's learn to program
Post by: naum on June 04, 2009, 12:32:39 PM
One thing that was pretty fun about C64 BASIC was that you had the simple building blocks, and then with a little poking about you got graphics and sprites and sound.  You could do a bunch of stuff without being totally overwhelmed by the complexity of the language or environment.  Is there anything that is similarly good a "just getting started" environment these days?

1. Javascript + the browser - Javascript is much maligned, and while it certainly justified in some regard, is actually a powerful language with functional programming power (is Lisp in C syntax clothing) power, but prototypal nature frustrates those accustomed to more traditional class based OO approach…

2. Smalltalk Squeak - IDE, able for beginners to get multimedia, graphics, game like programs up and running fairly quickly

3. For non-Windows machines, all ship with C compiler (gcc), Ruby, Perl, Python, Apache, SQL (SQLite, MySQL come bundled) and a CLI that won't make your eyes burn… …proliferation of Windows machines with no development tools, no C compiler, and no elegant manner of getting close to the metal (DOS command box?)


Title: Re: Let's learn to program
Post by: Rasix on June 04, 2009, 12:35:17 PM
Thanks to this thread I'm jumping back into doing some programming exercises, and I'll be doing it in C#.  Figure I might as well pick up a resume worthy language while I re-hone my skills.

My job has taken me away from my CS roots and steered me more towards other aspects of my degree. I feel this has hurt in some of the interviews (my Google interviews were painful)  I've done since being at my current job as I've wanted to change gears and go more into software development. Most I've really done programming wise at my current position is some scattered database work and Perl scripts I wrote to parse build logs.  Reading this thread really drives home what has stuck with me and what aspects have atrophied.

Most of my previous experience has been Java, C (some, it was not carried over into grad school), Perl, SQL, etc. Tentatively looking forward to relearning what I've sat on over the last 5 years (damn this stuff changes fast).  Maybe my father-in-law will come up with some traffic analysis programs I could write.   :drill:



Title: Re: Let's learn to program
Post by: Samwise on June 04, 2009, 06:46:49 PM
Also, if you code in php an editor with code hinting is almost a must.  The language was grown by a crowd of people throwing shit (in the form of functions) at a wall and keeping what stuck.  One of the confusing (and annoying) results is that the language conventions are not consistent to any sort of master plan.  Sometimes your arguments are presented as Needle, Haystack and other times it is Haystack, Needle some functions have underscores others do not (stripslashes vs strip_tags), some functions use 2 instead of to (nl2br vs strtoupper).

I've been doing a fair amount of PHP stuff over the last week or so and this has been driving me fucking nuts.  Especially the needle/haystack stuff; at least getting a function name wrong will throw an obvious error.


Title: Re: Let's learn to program
Post by: Sheepherder on June 04, 2009, 09:41:15 PM
Is there anything that is similarly good a "just getting started" environment these days?

Anyone in an Ontario high school will learn programming with Turing (http://www.holtsoft.com/).  I don't know any fancy words which would be appropriate to drop, but it's pretty easy to pick up and pretty hard to break anything.  The best part is the help file is pretty complete, so the language itself is pretty easy to manage while you're still working around the actual math and logical concepts.

EDIT: And they got a bunch of working code that's well formatted included that's intended to be used with their textbook, also downloadable.


Title: Re: Let's learn to program
Post by: raydeen on June 05, 2009, 07:40:52 AM
I'm a big proponent of Python because it's cross-platform, extensible (C, Java, and other languages can be incorporated when you need the extra horsepower) and once you get your head around the way it does things, it's actaully easier and sometimes quicker to get results. Like this: Say I want to do a text divider with 60 asterisks in a row. In other languages I'd either have to do a print statement containing all 60 asterisks or do a FOR loop to print them. In Python it's as easy as doing
Code:
print 60 * '*' 

There's a bunch of weird little things Python can do that spins your head the first time you see them but once you get used to them, it's fairly natural. Plus there's the PyGame and I believe OGL libraries for doing some fairly complex games.

Edit: I believe most of EVE is Stackless Python.



Title: Re: Let's learn to program
Post by: Murgos on June 05, 2009, 09:19:54 AM
Being able to take (not widely known about) shortcuts is not something that describes a good first language.  See Perl.

edit: In fact, I would say that most of the problems with C comes from people taking poorly documented shortcuts.

edit2:
Edit: I believe most of EVE is Stackless Python.
My point EXACTLY.


Title: Re: Let's learn to program
Post by: raydeen on June 05, 2009, 09:36:08 AM
Eh, it's all in what you're wanting to accomplish. I'm just a hobbyist programmer with no real aspirations of going into the big leagues. Out of all the languages I've looked at in the past 20 odd years, Python is the one that makes the most sence to me, followed by C and C#. Best advise is learn as many as you can as one will work best in one situation but not in another. Carpenters don't have just one tool when they're building something. They might use a hammer more than a screwdriver, but both will be needed at some point.


Title: Re: Let's learn to program
Post by: Righ on June 05, 2009, 07:23:49 PM
My opinion? Start with bog standard C because it is concise and everybody should know it. Knowing it is like knowing English - it opens a lot of doors. Then learn Ruby (or similar) so you can do useful stuff quickly with the rapid development tools available.


Title: Re: Let's learn to program
Post by: Soln on June 05, 2009, 08:02:00 PM
/derail

http://lolcode.com/

Quote
HAI WORLD:

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

for realz


Title: Re: Let's learn to program
Post by: schild on June 05, 2009, 08:04:33 PM
/derail

http://lolcode.com/

Quote
HAI WORLD:

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

for realz
http://www.google.com/codesearch?hl=en&lr=&q=lang%3Alolcode


Title: Re: Let's learn to program
Post by: Jayce on June 05, 2009, 10:22:05 PM
This is actually a really hard question.

Using C or C++ or assembler will not only make you reinvent the wheel to get anything done, it will also let you shoot yourself in the foot possibly taking a leg off at the same time.

For just fooling around I'd agree with everyone here that managed languages are what you're looking for.  Even a database might be overkill depending on what you want to do. Enterprise (corporate) development is heavy on CRUD type apps (create, update, delete) but game/graphics/network (i.e. interesting) programming is not data persistence-centric at all.

General-purpose, professional programmers go to college for it.  Wunderkinds find some area they are interested in and focus on it so hard they know everything about it, and get jobs on that basis.  Figure out which one you are, or you could just play I suppose.


Title: Re: Let's learn to program
Post by: Lantyssa on June 05, 2009, 11:11:22 PM
I like C as a base since so many other languages use similar syntax, and if written properly can translate almost directly to many of those.  I don't know if it is the best to learn on, but no other language has been so important to my understanding of programming in general.  And if you can code in C, then when using something like Perl, PHP, or whatever, you can do some really slick things without much thought.

Whatever language you pick, make some programs that do things of interest to you.  I wrote things like dice rollers and character generators at first.  More recently, things like demon fusion charts for Megaten.  Useful is great, but silly is fine as long as it helps you understand.

General-purpose, professional programmers go to college for it.  Wunderkinds find some area they are interested in and focus on it so hard they know everything about it, and get jobs on that basis.  Figure out which one you are, or you could just play I suppose.
All the programmers I know, and this is only limited to my experience not a scientific study, learned on their own.  College was because businesses like seeing a degree.  Most of the people who learned it in college that I knew couldn't code their way out of a paper bag.  (Likely because they only did what they could for assignments, not messing around on their own, and that's just not good enough to really learn programming.)  Actually I still see it in many of the CompSci grad students my boss gets.  Even the competant ones only care that the code compiles, not that it outputs the correct answer. :uhrr:


Title: Re: Let's learn to program
Post by: Tale on June 06, 2009, 02:28:04 AM
I've got a book called Teach Yourself C++ In 24 Hours :) It was $5 and 600 pages so I bought it for bookshelf laughs.


Title: Re: Let's learn to program
Post by: Quinton on June 06, 2009, 02:37:24 AM
I like C as a base since so many other languages use similar syntax, and if written properly can translate almost directly to many of those.  I don't know if it is the best to learn on, but no other language has been so important to my understanding of programming in general.  And if you can code in C, then when using something like Perl, PHP, or whatever, you can do some really slick things without much thought.

Total agreement here.  Also, C is close enough to the machine that if you learn it even moderately well, you're going to have a better understanding of what really happens under the hood when you use one of those fancy managed languagues.

Quote
All the programmers I know, and this is only limited to my experience not a scientific study, learned on their own.  College was because businesses like seeing a degree.  Most of the people who learned it in college that I knew couldn't code their way out of a paper bag.  (Likely because they only did what they could for assignments, not messing around on their own, and that's just not good enough to really learn programming.)  Actually I still see it in many of the CompSci grad students my boss gets.  Even the competant ones only care that the code compiles, not that it outputs the correct answer. :uhrr:

What I've seen a lot of (at least from when I was busy writing software for a living, while failing out of CompE in the mid 90s) was that the CS dept was pretty focused on teaching "Computer Science", not "Software Engineering."  The result being people graduating with no useful coding skills (ability to work effectively in small teams, understand revision control, have any idea how to debug, etc).  Knowing the theory, algorithm analysis, etc is great, but it's sad that often very little in the way of practical, applied software engineering skills are taught.  Many of the people with CS degrees I know who are good software engineers learned to code despite their CS program, not because of it.

I have worked with people who had never written a line of code until college and still managed to be really good at it by the time the graduated, so it's certainly not impossible.



Title: Re: Let's learn to program
Post by: Miasma on June 06, 2009, 04:35:04 AM
Yeah you have to be careful buying computer books because there are so many and most of them are awful, check reviews and sell rating on amazon etc. first.  If you open up a book and the font is 24pt and the pages are filled with 75% images just put it back down... If it has a cd that is often a black mark too but not too many do that anymore.


Title: Re: Let's learn to program
Post by: Lantyssa on June 06, 2009, 09:04:41 AM
I have worked with people who had never written a line of code until college and still managed to be really good at it by the time the graduated, so it's certainly not impossible.
Oh it's certainly possible to learn it in that timespan.  I just don't think it's (most of) the colleges teaching it.  As you say, they're about theory and not practical applications.  My only decent coding courses were taught by outside lecturers, and they were looked down upon by the faculty.


Title: Re: Let's learn to program
Post by: Tarami on June 06, 2009, 09:11:34 AM
As you say, they're about theory and not practical applications.  My only decent coding courses were taught by outside lecturers, and they were looked down upon by the faculty.
Tell me about it. :oh_i_see:


Title: Re: Let's learn to program
Post by: Quinton on June 06, 2009, 11:00:27 AM
Oh it's certainly possible to learn it in that timespan.  I just don't think it's (most of) the colleges teaching it.  As you say, they're about theory and not practical applications.  My only decent coding courses were taught by outside lecturers, and they were looked down upon by the faculty.

At UIUC, the student ACM chapter was a pretty awesome resource for working with people on fun projects and learning practical hands-on coding skills.  I wasted a ton of time on fun projects with ACM folks.  The EE dept also focused a bit more on small group projects and hands-on stuff.

These days it sounds like a lot of schools are moving to a java-only program for CS, which seems to produce people who often have trouble understanding lower level concepts or working outside of a fancy IDE. 


Title: Re: Let's learn to program
Post by: raydeen on June 06, 2009, 03:49:52 PM
The one thing I really miss these days are periodicals with a half-dozen or so programs in them that you can type in and run. Growing up, we had Compute! and a number of other more specificaly geared mags that offered tutorials, games, apps, etc. that you could learn from. Yes, we do have the internet today, but there's too much temptation for beginners to just copy and paste and get instant gratification. The best thing anyone can do when learning to code is type the thing in themselves. Mistakes will be made, but you become very intimate with the code and learn a lot as you're entering it. It gives you the chance to analyze and examine the code one line or block at a time and gain an understanding  from it that would be lost by just downloading and running it from a file. I remember being blown away by a game I typed in from Antic magazine. I ran it, thought it was pretty good, then realized I didn't remember typing in any of the standard Atari joystick routines. I went back through the listing and found that the author had collapsed what would have normally been 4 to 8 IF/THEN statements into two long logic statemens incrementing or decrementing the player x and y coords simply by checking what the value of the joystick return was. My head assploded and I still use his routine to this day as it's easy to implement in almost any language.


Title: Re: Let's learn to program
Post by: Salamok on June 08, 2009, 08:47:06 AM
When I was in school, the software/application types went the MIS/CIS route and the hardware/device driver types went CS.

Many of the people with CS degrees I know who are good software engineers learned to code despite their CS program, not because of it.

Not sure I would agree with this, I would go so far as to say that all good programmers acquire a ton of knowledge in addition to (including prior to and instead of) what a CS program has to offer.  One of the best sources of added knowledge I was exposed to during my time college was not the educators (internal and external) but the fellow students. 

Plus if left to your own devices you probably would not say gee I want to learn 5 languages in 2 years (or 7 to 8 in 4 years), no you aren't mastering them but the exposure is good and if you have to master them later the foundation will be there.  Not sure if anyone else does this but when I start a new language it is usually with a specific task in mind, this usually results in large holes in my knowledge of that language (in the areas that did not involve my project).  Even an introductory college course would fill in much of that missing knowledge (or at least let you know where the holes are).


Title: Re: Let's learn to program
Post by: Yegolev on June 08, 2009, 09:12:54 AM
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?

Yes and no, because I have not have much time lately.  Also the looming threat of being jobless in October has been wearing away on any creativity I somehow have when not busy with other things (learning how to work with DB2 is on the list, yikes).  Also if I'm going to be released into the wild, I'm inclined to sharpen my existing korn/perl skills rather than get into Windows-land.  So, I'm still interested but my brain is full.  I am hoping that working with PowerShell will help keep the spark in my head, I just need to figure out something to do with it.

My primary problem has been and continues to be the alien object-oriented programming style.  Simply put, I don't know how to design a program before I write it.


Title: Re: Let's learn to program
Post by: Murgos on June 08, 2009, 09:17:20 AM
The main thing to get out of OO, IMO, is simplification through encapsulation.

If you can clean things up by encapsulating it and moving the details to somewhere behind the scenes then great.  If it just makes it more confusing to encapsulate it then don't.


Title: Re: Let's learn to program
Post by: Yegolev on June 08, 2009, 09:26:08 AM
I've started learning C# and made a contact program with the help of a book. Unfortunately, my program doesn't run because SQL Server 2008 Express is convoluted and ridiculously hard to update/install.

I believe this is the Head First C# book, and the first program is excessively flashy if you ask me.  I'm probably going to use that first one as a model for my intended recipe-storage program (one day) but it's not awesome at teaching you anything and kinda makes you :uhrr: when you try to use what you learned right away.  More to get you interested, I think.

If you are looking at books, I'd probably suggest that one and the two C# books by Jesse Liberty, but then again books seem to be as personal as languages.

The main thing to get out of OO, IMO, is simplification through encapsulation.

If you can clean things up by encapsulating it and moving the details to somewhere behind the scenes then great.  If it just makes it more confusing to encapsulate it then don't.

The thing that makes me angry is how I can encapsulate all day long using functions in ksh and perl, but when I start trying to do the same in C# it just gets all :uhrr:.  Most of my perl and ksh have terribly small main sections which are often just a getopts/var settings and series of function calls, but somehow what to have a function do comes easy while "making a Dog object" makes my brain baby kick.

I often have to bang my head on a particular wall before I get things to sink in (like when I first successfully learned ksh) so I'm sure I will get it.  Still pisses me off.


Title: Re: Let's learn to program
Post by: Lantyssa on June 08, 2009, 10:38:43 AM
The thing that makes me angry is how I can encapsulate all day long using functions in ksh and perl, but when I start trying to do the same in C# it just gets all :uhrr:.  Most of my perl and ksh have terribly small main sections which are often just a getopts/var settings and series of function calls, but somehow what to have a function do comes easy while "making a Dog object" makes my brain baby kick.
I have that problem, too.  I never could get C++ to click.  It seemed to complicate my thought process by turning my perfectly good working code into an abstract concept.


Title: Re: Let's learn to program
Post by: Evil Elvis on June 08, 2009, 03:02:46 PM
Here are some good links if understanding OO design is your main goal:

http://www.brpreiss.com/books/opus4/

http://www.dofactory.com/Patterns/Patterns.aspx

http://sourcemaking.com/design_patterns


Title: Re: Let's learn to program
Post by: Murgos on June 09, 2009, 11:34:25 AM
Usually, I would say that the design patterns stuff is just going to confuse and intimidate people who are just learning.  However, C# implements quite a few of the patterns so it might be worth a read through with the caveat that it's something to watch for but don't worry about until you've got WAY more experience under your belt.

Also, I think half the problem people have with OO design isn't the concept it's that every single example of what is good about OO is some super trivial inheritance and encapsulation example that just makes it look like extra work for little or no pay off.

"So, OO means one dog object can have blue eyes and spots and the other dog object can have brown eyes and white fur?"


Title: Re: Let's learn to program
Post by: Yegolev on June 09, 2009, 12:18:36 PM
My particular OO issues are somewhat documented in the Game Dev subforum, but in a nutshell I have a terribly difficult time deciding what needs to be an object.  One great example is if I make a card game, I know I'm going to want to have a Card object from which every particular card inherits methods and properties.  Beyond that, I can't seem to decide if I need only a Deck object which knows how to shuffle, deal, etc. or if I also need a Hand object and what does it need to do?  I'd really like to use this to learn how to properly set up objects instead of dump all my code into one object, UNFORTUNATELY I have realized that I only know how to write a program as a lump and refactor it at certain, later points.


Title: Re: Let's learn to program
Post by: Rasix on June 09, 2009, 12:35:17 PM
My particular OO issues are somewhat documented in the Game Dev subforum, but in a nutshell I have a terribly difficult time deciding what needs to be an object.  One great example is if I make a card game, I know I'm going to want to have a Card object from which every particular card inherits methods and properties.  Beyond that, I can't seem to decide if I need only a Deck object which knows how to shuffle, deal, etc. or if I also need a Hand object and what does it need to do?  I'd really like to use this to learn how to properly set up objects instead of dump all my code into one object, UNFORTUNATELY I have realized that I only know how to write a program as a lump and refactor it at certain, later points.

Nouns, dude, nouns.

Odd, I haven't programmed anything OO in years, and I can see the object breakdown and methods of that clear as day.  Then again, it's how I was taught. 

Getting thrown into C and assembly my third year was harsh.  At least relational databases still felt like home.


Title: Re: Let's learn to program
Post by: Yegolev on June 09, 2009, 12:41:08 PM
That's how I know it's a mental block on my part.  I'll get it one day.  I'm possibly thinking about it too hard.  To that end, I'll probably see what I can write while ignoring OO guidelines; I expect they will make themselves apparent at the proper time.

I also need to remember what my first shell scripts looked like and not get frustrated.  Man, I was doing some inelegant bullshit.


Title: Re: Let's learn to program
Post by: Evil Elvis on June 09, 2009, 04:27:32 PM
It might still be good to look over the GoF Patterns and descriptions.  You'll see a lot of classes named things like DatabasePool, ButtonFactory, CalendarSingleton, etc.  Learning just the purpose of those patterns will give you some good insight into how a class works.

For instance, think of how you would design a program to calculate the cost of a pizza.  You have small, med, large pizza, with cheese, with pepperoni, with meat, etc.  Then go read up on the Decorator pattern, and you'll realize how simple the program would have been if you had used it.


Title: Re: Let's learn to program
Post by: Samwise on June 09, 2009, 04:46:07 PM
A big part of "good" programming is breaking your code into a manageable number of comprehensible chunks.  OO is just one way to do that; one way to look at defining things as objects is as that it lets you bundle a certain chunk of code up so it can be looked at easily when you need to modify it and ignored the rest of the time.


Title: Re: Let's learn to program
Post by: Tarami on June 17, 2009, 06:08:10 PM
Hey folks, how's this going? Any progress?


Title: Re: Let's learn to program
Post by: Yegolev on June 17, 2009, 07:54:32 PM
To the contrary, I continue to learn about SAP on DB2, converting a OS image to use JFS2, the small wonders of NIM on AIX 6.1, and hacking an OS backup image to make it fit somewhere it would not normally fit.  I'm almost looking forward to losing my job.


Title: Re: Let's learn to program
Post by: NiX on June 17, 2009, 08:11:02 PM
To the contrary, I continue to learn about SAP on DB2, converting a OS image to use JFS2, the small wonders of NIM on AIX 6.1, and hacking an OS backup image to make it fit somewhere it would not normally fit.  I'm almost looking forward to losing my job.

No wonder you're so weird and creepy.


Title: Re: Let's learn to program
Post by: naum on June 18, 2009, 08:19:56 AM
To the contrary, I continue to learn about SAP on DB2, converting a OS image to use JFS2, the small wonders of NIM on AIX 6.1, and hacking an OS backup image to make it fit somewhere it would not normally fit.  I'm almost looking forward to losing my job.

SAP? AIX? DB2?

Wow, these platforms still serving live production…

I should not be surprised — the outfit that I spent 8 years at American Express still is running a system (the financial capture system that routes all charges to billing systems and accounts (service establishments) payable) that while rewritten in the 80s, dates further back than that — COBOL, IMS (an IBM mainframe hierarchical DBMS that predates DB2), etc.… Grandiose attempts have been conducted to re-engineer a "modern" solution, but to date, those have been giant money holes with little success… …of course, that department that had 200+ employees (probably 65% FTE and 35% "on-shore" consultants) now has like 1-2 employees with offshore teams in India and some non-immigrant visa workers housed in a body shop just down the road…


Title: Re: Let's learn to program
Post by: Murgos on June 18, 2009, 09:30:15 AM
Knowing what the errors are and how they are caused is often much more valuable than moving to something 'newer and better' and not knowing where the dangers lie.


Title: Re: Let's learn to program
Post by: Yegolev on June 18, 2009, 10:09:43 AM
SAP? AIX? DB2?

Wow, these platforms still serving live production…

These things are being actively developed and supported, if that's what you're commenting on.  Also the hardware it runs on.  I can't speak to the quality of that development and support in the case of SAP. :oh_i_see:  I'm hoping we can get to a point where we can put AIX 6.1 into production since it allows us to move running images from one frame to another.  Now that's fancy!

To your point, The Company has been trying to get rid of the mainframe for over ten years.  Unsuccessfully.  We do keep buying new ones, but replacing the apps is hard.  Same with Teradata.

Knowing what the errors are and how they are caused is often much more valuable than moving to something 'newer and better' and not knowing where the dangers lie.

Very true but also very boring. :awesome_for_real: