All Questions

Filter by
Sorted by
Tagged with
117 votes
20 answers
9k views

Is the phrase "never reinvent the wheel" suitable for students?

I find myself constantly running into this expression "don't reinvent the wheel" or "never reinvent the wheel" when I ask some questions on SO. They tell you to use some frameworks or existing ...
117 votes
4 answers
88k views

What is the difference between the "lib" and "vendor" folders?

Regarding source folder hierarchy, there are always some common features, such as the src, doc or test folders, which have rather easy-to-understand contents. However, I realized that big projects ...
MattiSG's user avatar
  • 1,952
116 votes
20 answers
45k views

Is static typing worth the trade-offs?

I began coding in in Python primarily where there is no type safety, then moved to C# and Java where there is. I found that I could work a bit more quickly and with less headaches in Python, but then ...
116 votes
16 answers
10k views

How to avoid "DO YOU HAZ TEH CODEZ" situations?

I have a strange situation at work, where a colleague of mine often asks me and other co-workers for working code. I would like to help him, but this constant request of trivial snippets interrupts ...
116 votes
8 answers
51k views

How to keep applications stateless

This may be a convoluted question, but I'm trying to get a better understanding of statelessness. Based on what I've read, web applications should be stateless, meaning each request is treated as an ...
user avatar
116 votes
15 answers
147k views

Is LISP still useful in today's world? Which version is most used?

I try to teach myself a new programming language in regular intervals of time. Recently, I've read how Lisp and its dialects are at the complete opposite end of the spectrum from languages like C/C++, ...
116 votes
10 answers
20k views

My coworker commits and pushes without testing

When my coworker thinks that there is no need for a test on his PC, he makes changes, commits and then pushes. Then he tests on the production server and realizes that he made a mistake. It happens ...
ilhan's user avatar
  • 1,201
116 votes
6 answers
104k views

Is it better to use assert or IllegalArgumentException for required method parameters?

In Java, which is more highly recommended, and why? Both types will throw exceptions, so in that regard handling them is the same. assert is slightly shorter, but I'm not sure how much that matters. ...
Daenyth's user avatar
  • 8,147
116 votes
8 answers
41k views

Why are many programmers moving their code to github?

For the past 6 months or more, I've been seeing many codes hosted at sourceforge.net as well as other hosting sites "Move to GitHub". A mere Google Search with the phrase "Moved to Github" returns ...
Chibueze Opata's user avatar
116 votes
4 answers
96k views

Why is Web SQL database deprecated?

I am making a hybrid Android app. At first I decided to use localStorage, after spending 2 days, I realized that it is very strange and so dropped it. Then, I picked up indexedDB, after spending ...
user avatar
116 votes
9 answers
82k views

How to safeguard a REST API for only trusted mobile applications

How do I make sure my REST API only responds to requests generated by trusted clients, in my case my own mobile applications? I want to prevent unwanted requests coming from other sources. I don't ...
supercell's user avatar
  • 1,527
115 votes
17 answers
24k views

Why should 'boneheaded' exceptions not be caught, especially in server code?

I am confused because in quite a few places I've already read that the so-called 'boneheaded' exceptions (ones that result from bugs in code) are not supposed to be caught. Instead, they must be ...
gaazkam's user avatar
  • 4,459
115 votes
4 answers
74k views

What operating systems are used in airplanes, and what programming languages are they developed in? [closed]

I was wondering if anyone knows what is the operating system used in commercial airplanes (say Boeing or Airbus). Also, what is the (preferred) real-time programing language? I heard that Ada is used ...
adhg's user avatar
  • 1,149
115 votes
5 answers
87k views

Should I return an HTTP 400 (Bad Request) status if a parameter is syntactically correct, but violates a business rule?

Say that I have a REST endpoint that takes an integer as a parameter: /makeWaffles?numberOfWaffles=3 In this case, I want the number to be positive because I can't make a negative number of waffles (...
Thunderforge's user avatar
  • 2,718
115 votes
3 answers
110k views

What is the name of a function that takes no argument and returns nothing? [closed]

In Java 8's java.util.function package, we have: Function: Takes one argument, produces one result. Consumer: Takes one argument, produces nothing. Supplier: Takes no argument, produces one result. .....
superbob's user avatar
  • 1,322
115 votes
12 answers
17k views

Best practices for sharing tiny snippets of code across projects

I always try to follow the DRY principle strictly at work; every time I've repeated code out of laziness it bites back later when I need to maintain that code in two places. But often I write small ...
George Powell's user avatar
114 votes
7 answers
46k views

Why are the <b> and <i> tags deprecated?

This question came up in one of my college classes. The professor only gave the answer that it was more descriptive, but it seems as though <b> and <i> are rather explicit in their meaning ...
LanceLafontaine's user avatar
114 votes
13 answers
23k views

Should a (junior) developer try to push for better processes and practices in their development/IT team? [closed]

I'm a junior developer that is given the ability to help shape my team's processes if I can justify the change, and if it helps the team get work done. This is new for me as my past companies more or ...
user avatar
114 votes
5 answers
14k views

Does a `long` ban make sense?

In today's cross-platform C++ (or C) world we have: Data model | short | int | long | long long | pointers/size_t | Sample operating systems ... LLP64/IL32P64 16 32 32 64 ...
Martin Ba's user avatar
  • 7,637
114 votes
13 answers
63k views

Why is C not considered an 'object-oriented' language?

It seems that C has its own quasi-objects such as 'structs' that can be considered as objects (in the high-level way that we would normally think). And also, C files themselves are basically separate ...
Dark Templar's user avatar
  • 6,313
114 votes
9 answers
181k views

Why use try … finally without a catch clause?

The classical way to program is with try ... catch. When is it appropriate to use try without catch? In Python the following appears legal and can make sense: try: #do work finally: #do ...
Niklas Rosencrantz's user avatar
114 votes
4 answers
75k views

What's The Difference Between Imperative, Procedural and Structured Programming?

By researching around (books, Wikipedia, similar questions on SE, etc) I came to understand that Imperative programming is one of the major programming paradigms, where you describe a series of ...
Daniel Scocco's user avatar
113 votes
30 answers
106k views

How old is "too old"? [closed]

I've been told that to be taken seriously as a job applicant, I should drop years of relevant experience off my résumé, remove the year I got my degree, or both. Or not even bother applying, because ...
113 votes
15 answers
14k views

Should I point out spelling/grammar related mistakes in someone's code? [closed]

While reviewing a co-worker's code, I came across some spelling mistakes in function names and also grammatical errors like doesUserHasPermission() instead of doesUserHavePermission() in function and ...
Rahul's user avatar
  • 2,119
113 votes
14 answers
31k views

Should I avoid private methods if I perform TDD?

I'm just now learning TDD. It's my understanding that private methods are untestable and shouldn't be worried about because the public API will provide enough information for verifying an object's ...
pup's user avatar
  • 1,712
113 votes
7 answers
64k views

Why declare a variable in one line, and assign to it in the next?

I often see in C and C++ code the following convention: some_type val; val = something; some_type *ptr = NULL; ptr = &something_else; instead of some_type val = something; some_type *ptr = &...
Jonathan Sterling's user avatar
113 votes
3 answers
138k views

Should cookies be used in a RESTful API?

I'm specifically interested in how users perform authorized / authenticated operations on a web API. Are authentication cookies compatible with the REST philosophy, and why?
Brandon Linton's user avatar
112 votes
90 answers
23k views

Stuff every programmer needs while working

I've been tasked with creating a fun and relaxing environment, one thing I know that I want is ergonomic mice and keyboards, others have suggested exercise balls and bands. What is it that every ...
112 votes
14 answers
19k views

How can I maintain code quality without SCM?

I am working in a governmental institution. The technology being used here and the methods for developing software are quite old fashioned. They have tons of storage space but no appropriate space ...
Vlad's user avatar
  • 1,011
112 votes
39 answers
106k views

Why are zero-based arrays the norm?

A question asked here reminded me of a discussion I had with a fellow programmer. He argued that zero-based arrays should be replaced with one-based arrays since arrays being zero-based is an ...
112 votes
14 answers
28k views

How do I deal with a counterproductive scrum team?

Backstory: I have been working as part of this team for the past three years and in this time we have had three different Scrum Master who have all run things differently. Because of this change in ...
user avatar
112 votes
17 answers
8k views

Being stupid to get better productivity?

I've spent a lot of time reading different books about "good design", "design patterns", etc. I'm a big fan of the SOLID approach and every time I need to write a simple piece of code, I think about ...
112 votes
14 answers
86k views

How can I really master a programming language?

I know that learning a language, you can simply buy a book, follow the examples, and whenever possible try the exercises. But what I'm really looking is how to master the language once you've learned ...
112 votes
15 answers
45k views

Are deadlines Agile?

For clarity, a deadline is: A time limit or deadline is a narrow field of time, or particular point in time, by which an objective or task must be accomplished. From wikipedia My whole software ...
stevebot's user avatar
  • 2,013
112 votes
22 answers
134k views

Automatic programming: write code that writes code [closed]

After reading the book The Pragmatic Programmer, one of the arguments I found most interesting was "write code that writes code". I tried searching over the net for some more explanations or articles ...
112 votes
11 answers
148k views

How should I organize my source tree?

I am an individual developer working, largely, on web-projects (W/LAMP) and, at times, on C/C++ (non-GUI) projects of about average scale. I often struggle with structuring my source-code tree. In ...
check123's user avatar
  • 1,327
112 votes
1 answer
26k views

If I fork a project on Github that is licensed under MIT, how do I handle the attribution and copyright notice?

If I plan to fork an MIT project and significantly modify and rename it, how do I handle the copyright notice above the MIT license on the main License file. Would I list the original author and my ...
David's user avatar
  • 1,889
111 votes
13 answers
12k views

Exception vs empty result set when the inputs are technically valid, but unsatisfiable

I'm developing a library intended for public release. It contains various methods for operating on sets of objects - generating, inspecting, partitioning and projecting the sets into new forms. In ...
anaximander's user avatar
  • 2,285
111 votes
9 answers
22k views

Fear of web-app not being "future-proof"

I'm a web developer of a small, local SaaS web application. It currently has about a half-dozen clients. As I continue to design the application, it's become increasingly harder for me to convince ...
cameraguy258's user avatar
  • 1,229
111 votes
12 answers
21k views

I've been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional?

My specific case here is that the user can pass in a string into the application, the application parses it and assigns it to structured objects. Sometimes the user may type in something invalid. ...
Daniel Kaplan's user avatar
111 votes
11 answers
12k views

Is it effective to review code in language I don't know?

I'm an experienced developer, but have not done many code reviews. I'm being asked to review code written in Python but I do not know Python. Does it make any sense at all to review code in a ...
Heather Smith's user avatar
111 votes
3 answers
16k views

Why do Trampolines work?

I've been doing some functional JavaScript. I had thought that Tail-Call Optimization had been implemented, but as it turns out I was wrong. Thus, I've had to teach myself Trampolining. After a bit of ...
Ucenna's user avatar
  • 1,302
111 votes
20 answers
54k views

Should I bother to develop for JavaScript disabled? [duplicate]

Should I bother to develop for JavaScript disabled? I feel that my time is better spent developing for the majority.
111 votes
5 answers
95k views

Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?

In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override). In my (probably naive) view, there ...
Mister Smith's user avatar
  • 2,977
110 votes
166 answers
61k views

What's your favourite quote about programming? [closed]

What's your favourite quote about programming? One quote per answer, and please check for duplicates before posting!
110 votes
13 answers
20k views

Should we avoid language features that C++ has but Java doesn't?

Suppose I am limited to use C++ by the environment in the project. Is it good to prevent the use of some language features that C++ has but Java doesn't have (e.g.: multiple inheritance, operator ...
ggrr's user avatar
  • 5,773
110 votes
13 answers
21k views

How do you justify more code being written by following clean code practices?

Moderator note This question has already had seventeen answers posted to it. Before you post a new answer, please read the existing answers and make sure your viewpoint isn't already adequately ...
Pablo Gonzalez's user avatar
110 votes
8 answers
26k views

Why is polling accepted in web programming?

I am currently working on a Ruby on Rails project which shows a list of images. A must-have for this project is that it shows new posts in realtime without the need of refreshing the web page. After ...
dennis's user avatar
  • 1,169
110 votes
15 answers
19k views

When to optimize for memory vs performance speed for a method?

I recently interviewed at Amazon. During a coding session, the interviewer asked why I declared a variable in a method. I explained my process and he challenged me to solve the same problem with fewer ...
Corey P's user avatar
  • 1,224
110 votes
12 answers
18k views

Is testable code better code?

I'm attempting to get into the habit of writing unit tests regularly with my code, but I've read that first it's important to write testable code. This question touches on SOLID principles of writing ...
WannabeCoder's user avatar
  • 2,794

15 30 50 per page
1
7 8
9
10 11
1273