Most Popular

1500 questions
62
votes
1 answer

Treating a 1D data structure as 2D grid

I am working with a native class that represents a 2D image as a 1D array. If you want to change one pixel, for example, you need to now how to derive the index from the x,y coordinates. So, let's say we have a 1D array array1d like this: array1d =…
GladstoneKeep
  • 2,629
  • 4
  • 19
  • 15
62
votes
8 answers

MVC Architecture -- How many Controllers do I need?

I have been coding for a while, but mostly scripts and simple applications. I've moved into a new role where it is all about developing Web Apps and using a proper MVC architecture, so I am desperately trying to learn about all that very quickly. I…
Jeff
  • 1,854
  • 3
  • 16
  • 19
62
votes
1 answer

What exactly does the condition in the MIT license imply?

To quote the license itself: Copyright (C) [year] [copyright holders] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software…
jcora
  • 1,461
  • 2
  • 16
  • 25
62
votes
4 answers

TDD - Outside In vs Inside Out

What is the difference between building an application Outside In vs building it Inside Out using TDD? These are the books I read about TDD and unit testing: Test Driven Development: By Example Test-Driven Development: A Practical Guide: A Practical…
Songo
  • 6,548
  • 4
  • 48
  • 89
62
votes
7 answers

I'm the .1x programmer at my company. How can I best contribute?

I work at a newly-minted startup of five people. We have a Ph. D in machine learning, a former member of the RSpec core team, and the guy who compiles the Git binary for OS X. That's just the employees; the founder has a Ph. D and was CTO for a…
invaliduser
  • 660
  • 5
  • 8
62
votes
11 answers

Should a git commit message mention the file that was modified?

In the first line of a git commit message I have a habit of mentioning the file that modified if a change doesn't span multiple files, for example: Add [somefunc] to [somefile] Is this a good thing to do or is it unnecessary?
Matty
  • 1,154
  • 3
  • 13
  • 19
62
votes
16 answers

Is the creation of brand new software generally a major part of most programming jobs?

I have worked in software development for over 10 years now, and it's dawning on me that I rarely get to create anything "new". I realize that "new" is a vague term, but I would define it as anything from an obvious new large-scale project to a new…
Jer
  • 2,576
  • 1
  • 20
  • 17
62
votes
2 answers

Best practice/Patterns for two way data synchronisation

Quite often in my work the idea of 2-way data synchronisation between database systems crops up. The classic example is two slightly different CRM systems (say, Raiser's Edge and Salesforce) and the need to have a two-way sync of Contact data…
62
votes
12 answers

Should I reuse variables?

Should I reuse variables? I know that many best practices say you should not do it, however, later, when different developer is debugging the code and have 3 variables that look alike and the only difference is that they are created in different…
IAdapter
  • 1,345
  • 1
  • 9
  • 22
62
votes
6 answers

Is this a ridiculous way to structure a DB schema, or am I completely missing something?

I have done a fair bit of work with relational databases, and think I understand the basic concepts of good schema design pretty well. I recently was tasked with taking over a project where the DB was designed by a highly-paid consultant. Please let…
Jim
  • 1,997
  • 3
  • 20
  • 25
61
votes
5 answers

Why doesn't Python allow multi-line lambdas?

Can someone explain the concrete reasons why BDFL choose to make Python lambdas single line? This is good: lambda x: x**x This results in an error: lambda x: x**x I understand that making lambda multi-line would somehow "disturb" the normal…
treecoder
  • 9,475
  • 10
  • 47
  • 84
61
votes
21 answers

Is "Hiring only the Best" a really practical advice for normal desktop application programming?

For background, we are doing desktop engineering applications, with an AutoCAD like UI, something similar to etabs. One thing that really bugs me is, is there any need to hire the very best developers? For starters, we are experiencing great…
Graviton
  • 4,013
  • 9
  • 37
  • 50
61
votes
24 answers

Why do programmers use or recommend Mac OS X?

I've worked on both Mac and Windows for awhile. However, I'm still having a hard time understanding why programmers enthusiastically choose Mac OS X over Windows and Linux? I know that there are programmers who prefer Windows and Linux, but I'm…
codingbear
  • 209
  • 2
  • 4
  • 7
61
votes
10 answers

Does it ever make sense to use more concurrent processes than processor cores?

I've got some process in Go. Here's an example counting lines in text, though the question is meant to be far more general than this particular example: func lineCount(s string) int { count := 0 for _, c := range s { if c == '\n' { …
TheEnvironmentalist
  • 1,159
  • 1
  • 8
  • 14
61
votes
10 answers

Is it typical for there to be no real design prior to someone being assigned a task?

I'm a junior engineer, but I've worked at two companies now. In both cases I've found that my colleagues and I are assigned tasks with no thought put into the design before being told to do it. Typically I spend about 90% of my time writing down on…
Countingstuff
  • 761
  • 1
  • 5
  • 7