|
Because data structures hold half of the logic of any program. Get them wrong and the code starts becoming strange and convoluted: necessary data not available in places where it should have been, redundant data around (which may lead to partially updated data and very hard to find bugs), overly complex modules and functions whose only usefulness is passing structures around.
Worse if one gets the classes wrong. Classes must work on their data so what they hold and how they hold it is of paramount importance.
EDIT: I forgot mentioning algorithms and drivers. If you work on these you absolutely need proper data structures due to communication / protocolo / timings / space constraints. While most of the "modern" developing isn't done at this level (and it shows) those are still the backbone of everything we work on.
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
den2k88 wrote: EDIT: I forgot mentioning algorithms and drivers. If you work on these you absolutely need proper data structures due to communication / protocolo / timings / space constraints. While most of the "modern" developing isn't done at this level (and it shows) those are still the backbone of everything we work on.
The kids should start with programming PLCs or microprocessors. Then they would know about the importance of such things.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
They should, even if processing power seems unlimited at the moment - after all 640kB of ram should be enough for anybody!
To stay on the consumer side, videogames are processing and memory hogs and they are a growing industry. Enter the Enterprise (not THAT Enterprise, the other) and you'll find yourself with barely the processing time to do anything beyond the basics, especially if on-the-fly analysis are to be taken on real time systems.
Of course these are fields of which the usual QA-abusing developer used to clunky messes of frameworks and interpret-virtualiz-clouding thingies ignore the very existance. And rookies, of course, but that's not their fault, it still takes 10 years to make 10 years of experience.
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
den2k88 wrote: after all 640kB of ram should be enough for anybody! I am not that old... I already had 1024 Kb But still had to deal with 64 Kb DataBlocks and 1-byte counters for sequence steps (max 255 of whatever).
Edit: this[^] is the new version of my favorite one. I have used the previous model for some years and still 1 Mb RAM
den2k88 wrote: To stay on the consumer side, videogames are processing and memory hogs and they are a growing industry. Mostly due to graphics, special effects. Not necessarily due to careless programming.
den2k88 wrote: you'll find yourself with barely the processing time to do anything beyond the basics, especially if on-the-fly analysis are to be taken on real time systems. You know... C and C++ are obsolete
den2k88 wrote: the usual QA-abusing developer QA-abusing... what? Are you calling them developers? if you mean the !"%$"§(/&% morons wannabe programers (we are in the lounge, not the soapbox) visiting the QA section... they will need 100 years to have 10 years experience.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
modified 18-Nov-16 8:54am.
|
|
|
|
|
Nelek wrote: Mostly due to graphics, special effects. Physics, actually. Ballistic trajectories (and still many weapons are hitscan), obstacles interference, walking/jumping/running/swimming/flying calculations for NPCs and players. Then there is the AI and the generation/keeping in readily accessible memory huge sets of relevant environment variables and decision made by the player to adjust the entire world reactions.
I'm using as examples big open sandbox games like The Elder Scrolls, Fallout and The Witcher series, but even highly compartimented games like Mass Effect and Deus Ex have a lot of computations to make that aren't graphically related.
Quote: Not necessarily due to careless programming. I never said that, in fact gaming industry is one of the most demanding out there and careless developers usually last for very very short times. Still some games are careless developed / designed, in my mind Crysis series and the first The Witcher were excessively demanding despite being about the same quality of much less onerous games.
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
If this is for class, and the instructor has specified the language, not much you can do besides slog through it.
However, if the instructor has NOT specified the language, then you could spice up your studies by trying to implement them in a new language! I'm mostly a C# and JS developer and I've been learning Data Structures on my own, but I'm writing mine in C++.
|
|
|
|
|
Funny, I have the opposite problem. Once I implement what I consider to be "fundamental", I can't bring myself to add gold plating such as a user interface.
Anyway, what initially drew me to data structures was the awesome things you can actually do with them, perhaps that can inspire you too.
|
|
|
|
|
I'd expect a software developer to know what data structure to use in which situation. I've known people who will "just use a vector" with no due consideration to anything else. I think it sucks to work with such careless/lazy people.
If someone doesn't have the common sense to choose an appropriate data structure, they'll not like working with me. If someone didn't know as much to make the right choice from a vector, unordered set, queue, stack, list, etc. then they need to urgently educate themselves.
In short, you don't need to implement every kind of data structure, but you should at least know which one to pick from the standard library.
|
|
|
|
|
Awesome. I think I just needed to find the right instruction source and implementation. I found a book that is now working for me and I'm finding it much more interesting/fun to implement the data structures in C++ than C# or Java, mainly due to how pointers work.
|
|
|
|
|
Good on you for accepting critical feedback and working on it! I don't come across people like you ever so often.
|
|
|
|
|
Thanks. And I appreciate your post. Sometimes I need a kick in the right direction, which is also why I ask these types of questions. I try to follow this advice:
I am the smartest man in Athens because I know that I know nothing. - Socrates
|
|
|
|
|
They make life so much more pleasant.
I would often model them, at least to begin with, after a table row in a database.
It's a handy place to move and store the data around the system as a unit. Also, if you add or removed columns from said tables, you only need to change the definition of the structure to accommodate this (and, of course, handle the new data) - but all their data transport throughout your code still works as before without a change.
And you can build structures of structures - and move major blocks of data about (should the need arise) - yet have each component neatly wrapped by a recognizable name.
Maybe you'd like them better if you thought of them a bit like a record in a table.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
TheOnlyRealTodd wrote: I'd rather spend 5 hours coding and have something to show, rather than re-create an intangible data structure that already exists in the standard library, just for the sake of it (or erm... class).
I think the point of the exercise (or at least would be, if I were teaching a class on data structures) is several. Data structures can be complicated, you have to handle edge cases, consider where your performance issues are, often in tradeoffs between a performant search vs. a performant insert/delete, how do you test not just the simple operations and edge cases, but how do you test performance and memory utilization, etc.
In other words, it's a good exercise to bring to consciousness things that we rarely think about because, as you said, these things already exist, so why rewrite them? But the lessons learned are applicable in general programming, and that's important, IMO.
I also think one of the more fun things about data structures is using (or creating) the right structure for the particular task. When I was working on a multi-threaded solution to solve a complex end-of-life analysis of the switch ring topology in communication satellites, I realized there were times when a canned data structure was great, and other places where I needed a custom data structure of the same information, just organized differently. While maintaining both data structures took more memory, that was irrelevant (the memory usage was not the issue here) but what was relevant was the significant performance improvement by using the right data structure for the particular algorithm.
Marc
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
TheOnlyRealTodd wrote: I'd much rather write unit tests and design patterns!
You lost me there...
|
|
|
|
|
|
I love being at the bottom of the abyss
DURA LEX, SED LEX
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
Yeah, it's a much better place to dwell!
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy.
|
|
|
|
|
Vunic wrote: Quite a bunch of my friends know nothing other than C & Assembly.
I need to make friends like this. Seriously. I've had quite a struggle meeting these types of programmers versus web devs. Web dev stuff is everywhere, not so much lower-level. I feel I could learn a lot from these people.
In any event, thanks so much for your insight, it was very helpful! And yes, I meant to say "DS & Algorithms" . My course is simply called Data Structures & Performance, but that is what is really is. Also, Big O and asymptotic notation, and even most of the math I get (and enjoy) pretty well... Its just doing things like crafting up routines to add/remove/replace etc... Data from a structure that can seem a little dry at times. I think it's just a matter of time, but honestly, the advice here has helped a lot and I want to thank everyone for replying!
|
|
|
|
|
must be the most buggy piece of software to have darkened my PC ..... EVER .....
I have spent hours building a small video from last weekends desert camping, and it just constantly crashes, messes up content etc.
I have got to the point where I am exporting the content to final video file, and it screws up the overlays with blank spaces, or flakes out or whatever....
I have had to do machine reboots, restarts, forced closes you name it.
|
|
|
|
|
That's strange. I'm using that version witout any problem...
It works on my machine
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
great.........can I borrow your machine then!
|
|
|
|
|
Sure, just pop around. Bring !
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Can you not come here, a) it is warmer, b) I have beer and c) I'm sure the beer is cheaper than having to buy it over there when I arrive, can't take it with me!
|
|
|
|
|
DaveAuld wrote: c) I'm sure the beer is cheaper than having to buy it over there when I arrive, can't take it with me!
You can bet on it... alcohol is very expensive over there.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
DaveAuld wrote: a) it is warmer
Are you kidding me? That's an adjective I've never heard connected with Scotland before!
Wet, yes! But warm?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|