• Welcome to the new Internet Infidels Discussion Board, formerly Talk Freethought.

The Programming Thread

Reading the official React docs this afternoon and am finding them pretty good. They're also reminding me how much I miss being challenged at work. Ah well, feeding myself in retirement is probably the more critical problem.
 
I was digging through the projects I wrote in the first half of college ca 2011-2012 tonight, the first code I'd ever written. I had an idea of what I'd find, but it was still a kick going through it all. Lots of lengthy, procedural C++ programs, gargantuan functions, and severely nested loops. Hard to believe it's been eight years now.

I've passed the stage of embarrassment, though. A first step is a first step.
 
As a side project, I'm learning how to make a simple Android app using Android Studio and Kotlin.

Kotlin is basically what you get when someone thinks "hey, Java is a really powerful language but it's such a chore to write. What if we could make it fun, like Python?"
 
I was digging through the projects I wrote in the first half of college ca 2011-2012 tonight, the first code I'd ever written. I had an idea of what I'd find, but it was still a kick going through it all. Lots of lengthy, procedural C++ programs, gargantuan functions, and severely nested loops. Hard to believe it's been eight years now.

I've passed the stage of embarrassment, though. A first step is a first step.

We were eliminating some tech debt on one of our projects recently, so we were reviewing some "old" ReactJS code. I saw a function that was just poorly written, even though it worked, and made a comment to the effect that whoever wrote that code had no idea what they were doing. My tech lead took a look at the diff, and noticed that I was the one who had written it about two years previous, and we had a bit of a laugh before we refactored it. We often use the identifiers "past me" and "future me" when discussing code, and say things like "past me sure was an idiot when he wrote that code", or "I wonder what future me will think of this code I just threw together".
 
I was digging through the projects I wrote in the first half of college ca 2011-2012 tonight, the first code I'd ever written. I had an idea of what I'd find, but it was still a kick going through it all. Lots of lengthy, procedural C++ programs, gargantuan functions, and severely nested loops. Hard to believe it's been eight years now.

I've passed the stage of embarrassment, though. A first step is a first step.

We were eliminating some tech debt on one of our projects recently, so we were reviewing some "old" ReactJS code. I saw a function that was just poorly written, even though it worked, and made a comment to the effect that whoever wrote that code had no idea what they were doing. My tech lead took a look at the diff, and noticed that I was the one who had written it about two years previous, and we had a bit of a laugh before we refactored it. We often use the identifiers "past me" and "future me" when discussing code, and say things like "past me sure was an idiot when he wrote that code", or "I wonder what future me will think of this code I just threw together".

I noticed it a lot when I was going through college. We programmed an enormous amount between 2011 and the end of 2014, I think everyone in the program improved rapidly. I'd easily turn my nose up at code I'd written just 4 or 5 months earlier.

These days it seems to be all about correctness. My ultimate recognition as a developer is that my code has to be tested, and work as intended. So now it's all slow and steady until the end product is right, and my code is readable / follows standards.
 
I've always said that a programming job is 95% laid-back and 5% pretty awful. And it looks like after four years I've finally been thrust into healthcare hard-mode. But after also being thrust into a senior/architect position directly out of college when I could barely code yet, for two years, this doesn't even seem too bad.

Luckily the actual programming I need to do tends to not be that difficult, and very repetitive.
 
I've been focused on learning Python.

I'm discovering that I learn more quickly if I have a project. Sure, I'll watch the little tutorial, follow along with the examples, and I won't retain a thing. What really makes me sit up are puzzles.

"Here's a 400-character-long string. Test whether it's a palindrome."

"What's the longest repeating sequence of characters in this string?"

"Calculate the mean, the median, and the average of these integers."

Etc...
 
I've been focused on learning Python.

I'm discovering that I learn more quickly if I have a project. Sure, I'll watch the little tutorial, follow along with the examples, and I won't retain a thing. What really makes me sit up are puzzles.

"Here's a 400-character-long string. Test whether it's a palindrome."

"What's the longest repeating sequence of characters in this string?"

"Calculate the mean, the median, and the average of these integers."

Etc...
If you already know another similar language, like Java, Ruby, etc or even JS, then Python is a breeze.
 
I've been focused on learning Python.

I'm discovering that I learn more quickly if I have a project. Sure, I'll watch the little tutorial, follow along with the examples, and I won't retain a thing. What really makes me sit up are puzzles.

"Here's a 400-character-long string. Test whether it's a palindrome."

"What's the longest repeating sequence of characters in this string?"

"Calculate the mean, the median, and the average of these integers."

Etc...
If you already know another similar language, like Java, Ruby, etc or even JS, then Python is a breeze.

Well, I don't know any language. I got into this by teaching myself shell scripting with Powershell. Now I'm trying to broaden my skill set for job security.
 
I've been focused on learning Python.

I'm discovering that I learn more quickly if I have a project. Sure, I'll watch the little tutorial, follow along with the examples, and I won't retain a thing. What really makes me sit up are puzzles.

"Here's a 400-character-long string. Test whether it's a palindrome."

"What's the longest repeating sequence of characters in this string?"

"Calculate the mean, the median, and the average of these integers."

Etc...
If you already know another similar language, like Java, Ruby, etc or even JS, then Python is a breeze.

Well, I don't know any language. I got into this by teaching myself shell scripting with Powershell. Now I'm trying to broaden my skill set for job security.

Ah, yes. I am unfamiliar with powershell, but from what I understand, it is a full-fledge modern language. Probably similar to Python. But yeah, probably you are essentially coming at this as a beginner. Python is a good beginner language to learn. I suggest using MOOCS.

1) The Rice University Course. It's good because you learn by making games. It has a simple GUI library and it's quite satisfying because you start with simple text-based games, move on to things like Pong, and eventually create an Asteroids clone!

https://www.coursera.org/learn/interactive-python-1

2) The MIT introductory CS course. This is an introduction to computer science not programming. But its at a relatively advanced level for an introductory course, I imagine most students taking intro to CS at MIT already are adept programmers. But from a computer science perspective it is quite good, it takes a lot from the classic textbook The Structure and Interpretation of Computer Programs
but brings it down for us mere mortals. And it uses Python instead of LISP/Scheme... so there's that.
https://www.edx.org/course/introduction-to-computer-science-and-programming-7


I think in combination these give you a great background.
 
I've been focused on learning Python.

I'm discovering that I learn more quickly if I have a project. Sure, I'll watch the little tutorial, follow along with the examples, and I won't retain a thing. What really makes me sit up are puzzles.

"Here's a 400-character-long string. Test whether it's a palindrome."

"What's the longest repeating sequence of characters in this string?"

"Calculate the mean, the median, and the average of these integers."

Etc...

Second this. I'm a firm believer in the route to learning something in programming is to attempt to use it to accomplish something useful.
 
Recently I have been learning python (among other things like JS) too.
I did some stuff in python 20 years ago but it was one time stint with python and MySQL.
Python seems superficially simple and easy to start doing something. But I found that if you dig dipper it's rather difficult and very different from C++. A lot of stuff is not explicitly mentioned/explained in tutorials. For example importing modules have few things which I found unexpected and took me awhile to realize why it behaves that way.
Decorators are also unusual and combined with other usual tricks make other peoples code rather unreadable/confusing for someone who is used to C++. Dynamically typed languages are weird.
 
Recently I have been learning python (among other things like JS) too.
I did some stuff in python 20 years ago but it was one time stint with python and MySQL.
Python seems superficially simple and easy to start doing something. But I found that if you dig dipper it's rather difficult and very different from C++. A lot of stuff is not explicitly mentioned/explained in tutorials. For example importing modules have few things which I found unexpected and took me awhile to realize why it behaves that way.
Decorators are also unusual and combined with other usual tricks make other peoples code rather unreadable/confusing for someone who is used to C++. Dynamically typed languages are weird.

Yes, many fundamental aspects of python are quite different from C, C++. But there is an inherent simplicity.

Decorators aren't really that unusual. The decorator syntax:

Code:
@some_decorator
def foo(a, b):
    ...

Is equivalent to:

Code:
def foo(a, b):
    ...
foo = some_decorator(foo)

A "decorator" is simply any callable (e.g. function) that accepts a callable as an argument and returns a callable, although the @decorator syntactic sugar does not enforce that (there's one big difference between C++ and Python, Python relies on convention often). The idea is that your decorator should return the callable with "some behavior decorated on it". And there really is nothing unusual about this when functions are first-class objects.
 
Recently I have been learning python (among other things like JS) too.
I did some stuff in python 20 years ago but it was one time stint with python and MySQL.
Python seems superficially simple and easy to start doing something. But I found that if you dig dipper it's rather difficult and very different from C++. A lot of stuff is not explicitly mentioned/explained in tutorials. For example importing modules have few things which I found unexpected and took me awhile to realize why it behaves that way.
Decorators are also unusual and combined with other usual tricks make other peoples code rather unreadable/confusing for someone who is used to C++. Dynamically typed languages are weird.

Yes, many fundamental aspects of python are quite different from C, C++. But there is an inherent simplicity.

Decorators aren't really that unusual. The decorator syntax:

Code:
@some_decorator
def foo(a, b):
    ...

Is equivalent to:

Code:
def foo(a, b):
    ...
foo = some_decorator(foo)

A "decorator" is simply any callable (e.g. function) that accepts a callable as an argument and returns a callable, although the @decorator syntactic sugar does not enforce that (there's one big difference between C++ and Python, Python relies on convention often). The idea is that your decorator should return the callable with "some behavior decorated on it". And there really is nothing unusual about this when functions are first-class objects.
I know that now. Then there are descriptors and there is whole bunch of __something__ symbols with special meanings.
And when you see something which use all of that at the same time code becomes unreadable. Also the fact that the same thing can be done quite differently (different syntax) does not help when you are trying to learn it from scratch.
Also, dynamic typing means IDE often have no idea of the type of the object it has. I mentioned modules already, "import module" and "from module import" have not so obvious and not mentioned differences.

Also, I have a general complain about proliferation of languages. There are too many of them doing essentially the same and they tend to not die for some reason, why perl is still alive? why PHP exist? embed damn python into html and get rid of it. Then Ruby... why?
 
Desperate enough to have russians from Russia?
$80 per hour, I can learn COBOL in two days for that.

Bad bet. APL is much more efficient. My little brother, almost 78, up in Ilwaco WN has been replacing COBOL with APL for banks, Insurance companies, and Oil Companies for over 40 years.
APL? There's a programming language with that name, but it uses lots of extra symbols, and it is very terse. Why APL and not (say) Python?
 
Back
Top Bottom