• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:41
CEST 06:41
KST 13:41
  • 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!9[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
[$1250] International ShieldBattery League28Weekly Cups (October 5-11): Farewell to 5.0.162Rollback Netcode in Brood War1265.0.17 Patch Notes - October 7, 202624Weekly Cups Results (Sep 28-Oct 4)0
StarCraft 2
General
SCII needs to put more weight on strategy and tact Server Blocker Terran AddOns placement How do you feel about the mass reverts in the 5.0.17 PTR? Team Liquid Map Contest #22: Results and Winners
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) $3,500 WardiTV Not-Summer Championship ISSL (IntoTheTV x SOOP SC2 League): Premier
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[G] How to playtest arcade maps [A] Nemrods 1/4 players [M] (2) Sweltering Sands [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 547 Temple Of Terror Mutation # 546 Catch the Train Mutation # 545 And Drops and Rifts
Brood War
General
[Megathread] Daily Funny Videos Rollback Netcode in Brood War GG Lan Fest Sofia, Bulgaria [this November] [Recap] Hive ZvZ in MonstarZ vs Dreams [ASL22] Finals Preview: Sweet Victory!
Tourneys
[ASL22] Grand Finals [$1250] International ShieldBattery League 2v2v2v2 Tournament Small VOD Thread 2.0
Strategy
Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers Replay Review Process - What do you do?
Other Games
General Games
Nintendo Switch Thread Dawn of War IV Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread General RTS Discussion Thread
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 Russo-Ukrainian War Thread Artificial Intelligence Thread The Chess Thread Things Aren’t Peaceful in Palestine
Fan Clubs
Serral Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion!
Sports
MLB/Baseball 2023 Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
ShieldBattery on Mac
Kraekkling
The Link Between Gaming and …
TrAiDoS
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 10092 users

The Big Programming Thread - Page 891

Forum Index > General Forum
Post a Reply
Prev 1 889 890 891 892 893 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.
dekibeki
Profile Joined June 2011
Australia34 Posts
Last Edited: 2017-06-13 04:14:54
June 13 2017 04:13 GMT
#17801
I didn't make the distinction between any character and a letter in that previous question. How would you respond to an applicant making that mistake?

On June 13 2017 12:48 Mr. Wiggles wrote:
Show nested quote +
On June 12 2017 10:10 Manit0u wrote:
On June 12 2017 06:36 Fwmeh wrote:
On June 12 2017 03:12 Manit0u wrote:
On June 11 2017 22:24 BrTarolg wrote:
Hi!

I just completely learn python the hard way (except for the bits about creating web-pages)

And now im here haha. I wrote a blackjack simulator and tictactoe with some unit tests. Hoping to enter to do a masters in CS so i can do a career swap


I did career swap without any kind of degree in CS (all I have is bachelor's in Sociology and I've been following a successful programming career for the past 4 years with steadily increasing gains and positions). Just so you know, unless you're working with something that's very close to the "sciency" part of the CS you probably won't use 90% of what you learn there in a real work (especially not the way they teach you to program). I have a friend who has a PhD in CS (specializing in distributed systems and parallel computing), he switched from academic work to regular programming and his opinion is that he was living in the dark for all those years and even programmers just above junior position were better than him in the beginning.

There's plenty of people in my company (myself included) who'd love to get a degree in cognitivistics but unfortunately they don't offer weekend or evening classes so you can't really do that and work at the same time. Philosophy is actually super useful in programming since they teach you plenty of logic and abstractions in there.


I would actually strongly disagree. I would estimate that I have had use of roughly 80% of what I learned at university, either directly or indirectly. Looking back, I realize just how good our initial programming courses were.

That said, there were some very huge gaps, at least with the courses I took, most obviously:

1) How to work in larger, collaborative code-bases over a long period of time.

2) How to work effectively with requirements in a non-trivial business domain

3) How to manage legacy code/systems.

But the reason I would prefer to hire people with degrees over those without is simple that a degree is at least some hint (however imperfect) that I'm dealing with someone capable of learning. Hopefully fast, and hopefully reasonably sophisticated things. The most valuable thing (to me) in a potential hire would be a desire to always improve and learn new things.


It all depends on your uni (obviously, some have better courses than others). I just don't think it's a huge requirement or anything and way too many people think that if they get their CS degree they'll instantly become programmers (you wouldn't believe how many people apply for a job in my company only to learn they can't solve the most basic interview question). I even though about getting an engineer degree but when I solved some of the problems my friend needed help with (he was doing it at the time) I realized that it would just be a waste of every second weekend for the next 3 years just to get the paper. They give people some weird problems and after they get their degree they can't solve basically the only problem we give at interviews:

Write a function (any language, can be pseudocode, doesn't have to be optimal) that gets a string as a parameter and returns first unique letter in it (or return '?' if no unique letter is found).

Every single candidate is posed with this problem. It's not super trivial, but it doesn't require knowing anything past the absolute basics and some thinking. We do 5-10 interviews each week and we hired 3 people over past 4 months (and we need like 20 more). Most candidates fail on the above problem.


Since everyone else is doing it (In Python)

+ Show Spoiler
 +

from collections import Counter


def first_unique_letter(string):
frequency = Counter(string)

for character in string:
if character.isalpha() and frequency[character] == 1:
return character

return "?"



+ Show Spoiler [Test Run] +

>>> from unique import first_unique_letter
>>> first_unique_letter('bab')
'a'
>>> first_unique_letter('!@#a')
'a'
>>> first_unique_letter('aaabbb')
'?'
>>> first_unique_letter('!@#$')
'?'
>>> first_unique_letter('abc')
'a'



Not the most optimal solution, but it's pretty clean.

At my company, we normally get things rolling by trying to make sure that you know low-level programming in the form of C.

For example, given a string, reverse all individual words within the string. For simplicity, assume all input is composed of letters and spaces.

e.g.

[code]void reverse_all_words(char *input, size_t len);

"Hello World" => "olleH dlroW"
"My name is Bob" => "yM eman si boB"
"abc bb " => "cba bb "


Bonus points if you do it space-efficiently.


Assuming a constant worst case amount of extra space is efficient:

+ Show Spoiler +

void swap_word(char* word_start, char* word_end) {
char swap_space;
while(word_start < word_end) {
swap_space = *word_start;
*word_start = *word_end;
*word_end = swap_space;

++word_start;
--word_end;
}
}

void reverse_all_words(char* input, size_t len) {
char* word_start = NULL;

for(size_t i = 0; i < len; ++i) {
if(word_start == NULL && input[i] != ' ') {
word_start = input + i;
} else if(word_start != NULL && input[i] == ' ') {
swap_word(word_start, input + i - 1);
word_start = NULL;
}
}

if(word_start) {
swap_word(word_start, input + len - 1);
}
}
Manit0u
Profile Blog Joined August 2004
Poland17852 Posts
June 13 2017 08:09 GMT
#17802
On June 13 2017 13:13 dekibeki wrote:
I didn't make the distinction between any character and a letter in that previous question. How would you respond to an applicant making that mistake?


It doesn't really matter. We even take some people who fail it but show good effort (we have one girl who failed it but on her first day submitted a very nice solution in PHP). It's really there just to see if you either know your way around a language or you know how to think (avoiding potential pitfalls like infinite loops etc.).

My own solution was pretty crap too, I took a letter, walked the array and if I didn't find it again I returned it. If I found the letter again I removed all copies of it from the array and moved on to the next one (not super optimal but it was more efficient with each pass).
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17852 Posts
June 13 2017 13:04 GMT
#17803
https://github.com/rails/rails/issues/29437

Fucking 7 hours of my life wasted...
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17852 Posts
June 19 2017 14:05 GMT
#17804
https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
Time is precious. Waste it wisely.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2017-06-19 17:27:33
June 19 2017 16:59 GMT
#17805
--- Nuked ---
Acrofales
Profile Joined August 2010
Spain18473 Posts
June 19 2017 16:59 GMT
#17806
On June 19 2017 23:05 Manit0u wrote:
https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/

Also, margarine consumption causes people in Maine to get divorced!
http://www.tylervigen.com/spurious-correlations
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
June 19 2017 19:38 GMT
#17807
Theoretically, tabs are superior in every single way to spaces. Practically, tabs are a nuisance.
There is no one like you in the universe.
Thaniri
Profile Blog Joined March 2011
1264 Posts
June 20 2017 02:26 GMT
#17808
I just use my IDE an press CTRL+I to format it in whatever way it is configured to do.

Tabs are for indentation, spaces are for alignment.

I never understood why people gave a shit about this. Some languages run faster with spaces instead of tabs, and some vice versa. Anything else is people being anal about if they like 2 space indentations or 4 space. Just do what you like, or if you are on a team, do what the team lead likes.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
June 20 2017 04:18 GMT
#17809
--- Nuked ---
Thaniri
Profile Blog Joined March 2011
1264 Posts
June 20 2017 05:53 GMT
#17810
Sure, but that isn't answered at all by the everlasting question. Say you prefer 1 space indentation. What if I prefer 2? or 3? I'm pretty sure tabs default to 4 spaces. Just use tabs and let your IDE take care of how wide you want your tabs to be. If there is small things you want to make look nicer, you can use a space.

Tabs vs Spaces just feels like a meme and I bit the bait really hard.
Khalum
Profile Joined September 2010
Austria831 Posts
June 20 2017 07:33 GMT
#17811
When your opening brackets are in a separate line your code is already 436% more sexy.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
June 20 2017 08:03 GMT
#17812
On June 20 2017 11:26 Thaniri wrote:
I never understood why people gave a shit about this. Some languages run faster with spaces instead of tabs, and some vice versa.


This surely only applies to compiling, right? ...right?

I also remember that (at least back then) with python there was a legit reason to use spaces instead of tabs since python uses tabs/spaces instead of brackets and the Linux tab was like 5 spaces and the windows tab was 4 or something like that. I believe this isn’t an issue anymore.

also:
http://www.tylervigen.com/spurious-correlations
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Acrofales
Profile Joined August 2010
Spain18473 Posts
Last Edited: 2017-06-20 08:55:42
June 20 2017 08:55 GMT
#17813
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.

Nope. Just padding with extra lines for no good reason at all. Making your code needlessly long and very unsexy.
Biolunar
Profile Joined February 2012
Germany224 Posts
June 20 2017 09:10 GMT
#17814
On June 20 2017 13:18 Nesserev wrote:
Show nested quote +
On June 20 2017 11:26 Thaniri wrote:
Tabs are for indentation, spaces are for alignment.

Does this actually work though? Once you change the indentation width, "spaces for alignment" doesn't work anymore, right?
Or it will look ugly, at the least.

It does work:

void foo(void)
{
<---tab--->do_something(variable1,
<---tab---><---space--->variable2,
<---tab---><---space--->variable3);
}

enum
{
<---tab--->FOO<-------space------->= 5,
<---tab--->LONGEST_FOO<---space--->= 50,
<---tab--->LONGER_FOO<----space--->= 500,
};
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
Manit0u
Profile Blog Joined August 2004
Poland17852 Posts
Last Edited: 2017-06-20 09:31:36
June 20 2017 09:31 GMT
#17815
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.


When you're writing in a language that doesn't use brackets your code is already 500% more sexy
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18473 Posts
Last Edited: 2017-06-20 09:34:13
June 20 2017 09:32 GMT
#17816
On June 20 2017 18:10 Biolunar wrote:
Show nested quote +
On June 20 2017 13:18 Nesserev wrote:
On June 20 2017 11:26 Thaniri wrote:
Tabs are for indentation, spaces are for alignment.

Does this actually work though? Once you change the indentation width, "spaces for alignment" doesn't work anymore, right?
Or it will look ugly, at the least.

It does work:

void foo(void)
{
<---tab--->do_something(variable1,
<---tab---><---space--->variable2,
<---tab---><---space--->variable3);
}

enum
{
<---tab--->FOO<-------space------->= 5,
<---tab--->LONGEST_FOO<---space--->= 50,
<---tab--->LONGER_FOO<----space--->= 500,
};

Urghhh. In your first example, the next dev comes along and changes the method name to do_some. Alignment is all messed up, so he deletes the tabs below and puts spaces to fill to requirement. Next person comes along and has a different setting for tab width. GG.

In your second example, I hate that shit. 3 weeks later, I want a new variable called LONGESTER_FOO, now I have to go through adding spaces everywhere? No. Just accept that the assignments are higgledypiggledy.
Khalum
Profile Joined September 2010
Austria831 Posts
Last Edited: 2017-06-20 10:19:01
June 20 2017 10:16 GMT
#17817
On June 20 2017 17:55 Acrofales wrote:
Show nested quote +
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.

Nope. Just padding with extra lines for no good reason at all. Making your code needlessly long and very unsexy.


Yeah, like needlessly long legs on women. Uhm, wait...

On June 20 2017 18:31 Manit0u wrote:
Show nested quote +
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.


When you're writing in a language that doesn't use brackets your code is already 500% more sexy


But would you use tabs or spaces when writing e.g. python?
I'm a man of spaces. Space is ace.

I'll see myself out now.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
June 20 2017 10:28 GMT
#17818
On June 20 2017 18:31 Manit0u wrote:
Show nested quote +
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.


When you're writing in a language that doesn't use brackets your code is already 500% more sexy



I honestly don't really get the notion of brackets versus spacing... just like with almost all syntax discussions it is just a case of getting used to it and afterwards you won't feel a difference. Not pointing at you of course, I assume you were just semi-serious, but I feel like the brackets vs spacing-thing is just some hipster-issue. Whenever this comes up I feel like spaces are cool just because brackets get associated with 'old' languages and could easily be reversed. I for once don't feel any difference when reading space or bracket code, unless of course I have spent some time with only reading one and not the other. Even then it will take a couple of days max to not feeling a difference again.

And I am writing this, because I seriously had this discussion and just like people disliking languages because they are using them incorrect/for the wrong purpose, I really don’t see how someone can try to objectively argue for this. Even though the language thing really drives my gear in comparison… Isn’t the whole point of graduating being able to choose the right tool for the job?

Oh and fuck people who name their functions in a way that autocomplete gets inefficient...
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Manit0u
Profile Blog Joined August 2004
Poland17852 Posts
June 20 2017 11:26 GMT
#17819
On June 20 2017 19:16 Khalum wrote:
But would you use tabs or spaces when writing e.g. python?


https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

On June 20 2017 19:28 waffelz wrote:
I honestly don't really get the notion of brackets versus spacing... just like with almost all syntax discussions it is just a case of getting used to it and afterwards you won't feel a difference. Not pointing at you of course, I assume you were just semi-serious, but I feel like the brackets vs spacing-thing is just some hipster-issue. Whenever this comes up I feel like spaces are cool just because brackets get associated with 'old' languages and could easily be reversed. I for once don't feel any difference when reading space or bracket code, unless of course I have spent some time with only reading one and not the other. Even then it will take a couple of days max to not feeling a difference again.

And I am writing this, because I seriously had this discussion and just like people disliking languages because they are using them incorrect/for the wrong purpose, I really don’t see how someone can try to objectively argue for this. Even though the language thing really drives my gear in comparison… Isn’t the whole point of graduating being able to choose the right tool for the job?

Oh and fuck people who name their functions in a way that autocomplete gets inefficient...


I must say that I was of the same opinion as you are some time ago (when I was switching from PHP to Ruby), but after a while of using the "no brackets and semicolons" language I must say that it's getting increasingly harder for me to go back (and I'll have to do that since I need to learn me some JEE).

Writing brackets and semicolons just seems like a real nuisance with very little benefit (the only benefit I see is when people write multiple statements per line, which is shit anyway and you can do that in Ruby using semicolons too if you want). It just feels like a needless syntactic sugar to guard against noobs writing code the wrong way. I believe that was the main reason for Python to abandon them (although I think they went a bit too far and I much prefer Ruby's "def ... end" syntax) and I have to agree. If you need all those brackets and semicolons to figure out where things start and end in your code then it's probably bad code to begin with.
Time is precious. Waste it wisely.
YourGoodFriend
Profile Blog Joined June 2010
United States2197 Posts
Last Edited: 2017-06-20 11:49:27
June 20 2017 11:48 GMT
#17820
On June 20 2017 19:16 Khalum wrote:
Show nested quote +
On June 20 2017 17:55 Acrofales wrote:
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.

Nope. Just padding with extra lines for no good reason at all. Making your code needlessly long and very unsexy.


Yeah, like needlessly long legs on women. Uhm, wait...

Show nested quote +
On June 20 2017 18:31 Manit0u wrote:
On June 20 2017 16:33 Khalum wrote:
When your opening brackets are in a separate line your code is already 436% more sexy.


When you're writing in a language that doesn't use brackets your code is already 500% more sexy


But would you use tabs or spaces when writing e.g. python?
I'm a man of spaces. Space is ace.

I'll see myself out now.


Just use tabs that save as spaces, to everyone but you you use spaces but to you you use tabs EZPZ

The it becomes a 2 space vs 4 space argument and we all know 3 spaces is superior
anonymous is the most famous author that anyone can be
Prev 1 889 890 891 892 893 1032 Next
Please log in or register to reply.
Live Events Refresh
The PiG Daily
06:30
Best Games of SC
Clem vs SHIN
herO vs SHIN
Serral vs Solar
Clem vs SHIN
Reynor vs TBD
LiquipediaDiscussion
AI Arena Tournament
01:00
Swiss - Round 6
Laughngamez YouTube
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 215
Livibee 162
Nina 137
StarCraft: Brood War
910 63
sOs 48
Bale 36
Icarus 10
Dota 2
NeuroSwarm220
League of Legends
JimRising 653
Other Games
summit1g9068
WinterStarcraft552
ViBE157
Khaldor108
Organizations
Other Games
gamesdonequick616
[ Show 14 non-featured ]
StarCraft 2
• davetesta121
• practicex 18
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2103
League of Legends
• Lourlo991
• Rush558
Other Games
• Shiphtur663
Upcoming Events
Sparkling Tuna Cup
5h 19m
OSC
8h 19m
IPSL
11h 19m
BSL Open Qualifier
14h 19m
WardiTV Weekly
1d 6h
IntoTheTV X SOOP
2 days
PiGosaur Cup
2 days
The PondCast
3 days
Kung Fu Cup
3 days
IntoTheTV X SOOP
4 days
[ Show More ]
FEL
6 days
Liquipedia Results

Completed

ASL Season 22
Blizzard Classic Cup 2026
Copium Cup

Ongoing

Acropolis #5
IPSL Winter 2026-27
KCM Race Survival 2026 Season 4
Acropolis #5 - GSC
HCC Season 3
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
Esports World Cup 2026

Upcoming

BSL Season 23
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
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
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.