• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 07:25
CEST 13:25
KST 20:25
  • 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
TL.net Map Contest #22 - Voting & Ladder Map Selection1Code S Season 2 (2026) - RO8 Preview4[ASL21] Finals Preview: Two Legacies21Code S Season 2 (2026) - RO12 Preview2herO wins GSL Code S Season 1 (2026)7
Community News
StarCraft II 5.0.16 PTR Patch Notes may 26th108Weekly Cups (May 18-25): MaxPax wins doubles0Crank Gathers Season 4: BW vs SC2 Team League5Weekly Cups (May 11-17): Classic wins double1Code S Season 1 (2026) - RO8 Results2
StarCraft 2
General
StarCraft II 5.0.16 PTR Patch Notes may 26th The death of cheese, from a professional cheeser. TL Poll: How do you feel about the 5.0.16 PTR balance changes? Changing from 12 to 8 is just asking for StarCraft Weekly Cups (May 11-17): Classic wins double
Tourneys
Crank Gathers Season 4: BW vs SC2 Team League RSL Revival: Season 5 - Qualifiers and Main Event GSL Code S Season 2 (2026) Maestros of The Game 2 announcement and schedule ! Sparkling Tuna Cup - Weekly Open Tournament
Strategy
[G] Having the right mentality to improve
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
The PondCast: SC2 News & Results Mutation # 528 Infection Detected Welcome to the External Content forum Mutation # 527 Hell Train
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Soma's ASL Finals Review FlaShFTW vs A.Alm Grudge Match Event VPN experiences OGN to release AI-upscaled StarLeague from Feb 24
Tourneys
[ASL21] Grand Finals [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2 [BSL22] WB Final & LB Semis - Saturday 21:00 CEST
Strategy
Any training maps people recommend? Muta micro map competition [G] Hydra ZvZ: An Introduction Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
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 Russo-Ukrainian War Thread Trading/Investing Thread Things Aren’t Peaceful in Palestine Dating: How's your luck?
Fan Clubs
The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books
Sports
McBoner: A hockey love story 2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
Esportsmanship: How to NOT B…
TrAiDoS
Why RTS gamers make better f…
gosubay
ramps on octagon
StaticNine
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1861 users

The Big Programming Thread - Page 37

Forum Index > General Forum
Post a Reply
Prev 1 35 36 37 38 39 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.
EscPlan9
Profile Blog Joined December 2006
United States2777 Posts
Last Edited: 2011-02-13 22:27:49
February 13 2011 22:27 GMT
#721
JGrasp is incredibly simplistic and lacks a lot of convenience functionality. However, it is the easiest to use for basic applications. However, I do not recommend it for anything GUI based - it requires manually defining every portion.

I never tried out Eclipse, but when I worked with my group creating a multi-threaded network-based blackjack application, one guy created the GUI straight from Eclipse. Or it may have been JavaBeans? Anyways, definitely not with JGrasp. (I coded the logic and deck handling/manipulation portion of the program using JGrasp though.)
Undefeated TL Tecmo Super Bowl League Champion
Disregard
Profile Blog Joined March 2007
China10252 Posts
February 13 2011 22:35 GMT
#722
Eclipse by far, though the interface takes some getting used to but it has great functionality.
"If I had to take a drug in order to be free, I'm screwed. Freedom exists in the mind, otherwise it doesn't exist."
jsmith
Profile Joined January 2011
United States18 Posts
February 14 2011 00:21 GMT
#723
Ya right now I am not doing anything GUI based, just some basic console applications.
Kambing
Profile Joined May 2010
United States1176 Posts
February 14 2011 01:46 GMT
#724
On February 14 2011 06:07 jsmith wrote:
you guys got any suggestions for a good ide to do java in? is it pretty much just use eclipse?


Yup as mentioned, Eclipse is the de facto standard for "real" Java development. If you program in Java, you'll eventually want to learn how to use eclipse.

If you're starting out with programming or just want to streamline your learning before moving onto Eclipse, then a lightweight IDE like the aforementioned JGrasp or an educational IDE like DrJava (my recommendation) or BlueJ would also be appropriate. DrJava is particularly nice because of the interactive window that lets you quickly experiment with Java language constructs.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2011-02-14 02:08:40
February 14 2011 02:01 GMT
#725
Does anyone have a recommendation for an IDE for Python? I currently use Komodo, but it's very weird.

And anyone have any advice for the Canadian Computing Competition? I have to write it on March 1. And I have to relearn Python by then. I don't expect to make it to the Second Stage, where you must use Java and C, so Python is fine.
There is no one like you in the universe.
wO-ZiGouNeT
Profile Joined January 2011
United Kingdom21 Posts
February 14 2011 09:31 GMT
#726
http://www.wingware.com/ is pretty decent, I've only used the free version but the debugger is pretty much all I ask for from an IDE.
snpnx
Profile Joined February 2010
Germany454 Posts
February 14 2011 09:36 GMT
#727
On February 14 2011 06:07 jsmith wrote:
you guys got any suggestions for a good ide to do java in? is it pretty much just use eclipse?

Yeah, it's pretty much Eclipse.
Another good IDE which I wonder why it wasn't mentioned is NetBeans.

Both are good, Eclipse is a bit better in my eyes, but Netbeans might be a bit easier if you just start with java.
"Language is Freeware, in that it's free to use, but it's not Open Source, so you can't just change things how you like."
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
February 14 2011 22:04 GMT
#728
On February 14 2011 18:31 wO-ZiGouNeT wrote:
http://www.wingware.com/ is pretty decent, I've only used the free version but the debugger is pretty much all I ask for from an IDE.


Ugh. Not Wing again.
I went to Komodo to get away from Wing.
There is no one like you in the universe.
wO-ZiGouNeT
Profile Joined January 2011
United Kingdom21 Posts
February 14 2011 23:09 GMT
#729
Notepad++ / emacs to edit the source, wing to debug xD Haven't used it since uni tho, I don't get to enjoy working with python : /
jaydubz
Profile Joined February 2011
21 Posts
February 16 2011 00:28 GMT
#730
So I've returned to C++ after first learning it 3 years ago to work on a personal project and I've ran into a problem.

I've created three classes. For simplicity we can call them class a, class b, and class c. The problem is each one contains the other (causing a circularity issue, from what I understand).

i.e.:

class a contains a private member: c obj

class b contains a private member: a obj

class c contains a private member: b obj

Currently, using Dev C++ and trying to compile this won't work. This is because each class contains a class that hasn't been defined yet (from what I understand). Need someone to dumb down how to go about solving this problem. I can supply the header files if needed.
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
February 16 2011 00:36 GMT
#731
It looks like a problem in the design of your solution.

I think having the headers would help us to help you.
"When the geyser died, a probe came out" - SirJolt
Chaosu
Profile Joined October 2005
Poland404 Posts
Last Edited: 2011-02-16 00:43:57
February 16 2011 00:42 GMT
#732
im sure that putting:

class c; //this initiates the class for the compiler

class b;

start defining class a then b then c

will get you rid of some compiling errors but im not sure if this will solve problem entirely. of course you have to friend classes for access to their privates
Please be patient.
jaydubz
Profile Joined February 2011
21 Posts
Last Edited: 2011-02-16 01:16:07
February 16 2011 01:01 GMT
#733
Found source tags.

+ Show Spoiler +
#ifndef exit_h
#define exit_h

#include "location.h"
#include "exitList.h"
#include <string>
using namespace std;

class exit
{
private:
string direction;
location leadsTo;
public:
//public stuff
};
#endif


+ Show Spoiler +
#ifndef exitList_h
#define exitList_h

#include "exit.h"
#include "location.h

class exitList{
struct node{
exit data;
node link;
} *p;
public:
//some public stuff
};
#endif


+ Show Spoiler +
#ifndef location_h
#define location_h

#include <string>
using namespace std;

#include "exit.h"
#include "exitList.h"

class location
{
private:
string title;
string description;
exitList * exits;
public:
//some public stuff
};
#endif


As for friend, adding setter/getter functions for all private members would eliminate this need I believe?
Chaosu
Profile Joined October 2005
Poland404 Posts
February 16 2011 01:36 GMT
#734
well i put that code in devc++ and merged those headers into one file and friended exit and exitList to location i only got those errors:

in class exitList:
'exit' does not name a type
field 'link' has incomplete type

+ Show Spoiler +
#ifndef combined_h
#define combined_h

#include <string>


using namespace std;

/*class exitList;
class exit;
class location;*/

class location
{
friend class exit;
friend class exitList;
private:
string title;
string description;
exitList * exits;
public:
//some public stuff
};

class exit
{
private:
string direction;
location leadsTo;
public:
//public stuff
};

class exitList{
struct node{
exit data;
node link;
} *p;
public:
//some public stuff
};



#endif


so your "circularity" issue is fixed, but you need to declare your classes and structures a bit better, not going to help you now because its 230 AM and im going sleep
Please be patient.
jaydubz
Profile Joined February 2011
21 Posts
Last Edited: 2011-02-16 02:02:25
February 16 2011 01:54 GMT
#735
Well, the error
'exit' does not name a type
is the error I'm currently receiving, among others (most likely because of exit class not compiling).

It seems combining them still maintains the issue: location contains an exit list, which contains an exit, which contains a location, etc.

If I declare
class exit; class exitList;
prior to declaring
class location{ }
the order of the errors change but the error still persists.
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
Last Edited: 2011-02-16 02:59:51
February 16 2011 02:47 GMT
#736
Ok, I figured out your problem I guess.

Its a design problem. You have the class Exit which I believe represents an exit of a location.

The thing is, the attribute leadsTo of the class Exit is highly dependent on what location are you currently in. This way leadsTo actually would have to have 2 values at the same time.

For example, if there are Location A and B, and an Exit E which links both locations, the value of E.leadsTo depend where you are currently. If you are in A, leadsTo point to B, if you are in B, E.leadsTo points to A.

You could solve it by having 2 attribute leadsTo in the Exit class, however it wont solve your design problem as a whole.

The other problem is that you wrote 2 unnecessary classes: Exit and ExitList.

A Location is nothing more than a room with its attributes (title, description) and a list to other locations (the exits). So a class describing an exit is redundant and caused you the crossed references.

It is hard for me to explain it with text, and even harder when I try to put my thoughts in english, so I hope you can understand me by just looking at the classes I wrote below, which I believe should solve your problem from a design standpoint.

+ Show Spoiler [LocationData.h] +

#ifndef ___LOCATIONDATA_H___
#define ___LOCATIONDATA_H___

class LocationData {
public:
LocationData();

private:
std::string mTitle;
std::string mDescription;
};

#endif


+ Show Spoiler [LocationList.h] +

#ifndef ___LOCATIONLIST_H___
#define ___LOCATIONLIST_H___

#include "LocationData.h"

class LocationList {
public:
LocationList();

private:
LocationData mData;
LocationList mNext;
};

#endif



Hope it helps!

Edit: thinking again, I think what I did does not solve your problem at all , but I won't delete the post since it could give you a hint or something.
"When the geyser died, a probe came out" - SirJolt
djcube
Profile Blog Joined July 2009
United States985 Posts
Last Edited: 2011-02-16 07:04:09
February 16 2011 06:56 GMT
#737
EDIT- sorry for the clutter! I've thought up a possible solution.
jaydubz
Profile Joined February 2011
21 Posts
February 16 2011 11:48 GMT
#738
The exit list class is just a linked list I designed. I did this because the std list I was originally trying to use would not play nicely when trying to append. I probably needed to overload a few operators to get it working but I felt it would be better practice to create my own data structure.
Frigo
Profile Joined August 2009
Hungary1023 Posts
Last Edited: 2011-02-16 14:12:07
February 16 2011 14:02 GMT
#739
On February 16 2011 09:28 jaydubz wrote:
I've created three classes. For simplicity we can call them class a, class b, and class c. The problem is each one contains the other (causing a circularity issue, from what I understand).

Predeclare your classes and use member pointers instead of member variables. Just think about it, what is the size of class A if it recursively contains itself?

Split each of your (non-template) classes to a header file (.h or .hpp) and an implementation file (.cpp). Predeclare the class in the header file before you include anything to guarantee all required types are known, and are at least incomplete types. Use member pointers or some smart pointer like shared_ptr instead of member variables then. You can't use incomplete types to instantiate, as member variables or calling their functions, and in a lot of cases, as template arguments. However you can use them as pointers and member pointers. This makes circular references between classes possible. In fact, this is the best way. It is possible to solve the problem with template trickery, but it is MUCH more difficult and messy.

You can include only headers and compile cpp files separately then link them together (the nice way), or just include cpp files after header files (mostly used for template classes, in case they are split at all).

+ Show Spoiler [A.h] +

#ifndef A_h
#define A_h

//
// predeclarations
//

class A;

//
// includes
//

#include "C.h"

//
// class A
//

class A
{
public:
A ();
virtual ~A ();
double someFunction () const;
[...]
protected:
C* c;
};

#endif



+ Show Spoiler [A.cpp] +

#ifndef A_cpp
#define A_cpp

#include "A.h"

A::A () :
c (new C())
{
[...]
}

A::~A ()
{
delete c;
}

double A::someFunction () const
{
c->doSomething();
}

#endif



+ Show Spoiler [C.h] +

#ifndef C_h
#define C_h

//
// predeclarations
//

class C;

//
// includes
//

#include "B.h"

//
// class C
//

class C
{
public:
C ();
virtual ~C ();
double someFunction () const;
[...]
protected:
B* b;
};

#endif



+ Show Spoiler [C.cpp] +

#ifndef C_cpp
#define C_cpp

#include "C.h"

C::C () :
b (new B())
{
[...]
}

C::~C ()
{
delete b;
}

double C::someFunction () const
{
b->doSomethingOrAnother();
}

#endif


B similarly...
http://www.fimfiction.net/user/Treasure_Chest
dvide
Profile Joined March 2010
United Kingdom287 Posts
February 16 2011 15:20 GMT
#740
First thing, you don't need to include exitList.h in exit.h. You never mention exitList directly in that file. In exitList.h you don't need to include location.h. In location.h you don't need to include exit.h.

Now, in location.h you're including exitList.h which itself includes exit.h (ignoring the fact that you're including exit.h directly anyway). If you follow the logic of that, in location.h you're using the class location before it is even defined (by including exit.h, which uses location). What you should do is remove the include to exitList.h here and instead replace it with a forward declaration of the class (i.e. class exitList;). Where you include exitList.h is in location.cpp instead.

The reason you can break the circular dependency here and not elsewhere is because you're actually using exitList*, not an exitList itself. So this means any translation unit that includes location.h doesn't actually need to know the full definition of the class exitList (except for location.cpp, because here you'll actually create the exitLists). It only needs to know that there exists a class by that name, which is what you achieve with the forward declaration. By using the forward declaration, you're promising that there exists a definition of the class in another translation unit to be linked in. If you fail to provide it somewhere else you'll get a linker error instead of a compile error.

I hope that makes sense as to why you're getting this problem.
Prev 1 35 36 37 38 39 1032 Next
Please log in or register to reply.
Live Events Refresh
Wardi Open
11:00
#89
IntoTheiNu 579
WardiTV329
Rex25
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko392
Ryung 287
Rex 25
StarCraft: Brood War
Horang2 2724
Mini 874
Jaedong 659
actioN 498
Soma 307
EffOrt 267
Rush 220
Backho 197
Leta 192
Zeus 183
[ Show more ]
Pusan 143
Light 129
Soulkey 126
ToSsGirL 103
Dewaltoss 97
PianO 71
Liquid`Ret 50
ZerO 48
hero 37
Aegong 28
sSak 27
sorry 27
[sc1f]eonzerg 25
Shine 24
JulyZerg 18
IntoTheRainbow 16
Sacsri 15
soO 14
zelot 13
Movie 10
Noble 9
Dota 2
Dendi578
XaKoH 505
XcaliburYe127
League of Legends
JimRising 337
KnowMe40
Counter-Strike
olofmeister3850
byalli678
allub206
edward61
Other Games
singsing1652
B2W.Neo622
Pyrionflax207
Mew2King58
ZerO(Twitch)2
Organizations
Counter-Strike
PGL211
Other Games
BasetradeTV178
StarCraft: Brood War
UltimateBattle 36
lovetv 18
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis4062
• Jankos1756
Upcoming Events
Monday Night Weeklies
4h 35m
Replay Cast
12h 35m
Sparkling Tuna Cup
22h 35m
WardiTV Spring Champion…
23h 35m
Maestros of the Game
1d 4h
The PondCast
1d 22h
Kung Fu Cup
1d 23h
uThermal 2v2 Circuit
2 days
Maestros of the Game
2 days
Replay Cast
2 days
[ Show More ]
Replay Cast
2 days
WardiTV Spring Champion…
2 days
Maestros of the Game
3 days
Replay Cast
3 days
uThermal 2v2 Circuit
4 days
Maestros of the Game
4 days
Replay Cast
4 days
Solar vs Classic
uThermal 2v2 Circuit
5 days
GSL
5 days
herO vs Rogue
Maru vs Cure
uThermal 2v2 Circuit
6 days
BSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

KK 2v2 League Season 1
RSL Revival: Season 5
Heroes Pulsing #1

Ongoing

BSL Season 22
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
CSCL: Masked Kings S4
YSL S3
SCTL 2026 Spring
WardiTV Spring 2026
Maestros of the Game 2
2026 GSL S2
Murky Cup 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026

Upcoming

BSL 22 Non-Korean Championship
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
uThermal 2v2 2026 Main Event
Heroes Pulsing #3
Heroes Pulsing #2
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 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.