• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:22
CEST 14:22
KST 21:22
  • 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
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22[ASL21] Ro16 Preview Pt1: Fresh Flow9
Community News
RSL Revival: Season 5 - Qualifiers and Main Event8Code S Season 1 (2026) - RO12 Results02026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15
StarCraft 2
General
Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Code S Season 1 (2026) - RO12 Results Team Liquid Map Contest #22 - The Finalists Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool MaNa leaves Team Liquid
Tourneys
RSL Revival: Season 5 - Qualifiers and Main Event GSL Code S Season 1 (2026) SC2 INu's Battles#15 <BO.9 2Matches> WardiTV Spring Cup SEL Masters #6 - Solar vs Classic (SC: Evo)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base Mutation # 521 Memorable Boss
Brood War
General
Why there arent any 256x256 pro maps? BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion [BSL22] RO16 Group B - Saturday 21:00 CEST BW General Discussion
Tourneys
[Megathread] Daily Proleagues [ASL21] Ro8 Day 2 Escore Tournament StarCraft Season 2 [BSL22] RO16 Group Stage - 02 - 10 May
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread Daigo vs Menard Best of 10 Diablo IV
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 European Politico-economics QA Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
ramps on octagon
StaticNine
Sexual Health Of Gamers
TrAiDoS
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2106 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
Poland17743 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
Poland17743 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
Poland17743 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
Poland17743 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
Poland17743 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
RSL Revival
10:00
Season 5: Group B
TriGGeR vs NightMareLIVE!
Solar vs TBD
Tasteless757
IntoTheiNu 442
Ryung 326
IndyStarCraft 239
Rex131
3DClanTV 95
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 757
Ryung 326
IndyStarCraft 239
Rex 131
Railgan 23
StarCraft: Brood War
Britney 64590
Horang2 1508
Shuttle 894
EffOrt 801
Hyuk 507
Soma 368
Rush 345
firebathero 234
Last 216
ggaemo 206
[ Show more ]
Leta 193
Pusan 148
ToSsGirL 96
PianO 91
Sharp 76
Hm[arnc] 64
[sc1f]eonzerg 59
Sea.KH 40
Barracks 33
NaDa 32
Sacsri 31
IntoTheRainbow 21
JulyZerg 18
yabsab 14
GoRush 13
Noble 12
Shine 7
Terrorterran 4
Dota 2
XaKoH 817
XcaliburYe334
monkeys_forever194
Counter-Strike
zeus1264
edward112
byalli0
Other Games
singsing2230
B2W.Neo1363
Liquid`RaSZi969
DeMusliM406
ArmadaUGS97
Livibee92
MindelVK15
Organizations
Other Games
BasetradeTV592
Dota 2
PGL Dota 2 - Main Stream69
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 11 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2206
Upcoming Events
uThermal 2v2 Circuit
1h 38m
BSL
6h 38m
IPSL
6h 38m
eOnzErG vs TBD
G5 vs Nesh
Patches Events
11h 38m
Replay Cast
20h 38m
Wardi Open
21h 38m
Afreeca Starleague
21h 38m
Jaedong vs Light
Monday Night Weeklies
1d 3h
Replay Cast
1d 11h
Sparkling Tuna Cup
1d 21h
[ Show More ]
Afreeca Starleague
1d 21h
Snow vs Flash
WardiTV Invitational
1d 22h
GSL
2 days
Classic vs Cure
Maru vs Rogue
GSL
3 days
SHIN vs Zoun
ByuN vs herO
OSC
3 days
OSC
4 days
Replay Cast
4 days
Escore
4 days
The PondCast
4 days
WardiTV Invitational
4 days
Replay Cast
5 days
CranKy Ducklings
5 days
RSL Revival
5 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
5 days
BSL
6 days
Replay Cast
6 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
KK 2v2 League Season 1
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 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

Upcoming

Escore Tournament S2: W6
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
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
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.