Reminds me of an old contest - the 8 Queens problem, posed by Byte Magazine in the '80s as a programming contest. All the solutions presented started by declaring an 8X8 board, with a 1 or 0 in each cell to represent a queen. Then there was some two-dimensional iteration over the board, testing if any queen was on the same row, column or diagonal as any other. I'd dismissed that solution as inefficient from the start…
Is abstraction overrated in programming? Chess, interviews and OOP
21–30 of 149 posts
Re: Is abstraction overrated in programming? Chess, interviews and OOP
#22The OP has translated the interviewers question of "design a readable and maintainable abstraction for a chessboard" into "design the most space-optimized chessboard possible", then wonders why the interviewer doesn't like his solution.
But the interviewers seemed to also miss the ball, making irrelevant and false objections.
Re: Is abstraction overrated in programming? Chess, interviews and OOP
#23I’m a bit concerned with the bitboard representation. What happens when a pawn takes another piece? Edit: The above is what I would say if someone presented this approach in an interview.
Re: Is abstraction overrated in programming? Chess, interviews and OOP
#24Re: Is abstraction overrated in programming? Chess, interviews and OOP
#25The OP has translated the interviewers question of "design a readable and maintainable abstraction for a chessboard" into "design the most space-optimized chessboard possible", then wonders why the interviewer doesn't like his solution.
Yeah during reading this i was wondering how someone can miss the point to that kind of degree. The point was to test for an understanding of object-oriented design. Yet he talks about how awesomely space effiencient his implmementation is compared to using objects. But the interviewers seemed to also miss the ball, making irrelevant and false objections.
Re: Is abstraction overrated in programming? Chess, interviews and OOP
#26I have no idea what abstraction actually is. It seems to me it's never abstraction unless it leads to complicated designs for the simplest problems. I've been accused of hating abstraction because I wrote in C instead and programmed out my own concepts -- instead of just using a ready-made framework with ill-fitting ones (Qt in that case). A much better term than abstraction to me is "semantic compression" (got that…
Re: Is abstraction overrated in programming? Chess, interviews and OOP
#27If anything, specify traits that define the movement of the pieces and have each piece extend that trait (with the Queen extending both CAN_MOVE_DIAGONALLY and CAN_MOVE_LATERALLY).
Re: Is abstraction overrated in programming? Chess, interviews and OOP
#28Re: Is abstraction overrated in programming? Chess, interviews and OOP
#29Oh Dear Lord. Programming IS abstraction. In fact, that's pretty much ALL programming is: using, defining, and implementing abstractions.
A definition which doesn't differentiate is a definition which provides no information. If your terminology is broad enough to encompass everything, it's also too broad to tell you anything.
I wrote more on this here: http://beza1e1.tuxen.de/precise_abstractions.html
Abstracting is not everything there is to programming, but modern code consists nearly completely of abstractions.