Click here to Skip to main content
15,867,885 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
NewsDeep learning with light Pin
Kent Sharkey23-Oct-22 12:31
staffKent Sharkey23-Oct-22 12:31 
GeneralRe: Deep learning with light Pin
Dan Neely24-Oct-22 3:42
Dan Neely24-Oct-22 3:42 
NewsSomeone wrote a Javascript app that accurately emulates Windows 95 on almost any platform Pin
Kent Sharkey23-Oct-22 12:16
staffKent Sharkey23-Oct-22 12:16 
GeneralRe: Someone wrote a Javascript app that accurately emulates Windows 95 on almost any platform Pin
David O'Neil23-Oct-22 13:28
professionalDavid O'Neil23-Oct-22 13:28 
GeneralRe: Someone wrote a Javascript app that accurately emulates Windows 95 on almost any platform Pin
Nelek23-Oct-22 22:41
protectorNelek23-Oct-22 22:41 
GeneralRe: Someone wrote a Javascript app that accurately emulates Windows 95 on almost any platform Pin
trønderen24-Oct-22 13:23
trønderen24-Oct-22 13:23 
NewsWhy functional programming should be the future of software development Pin
Kent Sharkey23-Oct-22 12:16
staffKent Sharkey23-Oct-22 12:16 
GeneralRe: Why functional programming should be the future of software development Pin
David O'Neil23-Oct-22 16:02
professionalDavid O'Neil23-Oct-22 16:02 
Quote:
Back then, this was a radical idea, and many programmers resisted the loss of a statement that they had grown to rely on. The debate went on for more than a decade, but in the end, the GOTO went extinct, and no one today would argue for its return.
That's debatable. Here's some code from my Wordle solver that loops through the letters of a word, and if one of those letters matches a list of letters at that position which have been eliminated from the running it skips to the next word using a goto. I'm certain it could be done with another construct, but the time to figure out that other construct is a waste when this approach is so simple and directly mirrors the problem's solution:
foreach (string str in currentPossibilities) {
   isPossibility = true;
   for (int i=0; i<p1NonChar.Length; ++i) {
      if (p1NonChar[i] == str[0]) {
         isPossibility = false;
         goto breakout3;
         }
      }
   for (int i=0; i<p2NonChar.Length; ++i) {
      if (p2NonChar[i] == str[1]) {
         isPossibility = false;
         goto breakout3;
         }
      }
   for (int i=0; i<p3NonChar.Length; ++i) {
      if (p3NonChar[i] == str[2]) {
         isPossibility = false;
         goto breakout3;
         }
      }
   for (int i=0; i<p4NonChar.Length; ++i) {
      if (p4NonChar[i] == str[3]) {
         isPossibility = false;
         goto breakout3;
         }
      }
   for (int i=0; i<p5NonChar.Length; ++i) {
      if (p5NonChar[i] == str[4]) {
         isPossibility = false;
         goto breakout3;
         }
      }

   breakout3:
      if (isPossibility) reducedPossibilities.Add(str);
   }
Of course I would never go back to the spaghetti-code goto use, and don't use it often. But when it comes to mind first, and is simple, use it and get on to the next problem.

GeneralRe: Why functional programming should be the future of software development Pin
Super Lloyd23-Oct-22 20:05
Super Lloyd23-Oct-22 20:05 
GeneralRe: Why functional programming should be the future of software development Pin
David O'Neil23-Oct-22 22:14
professionalDavid O'Neil23-Oct-22 22:14 
GeneralRe: Why functional programming should be the future of software development Pin
Richard Deeming23-Oct-22 22:28
mveRichard Deeming23-Oct-22 22:28 
GeneralRe: Why functional programming should be the future of software development Pin
David O'Neil24-Oct-22 4:12
professionalDavid O'Neil24-Oct-22 4:12 
GeneralRe: Why functional programming should be the future of software development Pin
obermd24-Oct-22 15:50
obermd24-Oct-22 15:50 
NewsOur brains use quantum computation Pin
Kent Sharkey23-Oct-22 12:16
staffKent Sharkey23-Oct-22 12:16 
GeneralRe: Our brains use quantum computation Pin
David O'Neil23-Oct-22 17:15
professionalDavid O'Neil23-Oct-22 17:15 
GeneralRe: Our brains use quantum computation Pin
obermd24-Oct-22 15:52
obermd24-Oct-22 15:52 
NewsReport: Elon Musk plans to gut Twitter workforce by 75% after acquisition Pin
Kent Sharkey23-Oct-22 12:16
staffKent Sharkey23-Oct-22 12:16 
GeneralRe: Report: Elon Musk plans to gut Twitter workforce by 75% after acquisition Pin
David O'Neil23-Oct-22 17:17
professionalDavid O'Neil23-Oct-22 17:17 
NewsMicrosoft’s PC Manager is like CCleaner for your computer Pin
Kent Sharkey23-Oct-22 12:16
staffKent Sharkey23-Oct-22 12:16 
NewsSupport reminder for older versions of Visual Studio Pin
Graeme_Grant22-Oct-22 12:56
mvaGraeme_Grant22-Oct-22 12:56 
GeneralRe: Support reminder for older versions of Visual Studio Pin
obermd24-Oct-22 15:52
obermd24-Oct-22 15:52 
GeneralRe: Support reminder for older versions of Visual Studio Pin
charlieg1-Nov-22 8:54
charlieg1-Nov-22 8:54 
NewsI wonder how they're going to use that data? Pin
Marc Clifton21-Oct-22 12:06
mvaMarc Clifton21-Oct-22 12:06 
GeneralRe: I wonder how they're going to use that data? Pin
Randor 21-Oct-22 17:17
professional Randor 21-Oct-22 17:17 
GeneralRe: I wonder how they're going to use that data? Pin
charlieg22-Oct-22 1:29
charlieg22-Oct-22 1:29 

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.