Click here to Skip to main content
15,886,963 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 725 (3/6) Pin
musefan14-Jun-23 0:58
musefan14-Jun-23 0:58 
GeneralRe: Wordle 725 (5/6) Pin
Jeremy Falcon14-Jun-23 2:52
professionalJeremy Falcon14-Jun-23 2:52 
GeneralRe: Wordle 725 Pin
Bob@work14-Jun-23 3:21
Bob@work14-Jun-23 3:21 
GeneralRe: Wordle 725 Pin
jmaida14-Jun-23 7:55
jmaida14-Jun-23 7:55 
GeneralRe: Wordle 725 Pin
Cp-Coder14-Jun-23 9:18
Cp-Coder14-Jun-23 9:18 
GeneralWhat...! Somethings wrong but what? Pin
glennPattonWork313-Jun-23 9:55
professionalglennPattonWork313-Jun-23 9:55 
Generalworldle 508 Pin
jmaida13-Jun-23 7:27
jmaida13-Jun-23 7:27 
RantShould libraries have a standard API and naming convention? Pin
Chris Maunder13-Jun-23 3:10
cofounderChris Maunder13-Jun-23 3:10 
I'm in the process of moving some code in between Javascript, .NET Core 5, .NET 7 with detours around Razor and Blazor. The code changes between them are doing my head in. Just reading a file from the browser seems to have 6 different ways, all subtly different, all similarly named.

I understand that changes in underlying architecture means that one method won't necessarily translate to another, but surely there are some core things that we, as an industry, could standardise. For example:

You have an object, for instance a file. Or a tensor. Or a string.
  • any time you get data from a source (uploaded file, network stream, from database) you call it "Get"
  • any time you save data to storage you call it "Save"
  • any time you need to append data, you call Append, and also override the + operator.
The thing that's getting me is I just want to save an uploaded file. A quick check shows I can
  1. Call file.SaveAs to save the file
  2. Open a filestream, call file.CopyToAsync to the stream and close the stream
  3. Read the file's InputStream into a buffer and call File.WriteAllBytes to save the buffer
  4. Same as 2, but using CopyTo instead of CopyToAsync
I'm sure there are more. I just want to save the file to disk.

So I'm wondering, since I've not actually taken the time to read up on this, if this happens because
  1. We're scared to break backwards compatibility so we create new methods to avoid breaking old methods, and overloading functions doesn't always work is or possible
  2. There are too many ways to do a given task so we present you a bag of parts (eg streams and buffers) and let you mix and match because there's no single "default" way that's practical to provide
  3. Program flow has changed sufficiently (eg async and promises) that there truly needs to be different methods to cater for this
  4. We just like making up new paths for writing the same old code because they suited our headspace at the time
It seems a massive waste of cycles. I think we as an industry need a big refactoring.
cheers
Chris Maunder

GeneralRe: Should libraries have a standard API and naming convention? Pin
Slacker00713-Jun-23 3:24
professionalSlacker00713-Jun-23 3:24 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Jeremy Falcon13-Jun-23 7:32
professionalJeremy Falcon13-Jun-23 7:32 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Chris Maunder13-Jun-23 7:43
cofounderChris Maunder13-Jun-23 7:43 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Gary Wheeler14-Jun-23 3:30
Gary Wheeler14-Jun-23 3:30 
GeneralRe: Should libraries have a standard API and naming convention? Pin
jschell13-Jun-23 12:13
jschell13-Jun-23 12:13 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Gerry Schmitz13-Jun-23 3:31
mveGerry Schmitz13-Jun-23 3:31 
GeneralRe: Should libraries have a standard API and naming convention? PinPopular
Richard Deeming13-Jun-23 3:31
mveRichard Deeming13-Jun-23 3:31 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Marc Clifton13-Jun-23 4:46
mvaMarc Clifton13-Jun-23 4:46 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Jeremy Falcon13-Jun-23 7:30
professionalJeremy Falcon13-Jun-23 7:30 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Single Step Debugger13-Jun-23 4:53
Single Step Debugger13-Jun-23 4:53 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Chris Maunder13-Jun-23 7:44
cofounderChris Maunder13-Jun-23 7:44 
GeneralRe: Should libraries have a standard API and naming convention? Pin
rnbergren13-Jun-23 6:34
rnbergren13-Jun-23 6:34 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Jeremy Falcon13-Jun-23 7:28
professionalJeremy Falcon13-Jun-23 7:28 
GeneralRe: Should libraries have a standard API and naming convention? Pin
jschell13-Jun-23 12:16
jschell13-Jun-23 12:16 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Jeremy Falcon14-Jun-23 2:40
professionalJeremy Falcon14-Jun-23 2:40 
GeneralRe: Should libraries have a standard API and naming convention? Pin
jschell13-Jun-23 11:52
jschell13-Jun-23 11:52 
GeneralRe: Should libraries have a standard API and naming convention? Pin
Peter_in_278013-Jun-23 15:45
professionalPeter_in_278013-Jun-23 15:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.