• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:00
CEST 14:00
KST 21:00
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists14[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0
Community News
2026 GSL Season 1 Qualifiers12Maestros of the Game 2 announced52026 GSL Tour plans announced14Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid23
StarCraft 2
General
MaNa leaves Team Liquid Maestros of the Game 2 announced 2026 GSL Tour plans announced Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Team Liquid Map Contest #22 - The Finalists
Tourneys
2026 GSL Season 1 Qualifiers GSL CK: More events planned pending crowdfunding RSL Revival: Season 5 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 522 Flip My Base The PondCast: SC2 News & Results Mutation # 521 Memorable Boss Mutation # 520 Moving Fees
Brood War
General
https://www.facebook.com/IonShieldAirPurifier/ ASL21 Strategy, Pimpest Plays Discussions [ASL21] Ro16 Preview Pt2: All Star Data needed BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL21] Ro16 Group D [ASL21] Ro16 Group C [ASL21] Ro16 Group B [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend? Fighting Spirit mining rates
Other Games
General Games
Dawn of War IV Starcraft Tabletop Miniature Game Nintendo Switch Thread General RTS Discussion Thread Battle Aces/David Kim RTS Megathread
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread McBoner: A hockey love story Cricket [SPORT]
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Sexual Health Of Gamers
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1205 users

The Big Programming Thread - Page 628

Forum Index > General Forum
Post a Reply
Prev 1 626 627 628 629 630 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Khalum
Profile Joined September 2010
Austria831 Posts
Last Edited: 2015-05-04 17:01:34
May 04 2015 17:01 GMT
#12541
On May 05 2015 01:32 Artesimo wrote:
When using list/multilinked lists, should I rather make a class that holds the beginning of the list or should I rather keep the first element of the list as an empty element onyl to find the list? I found both ways used, but the last one seemed odd, but maybe there is some performance-benefit.

Also, when it is practical to group the list elements in some sort (like a dictionary with A,B...), should I create a list for each group, or should I rather use one big list, and have pointer to certain elements stored elsewehere, that simly point to certain locations(like "words with C start here"->)? If I want to use one big list, it seem like having a class that holds this information is best.



To answer your first question in a very simple way: If your list looks something like...

class ListElement
{
...
ListElement *next;
SomeType data;
};

...you really just need a ListElement* to be able to access the first element.

That's not an empty element, it is actually the first element. The list exists implicitly as these elements are linked together with the "next" pointers.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2015-05-04 23:37:09
May 04 2015 17:35 GMT
#12542
On May 05 2015 01:32 Artesimo wrote:
When using list/multilinked lists, should I rather make a class that holds the beginning of the list or should I rather keep the first element of the list as an empty element onyl to find the list? I found both ways used, but the last one seemed odd, but maybe there is some performance-benefit.


The head of the list being a blank makes it easier (implementation wise) to do insertions and things at the start of the list. You need special cases if that position is data.

In terms of performance the difference should be negligible.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Artesimo
Profile Joined February 2015
Germany571 Posts
May 04 2015 17:49 GMT
#12543
Thanks, another question:
I found out that c++ also features <list> which seems to do pretty much everything I did by hand. Is there any benefit to not using <list> for a linked list rather than understanding it better buy having build it by hand before?
solidbebe
Profile Blog Joined November 2010
Netherlands4921 Posts
May 04 2015 18:17 GMT
#12544
I think anyone would recommend, implementing it yourself first to understand it better.
That's the 2nd time in a week I've seen someone sig a quote from this GD and I have never witnessed a sig quote happen in my TL history ever before. -Najda
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
May 04 2015 18:22 GMT
#12545
--- Nuked ---
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
May 04 2015 18:23 GMT
#12546
You can implement it yourself to understand it better, but you should use the standard library implementation anyways. It's most likely more optimized and of course most certainly bug-free.
If you have a good reason to disagree with the above, please tell me. Thank you.
Khalum
Profile Joined September 2010
Austria831 Posts
May 04 2015 23:11 GMT
#12547
On May 05 2015 02:35 Blitzkrieg0 wrote:
The head of the list being a blank makes it easier to do insertions and things at the start of the list. You need special cases if that position is data.


I was assuming educational purposes when I answered. In what real-life scenario would you consider using your own implementation and hiding the "special cases" behind a blank first element feasible?

If just using a list was the issue then the obvious answer should be using stl or boost implementations.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
May 04 2015 23:28 GMT
#12548
On May 05 2015 08:11 Khalum wrote:
Show nested quote +
On May 05 2015 02:35 Blitzkrieg0 wrote:
The head of the list being a blank makes it easier to do insertions and things at the start of the list. You need special cases if that position is data.


I was assuming educational purposes when I answered.


I was too which is why I told him why you would write the code with blank elements.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
Last Edited: 2015-05-04 23:41:01
May 04 2015 23:40 GMT
#12549
It's important to know how the list structure actually works in case you ever need to design or implement a data structure similar to it, and so that you use the list itself efficiently. Lists are important foundations for lots of other abstract data structures since they are so basic. To understand a stack or a queue you need to understand lists, and since lists are basic, they can help you understand things like trees too.

To answer your first question, if you are making a list to store strings, I recommend implementation of a trie (where each node is a character, boolean for if the node and its ancestors constitute a word, and an array of 26 pointers) if you have some extra time to code it. If you generally want to store related data in a list-like structure you could make a list of lists.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2015-05-05 14:49:05
May 05 2015 01:41 GMT
#12550
On May 03 2015 12:08 Nesserev wrote:
Show nested quote +
On May 03 2015 11:25 Nausea wrote:
I'm a noob and thinking of trying to put together a bejeweled game to learn from. (In c++)
I just thought I might ask here what container i may want to use for the jewels, since I guess I will have to remove and move and add stuff very often.


I think most people tend to go for a 2-dimensional std::vector/array, or perhaps even a map with pairs as keys.

Personally, after having dealt with 'quadrants'(?) far too many times, I think the best option (clean, flexible, most optimal) would be writing your own class that provides all your needs, around a one dimensional std::vector< ... >. It makes iterating rows/columns very easy and clean, and you can just use pointer/iterator arithmetics.

Note that the only case that it's not very good at, is expanding the quadrant in both dimensions. (EDIT: Then you should prefer a 2D vector.)

Show nested quote +
On May 03 2015 08:20 Blisse wrote:
From my experience, should be documenting code while you write it before you have and before you complete code reviews. Code + technical design documents should be enough to explain why the code exists the way that it does. Never really saw the point in excessive documentation except for very important files (because that way when I see a file with a couple long paragraphs at the top I know that it's important).

What are you documenting that takes so long?

I never skip the inline comments, which help a lot during the coding process itself, or organizing/chaptering the code, but when I just want to continue coding, I postpone writing the class and method descriptions, code examples, etc. until later.

I guess I might be a little bit guilty of excessive documentation. It's not like I document the most menial of details, but I tend to write documentation for the user of the classes, and developer/maintenance separately; and when I do, I pretend that the other person is a 5 year old.

I don't think that it's a lot of documentation, it's just that I tend to get annoyed with it really fast. If only documentation was as fun as coding, or well... you could say it's part of coding, just the boring part :S


In my opinion, I think your usage of the code should generally be enough of an example of *how* to use it. Exceptional circumstances of the call of the code should be documented of course, and it depends really on what the code does, but you *really* shouldn't have code paths that are *never* executed when you put the code up for code review/commit, so your usage of the code should document all the possible usages. So the usage of the code should generally be documented by the code itself. Again, with additional *function* level comments to document exceptional/complicated/contextual parts. If the structure of "why" something happens isn't clear, there may be a clearer way to implement it... if not then really you really need the comments, but I don't think that should happen that often during the coding practice.

Actually not a super fan of descriptive function names unless that function is actually used more than once now, a bit of a change from before.

It's a bit harder to explain developer/maintenance separately. I think the normal practice is to message/include the owner of the code previously during the code review and before starting to change the code, or coding in pairs, or similar, but I agree a good idea is explaining the reason for any non-obvious design choices.
There is no one like you in the universe.
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
May 07 2015 18:51 GMT
#12551
How important is it to have a personal website if you are planning on going into software (not necessarily web) development? I'm thinking about making one so that I can have a place to talk about/link/host my projects, show off/practice web dev skills, and put up a brief resume. It would be cool to have an email address @ my name too, I imagine
Ben...
Profile Joined January 2011
Canada3485 Posts
May 07 2015 18:59 GMT
#12552
On May 08 2015 03:51 Chocolate wrote:
How important is it to have a personal website if you are planning on going into software (not necessarily web) development? I'm thinking about making one so that I can have a place to talk about/link/host my projects, show off/practice web dev skills, and put up a brief resume. It would be cool to have an email address @ my name too, I imagine

I made one. It's usually quite cheap/free to run and can just act as a sort of hub for career stuff. I kept my site quite simple. It has my resume, a small "about me" section, a simple blog that I basically never use (I threw it together quickly in Django just to see how Django worked), and a page that details a couple of projects I've done. Nothing fancy.

But yeah, I mostly use my domain so that I have an email that isn't a gmail or thing like that.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
GwSC
Profile Joined December 2010
United States1997 Posts
Last Edited: 2015-05-07 21:44:49
May 07 2015 21:43 GMT
#12553
Hey for anyone that is familiar with CS undergrad classes (most people here probably), how bad of an idea would it be to take these classes at the same time, assuming like 15-20 hours working also? Just in terms of time required in general. 16 week semester.

Object Oriented Programming and Design (major core class, like a mid level thing)
Systems Programming and Unix (same as above)
Introduction to Discrete Structures
Calc 2

I was sort of thinking I might need to drop one. These seem like they all might be classes that take up 15-20hrs/week but I'm not sure.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
May 07 2015 21:53 GMT
#12554
It's not "important" but it's a nice thing to have that just shows potential employers you're a bit more than averagely interested in technology. Plus having your own domain email is nice.

I do it to blog and because web design is fun.
There is no one like you in the universe.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
May 07 2015 22:13 GMT
#12555
On May 08 2015 06:43 GwSC wrote:
Hey for anyone that is familiar with CS undergrad classes (most people here probably), how bad of an idea would it be to take these classes at the same time, assuming like 15-20 hours working also? Just in terms of time required in general. 16 week semester.

Object Oriented Programming and Design (major core class, like a mid level thing)
Systems Programming and Unix (same as above)
Introduction to Discrete Structures
Calc 2

I was sort of thinking I might need to drop one. These seem like they all might be classes that take up 15-20hrs/week but I'm not sure.


You should talk to some students at whatever university you are attending. If all three of those classes involve a lot of coding then you probably don't want to take them at the same time, but a student who has taken them would know much better than people on the internet.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Ben...
Profile Joined January 2011
Canada3485 Posts
Last Edited: 2015-05-08 00:49:49
May 08 2015 00:48 GMT
#12556
On May 08 2015 06:43 GwSC wrote:
Hey for anyone that is familiar with CS undergrad classes (most people here probably), how bad of an idea would it be to take these classes at the same time, assuming like 15-20 hours working also? Just in terms of time required in general. 16 week semester.

Object Oriented Programming and Design (major core class, like a mid level thing)
Systems Programming and Unix (same as above)
Introduction to Discrete Structures
Calc 2

I was sort of thinking I might need to drop one. These seem like they all might be classes that take up 15-20hrs/week but I'm not sure.

Find out everything you can about the professors. Find out how intense the coursework is. Find out how many hours a week you will actually need to commit to doing well in the class. If you OO class is anything like mine was, it shouldn't be too bad. Just don't put things off and you'll be fine.

I did two terms (one this year, one last) of 4 CS classes per term. It's definitely possible to do so, but again it depends entirely on the prof. My Operating Systems class had more homework than 2-3 other CS classes combined while some of my more theoretical CS classes I could get away with simply doing the readings an hour before class and then committing an evening or two to the homework every couple weeks and do just fine in them. It all depends on the professor and the amount of work they want you to do.

You need to find out specifics. If one of those classes is a pushover then yeah, you can probably take all 4. If all 4 require a lot of work, then it might be wise to take only 3 or else your average could take a big hit.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
Last Edited: 2015-05-08 01:51:27
May 08 2015 01:50 GMT
#12557
On May 08 2015 07:13 Blitzkrieg0 wrote:
Show nested quote +
On May 08 2015 06:43 GwSC wrote:
Hey for anyone that is familiar with CS undergrad classes (most people here probably), how bad of an idea would it be to take these classes at the same time, assuming like 15-20 hours working also? Just in terms of time required in general. 16 week semester.

Object Oriented Programming and Design (major core class, like a mid level thing)
Systems Programming and Unix (same as above)
Introduction to Discrete Structures
Calc 2

I was sort of thinking I might need to drop one. These seem like they all might be classes that take up 15-20hrs/week but I'm not sure.


You should talk to some students at whatever university you are attending. If all three of those classes involve a lot of coding then you probably don't want to take them at the same time, but a student who has taken them would know much better than people on the internet.

That doesn't seem so bad because it's just four classes. I don't think OO is very bad at all (in terms of difficulty of understanding, of course your professor could assign a ton of work) and discrete, at least where I go, has a reputation for being easy. Calculus II has a reputation that I think is unwarranted; its difficulty is mostly dependent on your preparedness and ability with math. Can't speak to your Unix course

I'm going to echo what others said and tell you that you should ask former students and look online to see how muck work they are.

Doesn't seem so bad, but then again I don't work 15-20 hr per week. If you aren't accustomed to going out on weekdays it seems manageable.
zatic
Profile Blog Joined September 2007
Zurich15365 Posts
May 08 2015 08:45 GMT
#12558
Wanted to deploy a small app on Google Cloud Platform. Can anyone confirm it's not available for individuals in Europe/EU? (only for business)
ModeratorI know Teamliquid is known as a massive building
phar
Profile Joined August 2011
United States1080 Posts
May 09 2015 03:50 GMT
#12559
What part of Google Cloud Platform?
Who after all is today speaking about the destruction of the Armenians?
zatic
Profile Blog Joined September 2007
Zurich15365 Posts
May 09 2015 07:19 GMT
#12560
On May 09 2015 12:50 phar wrote:
What part of Google Cloud Platform?

As far as I can tell, any, but app engine in my case.
ModeratorI know Teamliquid is known as a massive building
Prev 1 626 627 628 629 630 1032 Next
Please log in or register to reply.
Live Events Refresh
Afreeca Starleague
10:00
Ro16 Group D
Barracks vs Leta
Royal vs Light
Afreeca ASL 17266
StarCastTV_EN386
Liquipedia
GSL
08:00
2026 Season 1: Qualifiers
herO vs Rogue
Maru vs SHINLIVE!
Solar vs Zoun
Cure vs TriGGeR
IntoTheiNu 426
CranKy Ducklings SOOP205
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko247
TKL 151
Rex 29
StarCraft: Brood War
Britney 26143
Calm 14343
Jaedong 6379
Sea 5808
BeSt 1595
Rush 1149
Horang2 829
Pusan 497
Mind 340
Zeus 263
[ Show more ]
Hyuk 239
JYJ 180
Larva 157
ToSsGirL 119
Sharp 117
ggaemo 86
Sexy 56
[sc1f]eonzerg 53
Sea.KH 52
Killer 29
Bale 27
Noble 25
Shine 22
Icarus 18
SilentControl 18
GoRush 12
Sacsri 11
JulyZerg 10
Movie 9
Terrorterran 6
eros_byul 1
Dota 2
Gorgc4312
League of Legends
Reynor57
Counter-Strike
zeus1190
x6flipin515
shoxiejesuss423
edward302
markeloff134
Super Smash Bros
Mew2King123
Heroes of the Storm
Trikslyr122
Other Games
singsing2057
B2W.Neo375
Happy287
crisheroes253
XaKoH 216
QueenE51
Organizations
Dota 2
PGL Dota 2 - Main Stream6667
PGL Dota 2 - Secondary Stream6276
StarCraft: Brood War
UltimateBattle 316
StarCraft 2
WardiTV54
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• StrangeGG 3
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• TFBlade1518
Upcoming Events
WardiTV Map Contest Tou…
31m
herO vs Classic
SHIN vs Cure
Solar vs Percival
RSL Revival
22h 1m
Replay Cast
1d 12h
The PondCast
1d 22h
KCM Race Survival
1d 22h
WardiTV Map Contest Tou…
1d 23h
Gerald vs TBD
Clem vs TBD
ByuN vs TBD
Rogue vs MaxPax
ShoWTimE vs TBD
CranKy Ducklings
2 days
Escore
2 days
RSL Revival
3 days
WardiTV Map Contest Tou…
3 days
[ Show More ]
Universe Titan Cup
3 days
Rogue vs Percival
Ladder Legends
4 days
uThermal 2v2 Circuit
4 days
BSL
4 days
Sparkling Tuna Cup
4 days
WardiTV Map Contest Tou…
4 days
Ladder Legends
5 days
BSL
5 days
Replay Cast
5 days
Replay Cast
5 days
Wardi Open
5 days
Monday Night Weeklies
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-04-20
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
WardiTV TLMC #16
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W4
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
RSL Revival: Season 5
2026 GSL S1
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.