Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Springy

Question for source port developers.

Recommended Posts

Well software developers in general. Over the past two years of college learning programming etc I have never fully got to grips with a language (Visual Basic sort of). My question is, what do you guys do to help understand code? I ask of this because all of this time I haven't really understood much (even tutorials as well as college) I do understand data types and functions but it's just placing the knowledge into a far wider environment is what I don't get. So can anyone offer me any tips or advice for helping to understand code a little more in depth, please?

Share this post


Link to post

In my experience, college programming courses are way too abstract and not nearly practical enough. I don't know that writing a program that spits out prime numbers is going to be very useful for making a source port or some other practical application. Not only that, but these courses take a very long time to teach you what you could probably figure out in a few months with some determination and focus.

I would recommend tinkering. Grab something like the ZDoom source code and play around with it. Try to figure out what's going on in areas (some areas may be more difficult than others) and try making some subtle changes. Wanting to do something and figuring out how to do it is far valuable than being spoonfed abstract concepts you probably don't care about and probably aren't all that useful anyway. Anything else you additionally want to know ("What the hell does 'virtual' mean?!") can be supplemented with something called "The Google".

Share this post


Link to post

Can you give me an example of a situation? It sounds like you're trying to read other people's (poorly commented, I assume) code and understand what it's doing. This is pretty much what I do for a living.

Share this post


Link to post

I hear you. I'm still trying to figure out how I managed to take a semester-long operating systems course that left me knowing next to nothing more about operating systems. Granted, I thought that it might have been relegated to my college specifically, since the professor who teaches the course is a mathematics PhD, so everything was formula and abstract theory rather than concrete, practical information.

If you've not taken a software engineering course, do so when you can. They get you involved with a team and you make a product as would be done in the industry. It's far more useful and informative.

Share this post


Link to post

I find what you learn in those software engineering courses is you suck at software engineering. Loads of fun though! Group projects teach you how hard it is to get anything done unless you're working with very compatible people. In the real world you get around this by having a lot of process or very modular projects.

As for learning to write programs, the best way is just to do more of it. Carnevil's suggestion works well for learning things, but if you want some confidence then find something that looks like it's just outside your ability and make it. You'll have to learn something new, but hopefully not too much at once. Then make it better, either by refining it or adding functionality.

If you know Visual Basic 6 then switch to using .NET. If you know VB.NET then switch to C# (it's the same thing with syntax closer to Java and C/C++). It's still free, so you're set.

Share this post


Link to post

College and university never made anyone into a good programmer. The only way to get good at it is by doing it yourself on your free time while working on projects that you personally are interested in.

Share this post


Link to post

Once you understand a few languages, find some well-documented open source projects that you take apart so you can see all of the bells and whistles inside. The only programming class I've taken is beginning Visual Basic, so I had to teach myself Python, C and C++.

I've just begun to scratch the surface by playing around with different libraries. I'm leafing through Ogre3d's source code at the moment and reading the tutorials.

It's a long shot from knowing what I'm doing or being able to make my own games, but I think that's how one makes a start.

Share this post


Link to post

The approach used in old home computer BASIC books worked for me: simple programs-examples, with immediate practical results, and longer type-in programs distributed with magazines, that challenged you to enter it all before you could play a game, understanding more of it as you neared completion ;-)

It did help that most home computers in the past came with a BASIC interpreter and you could enter some commands/statements right away after the split-second boot. Today it's all much more complicated, and the "entry barrier" to coding (especially to "profitable" one) is much, much higher.

Share this post


Link to post

Write code, read code, modify code, debug code. Rinse, repeat.

That's all there is to it, really. The more you work with code, the better you'll get at understanding it. With enough practice, you'll be able to "mentally compile" code as you read it.

If you want a shitty analogy, imagine it like learning to play guitar. We can give you some tips on best practises that might save you time, but in the end you're not going to get anywhere unless you're plucking those strings.

Jodwin said:

College and university never made anyone into a good programmer. The only way to get good at it is by doing it yourself on your free time while working on projects that you personally are interested in.

This a thousand times. You'll only ever learn a tiny amount from doing programming courses.

Share this post


Link to post
Carnevil said:

Grab something like the ZDoom source code and play around with it.

Well… I would always download something like the Doom, ZDoom or Quake source code, and be faced with these issues:

- Not having the proper development application for the work (wrong Visual Studio version, or needing Borland C for DOS)
- Lacking many header files enclosed in angle brackets (such as <values.h>), thus resulting in hundreds of compile errors (and a few fatal linker errors to boot).
- Doom — my favourite game — managing to have the source code for a strange operating system (Linux), so I can't just edit it right away.

I actually learned to edit actual game code from Wolfenstein 3D. Head over to their forums, because those dudes are usually reprogramming the game directly to make their game mods. In that case, you can get all the tools you need to modify the Wolfenstein 3D source code, provided you follow the tutorials in their forums.

Share this post


Link to post
printz said:

Well… I would always download something like the Doom, ZDoom or Quake source code, and be faced with these issues: [issues]


That a hundred times, aka the "but it compiles on my computer" scenario. Source code distribution != complete development environment. Having the source to something is usually enough to get the gist of what is being done/pinpoint that algo you were wondering about/answer your "How the HELL did they do X in Y?" questions, but if you want to actually build the thing, you'll have to fill quite a few gaps yourself.

"Portable" code is just a myth in most cases: anything that requires more than gcc <source.c> to compile WILL cause trouble. Enter the wonderful world of proprietary compiler extensions, nonstandard libraries, proprietary IDEs, proprietary project/build managers etc.

The threshold for what you'd consider "nonstandard" or "proprietary" is also a moving target: e.g. in the 90s, on DOS, seeing #include "conio.h" on top of a C program might have been perfectly acceptable, as Borland was the booty daddy of DOS development. Today, it just spells trouble. Similarly, I shudder whenever I stumble upon some ancient utility with a source code in C and the dreaded makefile....yeah, THAT will surely work today!

Share this post


Link to post

Hmm, I do have ZDooms 2.5.0 code and Wolfensteins as well so I'll probably check them out. To answer a question from earlier an example would be transferring what I learned about making simple problem solving programs into making a program that's actually considered useful.

Share this post


Link to post
Springy said:

To answer a question from earlier an example would be transferring what I learned about making simple problem solving programs into making a program that's actually considered useful.

What you could do is to follow a set of simple steps:
- Determine what you need to have done (the real world problem)
- Find out how you could solve that problem with software (on a very high, non-technical level)
- Find out how you could implement that software from a technical standpoint
- Write code

To give an example, some years ago I had made a small program for studying the Japanese kana-characters (requires .Net 2.0, I think). The real world problem was just that: How can I memorize the characters as effectively as possible?

My answer was to have a program that asks you which each character is in a rapid fashion, while also letting you choose which characters to study. Someone else might have come up with a different design, but that's what I stuck to. After the program was planned out, I checked any possible implementation-related question I may have had and started coding.

If you're going to do anything even remotely more complex than that you'll benefit from a more elaborate design phase. But for small and simple programs meant to solve very specific problems you can easily cut some corners during design.

Share this post


Link to post

You've already gotten some good advice (specifically from Carn and fraggle), but I want to emphasize that it's less important that you focus on learning how to program, and more important that you focus on wanting to program. If you've got a problem you legitimately want to solve (like Jodwin's kana app), you'll be motivated to program and learn some things incidentally. Once you get over the hump of being able to glob programs together, you'll start wondering if there aren't better ways to do it, and then a lifelong journey to attain programming enlightenment will begin :) .

Share this post


Link to post

While I agree that university courses won't make anyone a great programmer, I think that being aware of algorithm complexity is extremely important. This is something that amateurs tend to miss.

Share this post


Link to post

I have been a programmer for more than half my life.

Programming is a mindset. If you cannot place your mind into the state of a programmer, then you shall fail. You need to feel the code you write, feel the instrinsic nature of the lines. After much practice, concentration, and dedication you will be able to devise entire algorithms to solve problems in an instant. You will see code develop before you. Problems you previously thought unsolvable will be solved. You will look at normal life things and think to yourself "I could do that in less than 100 lines.".

I have tried myself to go to college to take programming, but that was nothing. I could teach the class more efficiently than the teacher, and on one occasion I actually did teach the class. And despite the class being devised of people who couldn't write a Hello World from a tutorial written in a book, they learned fast. Of course, despite being highly ranked (90+) I nearly got kicked out of the class. I only got a few 100s though, the points I lost was using my existing knowledge when the rest of the class did not learn it yet. Most of the students came to me for help, and I explained the details to them.

Currently, I long for the days where I programmed every waking moment of my life for 2 years straight. I would wake up, take a piss, eat, program, fall asleep, repeat through all the months of the year without ending. Morning to night, sunset to dawn, it never ended.

And during my two years programming, I saw everything in code. All my thoughts were code, from making a meal to going about my daily activities.

While in school, everyone would think I did drugs because my eyes would be bloodshot. But it was not from drugs, it was from being tired staring at the screen without blinking for 17 hours.

However, these days I do not program daily as I liked to due to my job. Your job will always get in your way of programming. My ability has weakened, but it still exists. Rather instead of always seeing it, I can use it as needed. So rather it is more controlled, rather than being a Tetris Effect.

But, if you have a passion for programming, then it will change your life.

But all is not lost to the original question, you need to set your mind to your goals and let nothing stop you from obtaining them. The road will be rough, and the mountains will be high, but if you push through it you will do it.

Share this post


Link to post
GhostlyDeath said:

A very inspirational piece.

Okay so I can see that college hasn't really been of much use to people. It is more of a thing that one has to be in the mind set for and to do in ones spare time. Half a day straight for a year? I've always been told that short bursts and revision would help but I really admire how dedicated you are.

It's just I want to really be able to code not just for fun but to also be able to create software that will not only entertain people, but also provide a program that will make people's lives easier and to also hopefully be able to code for a job (hopefully in the gaming industry). So if I understand correctly, most of you learned from just looking at existing code and doing practical work with a focused mind set? I would like to thank you all for providing very helpful answers.

Share this post


Link to post

When learning, you need to use the best method of how you learn. This varies from person to person. Think back in school to how the teachers taught you rather than what they taught you. If you had trouble learning from some teachers in school because you failed to understand them, then do not learn from how they teach. Also think about how you've learned through life, and choose the best way there.

One advantage you will have is if you can figure out languages easily. Initially, when you see code, some people will see a pattern while others will see complete garbage. If you see a pattern then you have an advantage. If you can look at something and think of how it is built, then that will help you. Everyone is different, so how you learn will probably never would have worked on myself, and vice versa.

A big tip on programming is that you never be lazy or careless. Always care about the code you write, because if you do not care then that code and the way you code will haunt you and you will never improve. Always write good code from the start the best you can, if you know of a better way to do it, then do that instead. Because if you start out being lazy and careless, then your entire programming career will be lazy and careless. So this means you will be debugging and fixing much more code than you really need to. I have seen projects fall into oblivion because of this. Although sometimes, you may code something programmers call a "Quick hack" or a "Proof of concept", which is a small, not so thought out, and buggy program which serves a single purpose. It is usually best to not base any code off this type of program and to do it seriously after you have proved such concepts.

Share this post


Link to post

College was actually of enormous use to me. The programming classes themselves where it's like "Learn this language" not so much, but the higher theoretical courses, and specific application courses, can be extremely useful to establish background and understanding in various realms of computer science. Some of the most useful classes I took:

  • Theoretical Foundations of Computer Science - State machines/automata, formal grammars, set theory and maps.
  • Object-oriented Design and Visual C++ - Basics of OO programming combined with practical applications and experience working inside Visual C++. Priceless course for me, have used what I learned there ever since.
  • File Structures - pretty obvious.
  • Data Structures and Algorithms - here's where I learned the critical tools of the trade - linked lists, trees, hash maps, priority queues; knowledge of algorithmic complexity metrics.
  • Design of Computer Systems - learned low-level crap in here, including MIPS assembly. Very useful for learning how to think like a machine.
  • Software Engineering - understanding of cost estimation, documentation, design, requirements determination, experience working as part of a team - shit that can get you hired when it shows up on your resume.
  • Relational Database Design with Oracle PL/SQL - this one course alone got me my current job.
Plus, outside of computer science itself, you have required courses such as linear algebra. You're not going to do one iota of game programming without as much of that crammed into your head as will fit.

Share this post


Link to post

Where did you go to school, Quasar? Seems that your professors were teaching a hell of a lot more than mine were. That and your school seems to be offering a much better selection of classes to take.

Share this post


Link to post

Linear algebra? I'll have to look into that. I'm on my second college now and I haven't learned any algebra since upper school. I did learn some web developing in my old course as well (PHP, java, MySQL) and found that with that teacher (especially in the first year) I could learn really well from the way she taught.

Share this post


Link to post

For 2d tetris/pong/etc type games I didn't need any linear algebra pretty much, when using pygame/python. Only time I needed trigonometry (sohcahtoa type stuff) was mainly for rotating an object around another one or something (and I'm pretty sure a "rotation matrix" was optional for that, if that's linear algebra since I still don't know it). I did manage to make 'planets' that orbit around planets that orbit around planets once, all with simple short sine/cosine/sohcahtoa/bla functions. Such functions can pretty much be googled/copied, but understanding is another story (most explanations lost me but when I found the right animation with a point orbiting around a circle and verticle/horizontal lines constantly drawn to the center it was immediately clear in a gif-is-worth-a-thousand-words type of way). Learning is often like that; sort through lots of crap explanations/teachers (which often have better seo) until you find a good buried explanation.

For me, I liked making visual game-like stuff. There was an immediate reward when you got it working and I was genuinely interested in it. Almost all of the visual stuff was similar so I had to make some basic umbrella "template" code. Making that first template is a pain in the ass because you have to look everything up. But once you have a template with all the right import statements, and a timer and a while 1 loop with basic handle-events/display-the-data/alter-the-data blocks, then you can copy/paste this template to each next "project" without having to think about that crap anymore. But for me a "project" was a simple single-page program. Of course the pygame library was imported and did a lot of it.

Find a forum for your language/library and randomly solve other people's problems for practice and ask questions when stumped. Lots of people posted their homework problems which were fun to solve for practice making tricky nested loop code and such ("homework" can actually be fun when not compulsory, taking place 2 hours drive away and tested by an authority in wrong rote-memorization type ways that ultimately make it take longer to learn and get in your way of learning. If I feel like I want to move on to another problem then I will at my own pace without being negatively "graded". I hate school which is also why I enjoyed solving the homework of slaves that had to go there). I still suck at making long complex code or efficient fast code, and haven't actually coded for like a year+.

Share this post


Link to post
Membrain said:

Where did you go to school, Quasar? Seems that your professors were teaching a hell of a lot more than mine were. That and your school seems to be offering a much better selection of classes to take.

Oklahoma State University. It does have a pretty decent ComSci program, as well as an MSIS department from which ComSci majors can take electives. I should probably mention I graduated in '02 though. I'm sure a lot has changed since then.

Share this post


Link to post

Most of the subjects mentioned by Quasar are, in practice, covered by just one to three courses, depending on how heavily CS oriented the school is.

E.g. don't expect to find a stand-alone course called "File Structures": in practice, this will be a chapter in a programming course focusing on one language (though then it would more properly be file I/O, e.g. FORTRAN courses have a fetish for it, and "records" :-D ).

Quasar said
Relational Database Design with Oracle PL/SQL - this one course alone got me my current job.


That ^ It seems the only thing that still "flies" in the market nowadays is anything having to do with web services, databases (in particular persistence frameworks) and, in particular, MVC frameworks (e.g. Spring, Struts etc.).

Stuff that DOESN'T currently pay out: numerical computing, computer graphics etc., unless you manage to land a position in game development, research or academia. The problem is that game development is pretty much the CS equivalent of wanting to be an actor, a singer or, in general, a celebrity: there certainly are glamorous "superstars" in this domain, but most debutants will struggle to make end meets IRL if they don't take up another day job. And there are no shortcuts and stepping stones such as taking part in a reality show.

Research & academia positions have their own quirks. Generally speaking, you won't exactly strike it rich in such positions, and they tend to make very poor "previous experience", as they are very out-of-line with the mainstream market. If you ever land such a job, try keeping your skills current with what happens "outside": your future employers might not appreciate your 1000s of FORTRAN and MATLAB lines of code as much as you think.

If you are after a day job that offers a reasonably standard career evolution, then the free market is currently more interested in "web" and "business" computing, and today this hardly means Excel spreadsheets. Databases, CMS, Web development etc. is where it's at. Of course, this means that, since everybody and the cat self-labels as a web developer, competition literally spawns all continents and is fierce.

Mobile development is another possibility: most "mobile apps" are essentially surrogates for a particular company or service's website, replicating certain functionalities in a way that appeals/works better on mobiles than webpages with a fuckton of JavaScript. However, if mobile browsing becomes more efficient, a lot of those custom apps will wither and die.

Share this post


Link to post

For myself, learning to program was a lot of reinventing the wheel. To many, that may seem terribly inefficient, but I never really took any formal programming courses and so I was largely self-taught. For me, the primary introduction to programming was through BASIC books from the 70s and 80s. I was able to use those books to learn the basics (no pun intended) of programming, and once I got the fundamental concepts down, it was really just me trying to figure out better ways of doing things. I basically taught myself how to better organize my code, I taught myself many tricks to improve simplicity, to improve performance, etc. I never really learned much from other people saying, "You need to write code like this." Heck, I really struggle to read other people's code. It's more like, "Okay, I'm tired of doing like this, what would be an easier and quicker way of accomplishing my goal?"

Now I'll be the first to admit that I'm no expert in the field of programming. Like I said, I can't read other people's code, and I've never really been able to fully grasp the concept of object-oriented programming. However, for what I can do, I can basically do it as simply as I speak English. Having rediscovered so many basic principles of programming on my own, it really has become a second language, and it doesn't even matter what specific programming language it is. Sure, I might have to learn a new syntax or something, but the algorithms and whatnot I need just come naturally to me now. Actually, I haven't even programmed in a good long while, but if I needed to write something, I'm still confident that the approach would just come to me as naturally as speaking.

Of course, that's just the way I learn. Naturally, that doesn't apply to everyone, and heck, it may not apply to anyone but me personally.

Share this post


Link to post
Jodwin said:

College and university never made anyone into a good programmer. The only way to get good at it is by doing it yourself on your free time while working on projects that you personally are interested in.


I only have a community college degree in programming, but I program vb asp.net and form programs as my current job. This is extremely accurate. You need to practice and practice and practice. If you're not employed in something related to programming, then pick some useful thing as an idea, and make it yourself--or remake some basic OS program. Even something like making your own calculator or income/expenses program can be useful and a good tour into problems you may have never had to research/overcome.

I got most of my knowledge by simply being handed huge libraries of code with NO COMMENTS AT ALL and told to modify them heavily. It was really the best way to learn for me though, because I had to backtrack and understand data flow.

Share this post


Link to post
eargosedown said:

I only have a community college degree in programming, but I program vb asp.net and form programs as my current job. This is extremely accurate. You need to practice and practice and practice. If you're not employed in something related to programming, then pick some useful thing as an idea, and make it yourself--or remake some basic OS program. Even something like making your own calculator or income/expenses program can be useful and a good tour into problems you may have never had to research/overcome.

I got most of my knowledge by simply being handed huge libraries of code with NO COMMENTS AT ALL and told to modify them heavily. It was really the best way to learn for me though, because I had to backtrack and understand data flow.

Thank you for the input, I'll practice remaking programs as I can see that helping me out a lot. You learnt from no comments? I sometimes have trouble even with the comments in.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×