The Joys Of Programming

Eventually Right is the new Eventually Consistent!

Mr Crinkle wrote:

Once you've figured out how to do the basic stuff of integrating Excel work with databases and the web, your next focus will be on the part I didn't address above...that portion where the finance worker manipulates things in Excel before uploading their changes back to the database.

Just wanted to to stop in again and thank you for this additional advice. I'm about halfway through a crash course in C# (so far I'm finding it easier to work with than C++) and am hoping to begin developing my first app in ASP.NET next week. I appreciate everyone's help in clarifying reasonable goals in light of my background.

Pinkerton wrote:

crash course in C# (so far I'm finding it easier to work with than C++

and how...

I think everyone should have some exposure to C/C++ but I'm totally glad I don't have to program in it on a day to day basis.

Agreed. If you don't know C++ (or object-oriented C, but please don't), it is much less likely that you understand instinctively how one structures the underlying runtime of the JVM or V8 or even a Ruby or a Python. Not that those two are implemented in C++ but the techniques of object orientation are usually obscured variants of what you learn reflfexively when dealing with C++.

And if you don't know how your tools work, you don't know your tools.

Wrote C once and Cython once and was like uh huh yeah ok script kid I guess

Ed Ropple wrote:

Agreed. If you don't know C++ (or object-oriented C, but please don't), it is much less likely that you understand instinctively how one structures the underlying runtime of the JVM or V8 or even a Ruby or a Python. Not that those two are implemented in C++ but the techniques of object orientation are usually obscured variants of what you learn reflfexively when dealing with C++.

And if you don't know how your tools work, you don't know your tools.

Agree with this. One of the things I was happy about with my CS program is that they stuck with teaching the fundamentals courses in C/C++ at a time when many schools were easing up that entry path with Java.

Language choice is overrated when it comes to the language you use to start with programming. But when it comes to learning/teaching certain things, there are things you need to express in assembly, and things you need to express in something like C or C++. Going higher level, too much is abstracted away.

I started programming with x86 assembly and C. I can't say I remember much assembly but I do know where the 1s and 0s are going. One frustrating thing is many employers seem to just want whatever alphabet soup they're currently trying to maintain, which is why I am trying to branch out.

Ed Ropple wrote:

Agreed. If you don't know C++ (or object-oriented C, but please don't), it is much less likely that you understand instinctively how one structures the underlying runtime of the JVM or V8 or even a Ruby or a Python. Not that those two are implemented in C++ but the techniques of object orientation are usually obscured variants of what you learn reflfexively when dealing with C++.

And if you don't know how your tools work, you don't know your tools.

The thing I've found most useful from what little C I did do is understanding how memory allocation and pointers work. It's pretty hard to reason about what most interpreted languages are doing without having some understanding of that. And memory allocation in R would be just about the most baffling thing ever without it.

I also like her video "a day in the life of a software engineer". That Patreon office looks dope.

boogle wrote:

Wrote C once and Cython once and was like uh huh yeah ok script kid I guess

C is the first language I ever learned. Taught it to myself on a Mac when I was 19. I was relieved when I got into the workplace and only ever really coded in Visual Basic and then Python and Java. I did not enjoy the rope C gave me.

DanB wrote:
Ed Ropple wrote:

Agreed. If you don't know C++ (or object-oriented C, but please don't), it is much less likely that you understand instinctively how one structures the underlying runtime of the JVM or V8 or even a Ruby or a Python. Not that those two are implemented in C++ but the techniques of object orientation are usually obscured variants of what you learn reflfexively when dealing with C++.

And if you don't know how your tools work, you don't know your tools.

The thing I've found most useful from what little C I did do is understanding how memory allocation and pointers work. It's pretty hard to reason about what most interpreted languages are doing without having some understanding of that. And memory allocation in R would be just about the most baffling thing ever without it.

Agreed. I still appreciate knowing it and having learned it. Even took a couple classes in college.

But I wouldn't want to work with it regularly. I know they're different, but when I saw pointers in Go I had a brief heart flutter for this very reason.

Are we still doing bad code that "works"? Because one that's up on Reddit right now really burns:

IMAGE(https://i.imgur.com/KrgeNU1.png)

*Legion* wrote:

Are we still doing bad code that "works"? Because one that's up on Reddit right now really burns:

IMAGE(https://i.imgur.com/KrgeNU1.png)

I have now spent too much of my time trying to work out what the distribution of that oneTo10 function would be assuming that Math.random is producing 0.0 to 1.0 uniformly.

And I just noticed that oneto10 produces a number from 0 to 9.

P.S. Looks like a bell curve around the number 2, Graph https://imgur.com/a/gjKiY

Why is there a while loop? Why?

If you've got the faintest inkling that the return values can fall outside of your ranges...why? Not just the [0,1) range, but the gaps between 0.09 and 0.1...auuugh!

I'm glad my really, really old beginner code is in BASIC that no one will ever see...

Gremlin wrote:

Why is there a while loop? Why?

IMAGE(http://www.ambermaybe.com/wp-content/uploads/2012/08/if-at-first-you-dont-succeed.jpg)

Gremlin wrote:

Why is there a while loop? Why?

If you've got the faintest inkling that the return values can fall outside of your ranges...why? Not just the [0,1) range, but the gaps between 0.09 and 0.1...auuugh!

I'm glad my really, really old beginner code is in BASIC that no one will ever see...

The while is there for those edge cases. Roughly 10% of the time it doesn't return, so rather than figure out why, just keep trying until it returns.

kaostheory wrote:
Gremlin wrote:

Why is there a while loop? Why?

If you've got the faintest inkling that the return values can fall outside of your ranges...why? Not just the [0,1) range, but the gaps between 0.09 and 0.1...auuugh!

I'm glad my really, really old beginner code is in BASIC that no one will ever see...

The while is there for those edge cases. Roughly 10% of the time it doesn't return, so rather than figure out why, just keep trying until it returns.

Should have just had a "return 9" at the bottom of the function instead.

Ed Ropple wrote:

Agreed. If you don't know C++ (or object-oriented C, but please don't), it is much less likely that you understand instinctively how one structures the underlying runtime of the JVM or V8 or even a Ruby or a Python. Not that those two are implemented in C++ but the techniques of object orientation are usually obscured variants of what you learn reflfexively when dealing with C++.

And if you don't know how your tools work, you don't know your tools.

Or it results in you wondering how 5 lines of Java multicast code takes 50000x longer in Java than C.

Should've used an interface.

That random function would explain my xcom hit percentages.

*Legion* wrote:
kaostheory wrote:
Gremlin wrote:

Why is there a while loop? Why?

If you've got the faintest inkling that the return values can fall outside of your ranges...why? Not just the [0,1) range, but the gaps between 0.09 and 0.1...auuugh!

I'm glad my really, really old beginner code is in BASIC that no one will ever see...

The while is there for those edge cases. Roughly 10% of the time it doesn't return, so rather than figure out why, just keep trying until it returns.

Should have just had a "return 9" at the bottom of the function instead.

Mixolyde wrote:

That random function would explain my xcom hit percentages.

This, but it has return 0 at the bottom for those extra cases.

This is hideous in so many ways. I love it.

I wonder what the record for calls to random() for one invocation of oneto10 is.

Kind of reminds me of this: Know your Sysadmin.

Had the following video come across my feed a few days ago as I'm diving farther into Haskell:

Suddenly I have 3 books on category theory (one online only), and I'm enjoying maths again whilst applying it to Haskell and other languages. (Note: there is some solid societal commentary in there as well, which is what really drove it home for me - actual application of Category Theory to life.)

I blame boogle.

IMAGE(https://i.imgur.com/U94JfWq.png)

athros wrote:

Had the following video come across my feed a few days ago as I'm diving farther into Haskell:

Suddenly I have 3 books on category theory (one online only), and I'm enjoying maths again whilst applying it to Haskell and other languages. (Note: there is some solid societal commentary in there as well, which is what really drove it home for me - actual application of Category Theory to life.)

I blame boogle.

John D. Cook blogs very succinctly and interestingly about lots of math and mathematical programming stuff. Here's a search on his blog for "category theory", of which he's written quite a bit.

muraii wrote:

John D. Cook blogs very succinctly and interestingly about lots of math and mathematical programming stuff. Here's a search on his blog for "category theory", of which he's written quite a bit.

Bookmarked. I have so much reading all of a sudden.

Also Bartosz Milewski's "Category Theory for Programmers" is pretty fantastic.

Hypatian wrote:

Also Bartosz Milewski's "Category Theory for Programmers" is pretty fantastic.

Sweet! I'm a rusty unaccomplished math person with interests beyond my means and category theory is one of them. This will come in handy.

New Contest released on Codingame today. It's a control point game based on a Mad Max theme.

IMAGE(https://i.redd.it/sk9na52zaj101.png)