• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 18:44
CET 00:44
KST 08:44
  • 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
[ASL22] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win0Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down23ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1
StarCraft 2
General
[D] Hacker peak in sc2 ? No more SC2 streamers on team liquid? Liquibets sc2 season 30 Evil Geniuses - shutting down Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win
Tourneys
SC4ALL: II Venue Change Announcement! Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20)
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[G] How to playtest arcade maps Starcraft 2 Advance [D] the control group Simple Questions/Answers
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Rollback Netcode in Brood War SC4ALL: II Venue Change Announcement! Ziemie's Starcraft 1 Prequel Campaign 🇺🇦 Ukrainian StarCraft:BroodWar community reborn
Tourneys
[$1250] International ShieldBattery League [Megathread] Daily Proleagues Small VOD Thread 2.0 KCM Race Survival 2026 Season 4
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Dating: How's your luck? Trading/Investing Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8693 users

The Big Programming Thread - Page 549

Forum Index > General Forum
Post a Reply
Prev 1 547 548 549 550 551 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.
Catch]22
Profile Blog Joined July 2009
Sweden2683 Posts
November 21 2014 16:12 GMT
#10961
Does anyone here have any experience with programming in X++ for MS Dynamics? Or just MS Dynamics in general? I have been interviewed for a job as a Dynamics developer and thought I'd find out what peoples opinions of it is.
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
November 24 2014 16:52 GMT
#10962
Heh, got another cool project to work on. Was just casually browsing the code to see what I'm dealing with:

Controllers: there's this giant class called Base, everything is there. There are also 2 other classes, which are similarly large and all they do is override methods in the Base and provide hacks for it...

Great code: $something = $someObject->someMethod == 'something' ? $someOtherObject->someOtherMethod : $yetAnotherObject->yetAnotherMethod; repeated 27 times within the same scope... Some super long password encryption/decryption method with $salt = '12345678'; (when will people finally discover password_hash and password_verify?)

Standards: PSR? Never heard of it. SOLID? Can you do me one?

And some of the methods in the base/hack classes? They're overriding parts of methods and invoke the same method from parent in random places (as in: function func() { parent::func(); }).

Now I'm trying to fix a bug which should be super simple but I have 3 methods that try to do the same stuff, each one does it differently though and they're bouncing it back and forth between each other.

Also, fuck WordPress.

Thank you for hearing my woes. It helps immensely.
Time is precious. Waste it wisely.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
November 24 2014 17:12 GMT
#10963
the big programming thread is a reliable shoulder to cry on.
conspired against by a confederacy of dunces.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 24 2014 17:18 GMT
#10964
sounds like pain, kinda the reason why i stay in c# wpf/store land, everything's so well defined and there are guidelines, not like ios land where everything is a controller...
There is no one like you in the universe.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-24 17:49:50
November 24 2014 17:28 GMT
#10965
And some of the methods in the base/hack classes? They're overriding parts of methods and invoke the same method from parent in random places (as in: function func() { parent::func(); }).

is this really a hack though?
thought that was the decorator pattern or something
regardless seems like it could be a useful technique in many scenarios.

oh, but if it's just overriding and then not adding any new functionality, then yeah, i don't get that.
small example with a nice c++11 feature: inherited constructor.

#include<iostream>
#include<string>
#include<utility>
using namespace std;

struct poster{
template<class... arg>
poster(arg&&... a):name(std::forward<arg>(a)...){}
string name;
virtual void
disagree(const poster& p)
{
cout<<name<<": i disagree "<<p.name<<endl;
}
};

struct moderator:poster{
using poster::poster; //inherit constructor of poster base class, c++11
void
disagree(const poster& p) override
{
poster::disagree(p);
cout<<p.name<<" has been banned\n";
}
};

int main()
{
poster p0{"blisse"};
poster p1{"nunez"};
moderator m0{"tofucake"};
p0.disagree(p1);
m0.disagree(p0);
}
[jeh@gimli work]$ ./workbench 
blisse: i disagree nunez
tofucake: i disagree blisse
blisse has been banned
conspired against by a confederacy of dunces.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-11-24 18:10:59
November 24 2014 18:10 GMT
#10966
LOL

:3

nunez can you write an astyle config file so i can copy your styling? i like it (except for the lack of space before {'s


alsooo how do you guys feel about namespaces in c++? not worth it to do for personal projects?
There is no one like you in the universe.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-24 19:22:52
November 24 2014 19:12 GMT
#10967
ahah.

astyle, ooh, this looks useful. i'll take a look.

i think namespaces are pretty sweet, f.ex. when you want a place to put implementation
details, however you can achieve same thing with prefixing or postfixing.

but if you want to create a metastructure with a more meaningful semantic than
"implementation detail", like say a type and a set of functions to manipulate the type,
and you're into autocompletion, then postfixing is obviously a bad choice.

i tend to favor namespaces.

equivalent ex:
using partial template specialization of a class template to count the template
arguments of the template argument a function template was instantiated with
(after reading this you will be more inclined to forgive the following syntax).

+ Show Spoiler [example] +
#include<iostream>
#include<string>
#include<utility>
using namespace std;

template<class...>
struct
sequence{};

template<class>
struct
count_detail;

template<class... T>
struct
count_detail<sequence<T...>>
{ static constexpr int output{sizeof...(T)}; };


template<class sequence>
constexpr int
count()
{ return count_detail<sequence>::output; }

int main(){
cout<<count<sequence<int,float,char>>()<<endl;
}
#include<iostream>
#include<string>
#include<utility>
using namespace std;

template<class...>
struct
sequence
{};

namespace detail{

template<class>
struct
count;

template<class... T>
struct
count<sequence<T...>>
{ static constexpr int output{sizeof...(T)}; };

}

template<class sequence>
constexpr int
count()
{ return detail::count<sequence>::output; }

int main(){
cout<<count<sequence<int,float,char>>()<<endl;
}


when writing library stuff (header only, template stuff) i intend to use later i always put whatever is in its interface in a namespace (f.ex jeh for general stuff, or a dedicated one if there number of things in the library is big enough, and their names are collission prone enough), to avoid namespace pollution.

i have yet to write a binary complex enough for a namespace to be meaningful though.
conspired against by a confederacy of dunces.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2014-11-25 01:19:01
November 25 2014 01:18 GMT
#10968
Find a c++ style guide (really any good one, doesn't quite matter which) and follow its suggestions for namespacing. Some common themes:

use unnamed namespaces (e.g. namespace { my code in here ... .... }) when you won't need to refer to stuff elsewhere.

don't use 'using', always put the proper namespace in front of calls (std:: instead of using std)
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
Last Edited: 2014-11-25 01:43:23
November 25 2014 01:39 GMT
#10969
On November 25 2014 02:28 nunez wrote:
Show nested quote +
And some of the methods in the base/hack classes? They're overriding parts of methods and invoke the same method from parent in random places (as in: function func() { parent::func(); }).

is this really a hack though?


This becomes a hack when you have something like that:


Class1 extends BaseClass
{
function fu()
{
// set some global app settings
}
}

Class2 extends Class1
{
function fu()
{
// set the same global settings as in Class1, but do it differently

parent::fu();
}
}

Class3 extends Class2
{
function fu()
{
// set the global settings...

parent::fu();
}
}


And then those global settings (which were set in PHP) get overriden by JS (since they store it in the cookies). It's like several people were working on the same issue, each with a different idea on how to approach it and now I have to clean up the mess...

I could understand it if each new class set some new settings and called the parrent to handle others, but each one of them is doing exactly the same thing, but in a different way (the actual result is different as various checks are performed at different times). Like they couldn't just make a method getGlobalSettings() in one place and use it...
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
November 25 2014 12:34 GMT
#10970
Great, now I've found a switch that spans over 300 lines :/
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 25 2014 12:41 GMT
#10971
On November 25 2014 21:34 Manit0u wrote:
Great, now I've found a switch that spans over 300 lines :/


Soon you are ready to join the club of the legacy code programmers
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
November 25 2014 12:57 GMT
#10972
On November 25 2014 21:41 Morfildur wrote:
Show nested quote +
On November 25 2014 21:34 Manit0u wrote:
Great, now I've found a switch that spans over 300 lines :/


Soon you are ready to join the club of the legacy code programmers


270 warnings found.
248 weak warnings found.
479 typos found.

And it's just one class...
Time is precious. Waste it wisely.
bangsholt
Profile Joined June 2011
Denmark138 Posts
November 25 2014 16:16 GMT
#10973
On November 25 2014 21:41 Morfildur wrote:
Show nested quote +
On November 25 2014 21:34 Manit0u wrote:
Great, now I've found a switch that spans over 300 lines :/


Soon you are ready to join the club of the legacy code programmers


There will be many tears. And lost hair. And lost sanity. But in the end... Right, there's no end. My bad.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
November 25 2014 17:28 GMT
#10974
The hack is the global.
Be happy it's not the same switch in 30 places.
If you have a good reason to disagree with the above, please tell me. Thank you.
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
November 25 2014 18:24 GMT
#10975
On November 26 2014 02:28 spinesheath wrote:
The hack is the global.
Be happy it's not the same switch in 30 places.


Haha, thankfully there are no 30 places, just classes that are 5k lines long...
Time is precious. Waste it wisely.
Ben...
Profile Joined January 2011
Canada3485 Posts
Last Edited: 2014-11-25 20:09:42
November 25 2014 20:07 GMT
#10976
On November 25 2014 02:12 nunez wrote:
the big programming thread is a reliable shoulder to cry on.

Can I vent at it too? The crying has already passed.

I just did about ~45 hours of operating system programming over a 4 day period because my partner for my OS class decided that working on our assignment was no longer in her best interest. She had told me that she would start working on it mid last week after finishing another assignment. After that it was radio silence. Not a single response to my emails or texts, no commits. She did one small commit on Saturday that mostly involved undoing all my work, which I then promptly overwrote (and she sent me a passive aggressive email about). Then yesterday, around 6 hours before it was due, she starts working on it. I'd rather she hadn't. She did maybe 5% of the assignment, and everything she contributed was broken because she didn't understand how to do things (all the stuff we were doing had to be passed through a different function which then deals with userland stuff) or do anything remotely right (keep in mind this person is a full time software developer who is being paid to go to school).

Things she didn't do:
- testing. As in see if her code even compiles. She did a huge commit around 30 minutes prior to the assignment being due that had around 2 screens worth of errors (most because of the point below this one but others because she used -> when she shouldn't have or because of points 4 and 5 below this one). I ended up commenting all of it out. Our prof stated he would rather our code compile and run but be incomplete over being complete and not compiling/running. I was about to just revert back and remove her changes but I got everything working again so I didn't. I told her quite clearly that no major changes were allowed to the OS any time 4 hours before the thing was due so we would be guaranteed to have a compiling and running OS. She obviously didn't listen. She tried swapping out the default scheduler for her own, which didn't compile or wasn't even known to work. I undid that too.
- include headers. She literally didn't include a single header in any of her stuff. I had to do that all myself.
- finish include guards. Every header she made was missing #endif in the include guard
- include said headers in the files that need them. Again, not a single include.
- declare variables. This one baffled me. I would guess she didn't declare maybe half of the variables she used.
- declare function signatures. I can see forgetting to do the void part for declaring a function with no inputs( say something like int foo(void); ) in a header, but forgetting to add in the input parameters in a function that needs them. I mean what?
- understand how extern works. The few times she did declare variables she almost always used extern. In 2 different files she called extern on things that either didn't exist or were structures(?). Every time she would use "struct foo" she would add extern in front, even though she was declaring a local variable of that struct.
- follow the course style guide. Ever. At all. Not even once. We already lost marks on two assignments because of it and she still won't adapt.

Things she did do:
- use what appear to be macros without declaring them (really, I'm not exactly sure what they were supposed to be. grepping the source code came up with nothing other than her stuff. They weren't in any other files or documentation)
- attempt to use built in macros but use them all wrong
- signed and unsigned comparison in vital system code (as in our process scheduler and a few other things). Most of them by default failed.
- overwrite function signatures for stuff I was working on "because it doesn't match the man pages" despite the fact that we aren't going by the man pages, and are instead going by the spec outlined in a file within the OS that I sent her an email about
- COMMITS WITHOUT EVER DOING UPDATES FIRST TO CHECK FOR CHANGES (this is partly because we had to use svn but still, it's common sense. In git, from what I remember, it runs an update when doing commits) I did a whole bunch of fault/error fixes to a commit she did in that 6 hour period prior to submission, I would guess she did that commit around 5 hours before the thing was due. When she did her second commit a half hour before submission, none of those fixes were there anymore. No svn updates were run in 5 hours with the knowledge that another person was working on the file to.

Apologies for the long ranty post, but seriously if you do any of the stuff outlined above, please think about the other people working with you and maybe change your ways. I just needed to get this off my chest. I hope you guys understand.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
November 25 2014 20:57 GMT
#10977
Sounds like your problem was partnering up with some sort of evil programming boggart.
I am the Town Medic.
Pirfiktshon
Profile Joined June 2013
United States1072 Posts
November 25 2014 21:23 GMT
#10978
Your first tip off should have been it was a she hahaha. If she's pretty you were pretty much screwed the moment you partnered up LOL

Is there any space here for a penetration tester(white hat hacker)?
Isualin
Profile Joined March 2011
Germany1903 Posts
November 25 2014 21:29 GMT
#10979
Did you choose your partner randomly in this project? I think you should try talking to her straigth up before your next project about all these things.
| INnoVation | The literal god TY | ByuNjwa | LRSL when? |
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
November 25 2014 21:34 GMT
#10980
On November 26 2014 06:23 Pirfiktshon wrote:
Your first tip off should have been it was a she hahaha. If she's pretty you were pretty much screwed the moment you partnered up LOL


wtf what an awful thing to say. Please inform yourself on the terms "confirmation bias" and "stereotype threat" and try not to perpetuate the stereotype about male programmers while you're at it.
I am the Town Medic.
Prev 1 547 548 549 550 551 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 11h 16m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 141
StarCraft: Brood War
Britney 7280
Shuttle 372
Dota 2
PGG 188
League of Legends
Doublelift4651
JimRising 713
Counter-Strike
jkaem79
Other Games
gofns9158
summit1g8675
Grubby2321
shahzam448
PiGStarcraft355
C9.Mang0262
syndereN177
XaKoH 117
Fuzer 84
NeuroSwarm46
ZombieGrub44
ViBE42
KnowMe26
PPMD25
Railgan22
Maynarde8
JuggernautJason4
Organizations
Other Games
BasetradeTV174
Counter-Strike
PGL85
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 54
• RyuSc2 15
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• HerbMon 38
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV661
League of Legends
• Nemesis3589
• Jankos3563
• Scarra939
Other Games
• imaqtpie660
• Shiphtur189
Upcoming Events
IntoTheTV X SOOP
11h 16m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
17h 16m
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
19h 16m
IntoTheTV X SOOP
1d 11h
IPSL
1d 17h
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
1d 23h
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Invitational
3 days
YoungYakov vs Lambo
SHIN vs TBD
Percival vs Shameless
Solar vs TBD
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Invitational
5 days
Liquipedia Results

Completed

Proleague 2026-11-05
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026

Upcoming

Sector 951
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Underdog Cup 2026 Div 2-3
PGL Bucharest 2027
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 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.