• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 05:51
CET 11:51
KST 19:51
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
RSL Offline Finals Info - Dec 13 and 14! StarCraft Evolution League (SC Evo Biweekly) RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread The Perfect Game Path of Exile
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
Physical Exertion During Gam…
TrAiDoS
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1503 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
Poland17496 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
Poland17496 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
Poland17496 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
Poland17496 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
Poland17496 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
The PondCast
10:00
Episode 74
CranKy Ducklings56
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 164
ProTech105
StarCraft: Brood War
Britney 24385
Calm 1992
GuemChi 1399
Horang2 1337
Jaedong 611
actioN 566
BeSt 441
Mini 280
firebathero 266
EffOrt 265
[ Show more ]
Hyuk 253
Dewaltoss 134
Last 129
Light 128
Snow 113
Larva 105
Hyun 105
Shuttle 103
Sharp 88
Pusan 82
Rush 75
hero 66
Killer 62
Barracks 56
ggaemo 53
sorry 47
ZerO 45
Sacsri 43
Shine 33
ToSsGirL 32
Shinee 24
Backho 21
soO 20
Mong 19
Noble 16
Bale 14
NaDa 14
ajuk12(nOOB) 8
Hm[arnc] 6
Dota 2
NeuroSwarm95
XcaliburYe71
League of Legends
JimRising 368
C9.Mang0252
Reynor66
Counter-Strike
olofmeister1832
shoxiejesuss719
Other Games
summit1g12504
ceh9694
crisheroes433
Mew2King48
KnowMe48
B2W.Neo22
ZerO(Twitch)3
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 944
Other Games
gamesdonequick529
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 35
• LUISG 30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota263
League of Legends
• Jankos2125
Upcoming Events
OSC
5h 9m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
13h 9m
Korean StarCraft League
1d 16h
CranKy Ducklings
1d 23h
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
2 days
WardiTV 2025
3 days
[ Show More ]
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
3 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.