Jump to content

Amateur Programming Study


Osvir

Recommended Posts

I know. It's just... NULL just sounds so negative :(

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein
 

Link to comment
Share on other sites

Pfft, I always called them "null terminated strings" /hipster :p

 

Well, hardly hipster to use the correct term. The character at the end isn't zero no ? :p

 

Came across this day, might be interesting to some and is remotely relevant to this thread - http://wordaligned.org/articles/two-star-programming

 

Made me realize how much of my C is rusted.

Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good education to appreciate it. - Edsger Wybe Dijkstra

Link to comment
Share on other sites

Pfft, I always called them "null terminated strings" /hipster :p

 

Well, hardly hipster to use the correct term. The character at the end isn't zero no ? :p

 

Came across this day, might be interesting to some and is remotely relevant to this thread - http://wordaligned.o...tar-programming

 

Made me realize how much of my C is rusted.

 

Heh, pointers to arrays of pointers. That was common practice on the Commodore Amiga :thumbsup:

 

Good old Linus, always wondered what became of him. We didn't use Linux as case study at the University though, we used Minix (Tanenbaum) instead.

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein
 

Link to comment
Share on other sites

I've been so ingrained with OO programming it's funny how much more involved my solution would likely have been... lol.

 

That'd be called over-engineering lad. Avoid it. and use KISS all the time.

I came up with Crate 3.0 technology. 

Crate 4.0 - we shall just have to wait and see.

Down and out on the Solomani Rim
Now the Spinward Marches don't look so GRIM!


 

Link to comment
Share on other sites

That'd be called over-engineering lad. Avoid it. and use KISS all the time.

 

Can you come work here, please? :p

 

We have some classes written with methods like

 

class Adder {

 

public int add ( int x, int y )

{

return x + y ;

}

 

}

  • Like 1

Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good education to appreciate it. - Edsger Wybe Dijkstra

Link to comment
Share on other sites

That'd be called over-engineering lad. Avoid it. and use KISS all the time.

 

Can you come work here, please? :p

 

We have some classes written with methods like

 

class Adder {

 

public int add ( int x, int y )

{

return x + y ;

}

 

}

 

#define Adder(a, b) (a + b)

 

Ok, there is such a thing as over simplifying :biggrin:

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein
 

Link to comment
Share on other sites

Well that can be useful if you later want to sabotage it by defining it as ( a - b ) :D

Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good education to appreciate it. - Edsger Wybe Dijkstra

Link to comment
Share on other sites


Well, hardly hipster to use the correct term. The character at the end isn't zero no ? :p

Well, null is typically a  0 byte, so it's still a fair term IMO :p

 

 

That'd be called over-engineering lad. Avoid it. and use KISS all the time.

 

But think of how extensible it'd be!  You could easily add new alternatives, new menu items, even new days!  The versatility!

 

Ultimately my laziness contributes to the KISS.

 

 

One thing I learned for sure was to not code extra features that people may use in the future.  Let whomever needs said feature add it :p

Link to comment
Share on other sites

 

 

 

That'd be called over-engineering lad. Avoid it. and use KISS all the time.

Can you come work here, please? :p

 

We have some classes written with methods like

 

class Adder {

 

public int add ( int x, int y )

{

return x + y ;

}

 

}

 

#define Adder(a, b) (a + b)

 

Ok, there is such a thing as over simplifying :biggrin:

 

Fortunately my knowledge of good ol' cstdlib helped me dissect some of the helper functions for some of the aspects of Frostbite.  I don't know the full reasoning, but I know some of them are replicated (IIRC it's so that it probably uses our memory manager in a way that we have ultimate control over.  Fun things like small block allocators and whatnot).

 

I remember working stupid hours over Christmas for DA2 trying to isolate some situations that were leading to some grotesque situations of memory fragmentation on the PS3 =]

Edited by alanschu
  • Like 1
Link to comment
Share on other sites

I was raised in the belief that NULL is less than nothing. It's emptier than an empty string and more zero than zero. Usually used to indicate that a the nature of a value hasn't been given yet (usually done first time it's referenced, even if it's just assigning zero or an empty string to it).

 

Ah yes, memory allocations. Pointer exercises are a good way of becoming familiar with low level CPU architecture. Nothing like 'Segmentation Fault' to tell you that you forgot to initialize a pointer in your array of pointers :p

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein
 

Link to comment
Share on other sites

I still remember my first exposure with C++, while also on Linux.  My first year was with Java which had built in Exception Handlers.  The C++ was using g++ on a console.

 

Try running application:

 

"Segmentation Fault?"

 

WTF does that mean!?  Off to google.

 

Although ironically, I learned to love it.  "A hard crash!  This should be easy to find!"  I remember doing an AI course and it was my first exposure to C (and my good friend malloc and free).  We were given some skeleton code, and I failed to realized I had accidentally used the wrong variable while iterating over the memory block, and clobbered the crap out of it.  My free() call led to some bizarre "glibc" error and I had no idea wtf was causing it.  Fortunately some combing with a fine tooth comb found the problem, but yeah... sometimes I loves me a solid IDE and debugger!  Haha.

 

 

Also:

[i was raised in the belief that NULL is less than nothing. It's emptier than an empty string and more zero than zero. Usually used to indicate that a the nature of a value hasn't been given yet (usually done first time it's referenced, even if it's just assigning zero or an empty string to it).

 

I'd agree, but looking at the raw registers and memory words we know this isn't true ;)

Edited by alanschu
  • Like 1
Link to comment
Share on other sites

Pointer heavy programs and GDB back in school gave me such good memories.  Granted being up at 3 AM eagerly watching changes in some random address or using my hands drawing in the air the way the pointers link up isn't everyone's idea of fun. 

Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good education to appreciate it. - Edsger Wybe Dijkstra

Link to comment
Share on other sites

Don't understand anything of that Zeckul but it looks interesting :D

It's F#, a functional programming language. Once you have a good idea of procedural and object-oriented techniques, it can very enriching to learn about functional techniques as well. Take your time. :p

Link to comment
Share on other sites

This is the sloppy structural diagram I did, put it together rather quickly. Misunderstood the first assignment from last week. I need to finish one of the assignments (the travel planner) but when I've done (tomorrow presumably) I'll post the new assignment (Just one this time).

post-44542-0-81170000-1358772446_thumb.jpg

~as I said, pretty sloppy :p

Link to comment
Share on other sites

installn?   Is that word mean installing?     Can really understand the diagram......sigh (Oh, sorry, I'm off topic.)

I have struggle to understand a Universe that allows the destruction of an entire planet. Which will win this endless conflict - destruction or creation? The only thing I know for certain is never to place your faith entirely on one side. Play the middle if you want to survive.

 

Everyone else is a fanatic. I am Gauldoth Half-Dead. Your savior.

Link to comment
Share on other sites

Inställningar = Options

I'm Swedish, so understand if it's non-understandable.

Start = Not off

-> Lista = Menu of options
-> 1-5 = gives different types
-> 1 -> start game -> playing game -> 2, getting points/score
-> 2 -> Look at your points/score
-> 3 -> Help (How to Play)
-> 4 -> Options -> Into game
-> 5 -> Quit

-> Playing game -> Winning/Losing -> Continue? Y/N
-> Y -> Start Over
-> N -> Quit

Edited by Osvir
Link to comment
Share on other sites

  • 2 weeks later...

Hi! So I was super enthusiastic about this and really wanted to do this, unfortunately no more.

I don't feel the need to go into anything of it but let's just say external factors made stuff bad for me. Sorry, but this thread can be closed/deleted and/or used by someone else who is interested or whatnot.

Thanks for helping out, although it was brief, and letting me use this place :)

Link to comment
Share on other sites

Hi! So I was super enthusiastic about this and really wanted to do this, unfortunately no more.

 

I don't feel the need to go into anything of it but let's just say external factors made stuff bad for me. Sorry, but this thread can be closed/deleted and/or used by someone else who is interested or whatnot.

 

Thanks for helping out, although it was brief, and letting me use this place :)

 

Sorry to hear that Osvir :(

 

Maybe we'll just leave the thread for now. You never know, somebody might resurrect it some day and share some questions and answers about algorithms.

“He who joyfully marches to music in rank and file has already earned my contempt. He has been given a large brain by mistake, since for him the spinal cord would surely suffice.” - Albert Einstein
 

Link to comment
Share on other sites

Edit: Assuming your ultimate goal is amateur game development...

 

Personally, I think if you just want to play around with game creation then ground-up isn't the way to go in this day and age. I consider C++ a middle-level language and if your intention is to build graphics APIs or 3D engines then, yea, that would be the way to go. But, as I'm sure any of the actual developers here can tell you, creating full fledged game engines from scratch is a huge endeavor. These guys have been building personal knowledge on game tech for the last two decades at least. They're already hardened C++ engineers who know the APIs, the platforms, the graphics pipelines, the instructions and shader languages for the GPUs, and the quirks and inconsistencies of all of the above. All that said, it takes a team of these people years to hammer out a full-featured engine. And, I don't even want to get started on digging up your calculus book for the mathematics involved.

I know, what's my point?

Like it or not, I think we've entered the era of Application Level game development. Let the engine guys do the boiler-plate code and figure out the ins and outs of various platforms and GPUs. With engines out there like Cry, Unreal, Source and especially Unity, there's little reason to revisit what teams of experienced developers are already doing. Think of it this way: You're trying to learn gcc and makefiles in the age of Visual Studio and Eclipse. Am I saying don't learn good programming techniques? No. But, I am saying you don't need to learn console tic-tac-toe to mess around and experiment with 3D game development. So, pick up a good book on Javascript :x or C# and go through the basics in an IDE. Most of the beginners books that I have seen will give you solid starting programmer skills. (Check the reviews.) These books obviously won't cover advanced algorithm design, but you're not exactly going to be writing sort algorithms for system libraries either. If you are shown good basic coding skills you're not likely to need more unless you actually started working on huge coding projects. After that, you can download Unity and actually start attaching scripts to primitives and cameras and see some of the fun stuff. Later, download Blender and make some models for Unity. That has really been the hard part for me as I'm not much of an artist. And the technical details! UV maps, baking, oddly placed edges, N-gons... who the hell knew things had come so far from Elite's wire frame models! I want a program with a big button that says "Make Spaceships", "Make Skyboxes", "Make Terrains", "Make Humaniods" and then a textbox where you enter the number you need. :grin:

 

With an IDE like Unity it shouldn't be difficult to make some silly basic game in a few months of spare time. I say basic because if you intend to make something near the complexity of an RPG there will be a ton more involved. The one piece of advice I ran across consistently for amateur game developers is do not make an RPG your first project. There's far more going on in the background than I expected. So, I've been working on a space shooter, hopefully along the lines of classic Start Raiders and it's more than enough hobby for me to chew on at my skill level.

 

Unity tutorials are all over the place...

 

Edited by Luridis
  • Like 1

Fere libenter homines id quod volunt credunt. - Julius Caesar

 

:facepalm: #define TRUE (!FALSE)

I ran across an article where the above statement was found in a release tarball. LOL! Who does something like this? Predictably, this oddity was found when the article's author tried to build said tarball and the compiler promptly went into cardiac arrest. If you're not a developer, imagine telling someone the literal meaning of up is "not down". Such nonsense makes computers, and developers... angry.

Link to comment
Share on other sites

What do I think has changed most in programming over the past 30 years? Tools. In 1983, toolkits and libraries with high-level prepackaged things were just starting to emerge. So whatever you were doing, you'd have to start from very basic things. You'd be re-inventing wheels every time you go.

This has changed completely. Nowadays by far the most code is written against high-level libraries that package very complex things behind simple-to-use interfaces. So if you're designing a user interface, you won't have to start by designing a "menu" or "input field." You'll just pick the one you want -- say, a date input field with a dropdown calendar which formats the date according to the locale and lets you set or get the value as a Date object -- from the framework you're using. You'll only resort to low-level "old-school" programming where it's absolutely needed, for example to open up bottlenecks that slow down your program, or in specialized teams that do work close to the hardware -- drivers, kernels, some embedded systems and such.

 

The principles and practices are still the same, though. Almost all of Alan J. Perlis's epigrams are just as applicable now as they were when he wrote them.

I have a project. It's a tabletop RPG. It's free. It's a work in progress. Find it here: www.brikoleur.com

Link to comment
Share on other sites

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
×
×
  • Create New...