bleistift2

joined 3 months ago
[–] [email protected] 11 points 2 days ago (1 children)

My manager once accused me of overinflating my (granted, very conservative) estimates just to be able to pull off a Scotty and be early in 10% of the time.

[–] [email protected] 78 points 2 days ago (9 children)

Teach this to your manager: At the beginning of a task, uncertainty is highest. Under no circumstances should you give an estimate in ‘man-hours’. Even days is too precise. The first estimate should be in months or years (of course depending on the size of the project). Then, as your insight into the project grows, you refine that to months, then weeks, later days. A vague estimate with a lower and a higher bound is way more useful to your manager than a ridiculously ‘precise’ but highly speculative number.

This lesson was brought to you by either “Code Complete 2” or “Rapid Development” by Steve McConnel, and by my former manager who wanted projects estimated in minutes.

[–] [email protected] 33 points 1 week ago (1 children)

You must have exceptionally competent first-level support.

[–] [email protected] 3 points 1 month ago (2 children)

Are all public clocks in the US digital clocks? Off the top of my head, I can tell you 4 locations within walking distance that have analog clocks, one of them being the train station.

[–] [email protected] 7 points 1 month ago

While we’re giving advice on good reads, I foudn “Code Complete” to be much more useful than “The Pragmatic Programmer” (also about 10x the size).

[–] [email protected] 7 points 1 month ago

There are no inherent “rules” to language, either, but when you don’t followthemthingsgetmessyandyou’reannoyingforeveryoneelese.

[–] [email protected] 7 points 1 month ago

Thank you for linking the blog posts. They are a really good deterrent from Clean Code. I once thought I’d read it, but Fowler’s advice really is stupid.

In case you’re wondering why I replied three times: “Do one thing” :)

[–] [email protected] 2 points 1 month ago (2 children)

Exceptions are just bad. They are a separate, hidden control flow that you constantly need to be wary of. The name itself is a misnomer in my opinion, because they’re rarely exceptional: errors are not just common, but an integral part of software development

They may be a part of software development, but they should not be common during the normal execution of software. I once read the hint, “if your app doesn’t run with all exception handlers removed, you are using exceptions in non-exceptional cases”.

Throwing an exception is a way to tell your calling function that you encountered a program state in which you do not know how to proceed safely. If your functions regularly throw errors at you, you didn’t follow their contract and (for instance) didn’t sanitize the data appropriately.

Errors as values are much clearer, because they explicitly show that a function may return an error and that it should be handled.

I disagree here. You can always ignore an error return value and pretend that the “actual” value you got is correct. Ignoring an exception, on the other hand, requires the effort to first catch it and then write an empty error handler. Also (taking go as an inspiration), I (personally) find this very hard to read:

res, error = try_something()
if error {
  handle_the_error(error)
  return_own_error()
}
res2, error2 = try_something_else(res)
if error2 {
  handle_other_error(error2)
  return_own_error()
}
res3, error3 = try_yet_something_else(res2)
if error3 {
  handle_the_third_error(error3)
  return_own_error()
}
return res3

This code mingles two separate things: The “normal” flow of the program, which is supposed to facilitate a business case, and error handling.

In this example, on the other hand, you can easily figure out the flow of data and how it relates to the function’s purpose and ignore possible errors. Or you can concentrate on the error handling, if you so choose. But you don’t have to do both simultaneously:

try {
  res = try_something()
  res2 = try_something_else(res)
  res3 = try_yet_something_else(res2)
  return res3
} catch (e) {
  // check which error it is and handle it appropriately
  throw_own_exception()
}
[–] [email protected] 16 points 1 month ago* (last edited 1 month ago) (4 children)

Functions should be small and do one thing […] you end up with a slew of tiny functions scattered around your codebase (or a single file), and you are forced to piece together the behaviour they exhibit when called together

I believe you have a wrong idea of what “one thing” is. This comes together with “functions should not mix levels of abstraction” (cited from the first blog entry you referenced). In a very low-level library, “one thing” may be sending an IP packet over a network interface. Higher up, “one thing” may be establishing a database connection. Even higher up, “one thing” may be querying a list of users from the database, and higher up yet again is responding to the GET /users http request. All of these functions do ‘one thing’, but they rely on calls to a few methods that are further down on the abstraction scheme.

By allowing each function to do ‘one thing’, you decompose the huge problem that responding to an HTTP request actually is into more manageable chunks. When you figure out what a function does, it’s way easier to see that the function connectToDb will not be responsible for why all users are suddenly called "Bob". You’ll look into the http handler first, and if that’s not responsible, into getUsersFromDb, and then check what sendQuery does. If all methods truly do one thing, you’ll be certain that checkAuthorization will not be related to the problem.

Tell me if I just didn’t get the point you were trying to make.

Edit: I just read

Martin says that functions should not be large enough to hold nested control structures (conditionals and loops); equivalently, they should not be indented to more than two levels. He says blocks should be one line long, consisting probably of a single function call. […] Most bizarrely, Martin asserts that an ideal function is two to four lines of code long.

If that’s the standard of “doing one thing”, then I agree with you. This is stupid.

[–] [email protected] 2 points 1 month ago

Firefox has a context menu entry “copy link without tracking” when you right-click in the address bar.

[–] [email protected] 13 points 1 month ago (2 children)

From your description this sounds more like a job in IBM’s R&D department than a game

[–] [email protected] 9 points 1 month ago (1 children)
 

Contact Overview: Launch contact factsheet of contact Peter Shaw (ID 7, UUID 0000000000011DDFBA8490EA2E421CE3😞

https://myXXXXXX.sapbydesign.com/sap/public/ap/ui/runtime?bo_ns=http://sap.com/xi/AP/FO/BusinessPart...

Material: Launch material factsheet of material P100101 - Heater (22.8 KW) (ID P100101, UUID 0000000000011DEFBAEA3D295D4F87A6😞

https://myXXXXXX.sapbydesign.com/sap/public/ap/ui/runtime?bo_ns=http://sap.com/xi/AP/FO/ProductDataM...

Service Overview: Launch service factsheet of service product 300002 - Engineer (ID 300002, UUID 0000000000011ED083A11BE19763A75F😞

https://myXXXXXX.sapbydesign.com/sap/public/ap/ui/runtime?bo_ns=http://sap.com/xi/AP/FO/ProductDataM...

 

Contact Overview: Launch contact factsheet of contact Peter Shaw (ID 7, UUID 0000000000011DDFBA8490EA2E421CE3😞

https://myXXXXXX.sapbydesign.com/sap/public/ap/ui/runtime?bo_ns=http://sap.com/xi/AP/FO/BusinessPart...

Material: Launch material factsheet of material P100101 - Heater (22.8 KW) (ID P100101, UUID 0000000000011DEFBAEA3D295D4F87A6😞

https://myXXXXXX.sapbydesign.com/sap/public/ap/ui/runtime?bo_ns=http://sap.com/xi/AP/FO/ProductDataM...

Service Overview: Launch service factsheet of service product 300002 - Engineer (ID 300002, UUID 0000000000011ED083A11BE19763A75F😞

https://myXXXXXX.sapbydesign.com/sap/public/ap/ui/runtime?bo_ns=http://sap.com/xi/AP/FO/ProductDataM...

 
 
 
115
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

Meme transcription [Gus Fring fixing his tie]:

You don’t write documentation because you’re lazy.

I don’t write documentation because I don’t want to find out how my app actually works

We are not the same

62
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

Meme transcription [Gus Fring fixing his tie]:

You don’t write documentation because you’re lazy.

I don’t write documentation because I don’t want to find out how my app actually works

We are not the same

 

Meme transcription [Kid drowning in pool]

In the background a person plays with a kid in the pool. The person is labeled “Companies updating their website”. The kid is labeled “The company logo”.

In the foreground a kid seems to be drowning. It is labeled “Useful information”.

In a second panel a skeleton sits at the bottom of the pool. It is labeled “The copyright year”

 

Meme transcription [Kid drowning in pool]

In the background a person plays with a kid in the pool. The person is labeled “Companies updating their website”. The kid is labeled “The company logo”.

In the foreground a kid seems to be drowning. It is labeled “Useful information”.

In a second panel a skeleton sits at the bottom of the pool. It is labeled “The copyright year”

 

Meme transcription:

Bro, just one more bug fix, I swear. The base design is good, promise. This is just a simple bug that I need to fix. It doesn’t require redesigning my approach. I know I’m calling the same function 8 times to get the same data each time, but that’s just this one time, bro. I know they’re asynchronous functions and loading now takes 300ms, but this is just during development, bro. I know I’ve inlined about 7 different things that should be seprate, but that was necessary to fix the previous last bug. I swear, I’m almost done. This is the last bug to fix, bro.

 

Meme transcription:

Bro, just one more bug fix, I swear. The base design is good, promise. This is just a simple bug that I need to fix. It doesn’t require redesigning my approach. I know I’m calling the same function 8 times to get the same data each time, but that’s just this one time, bro. I know they’re asynchronous functions and loading now takes 300ms, but this is just during development, bro. I know I’ve inlined about 7 different things that should be seprate, but that was necessary to fix the previous last bug. I swear, I’m almost done. This is the last bug to fix, bro.

 

Meme transcription:

Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?

Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”

view more: next ›