this post was submitted on 20 Jul 2024
65 points (100.0% liked)

Programming

423 readers
1 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] neidu2@feddit.nl 39 points 4 months ago (1 children)

"Gods, that's stupid. Why is it being done this way? Have they never heard of naming conventions? Is the language really that awfully designed?"

Learns PHP to find out more.

"Yup..."

load more comments (1 replies)
[–] Ephera@lemmy.ml 36 points 4 months ago (1 children)

I was playing this really simple mobile phone game, where you basically go on these mining trips, then you tap the screen as quickly as possible. So, I thought to myself, I wonder if there's a way to simulate screen taps, to tap at superhuman speeds.

I found an app for that, this app had its own scripting language. Admittedly, there weren't many concepts to learn in this language, but wait, there's more.

Then I thought, maybe I can also automate the menus, between the mining trips.
But this language didn't have support for multiple files, nor functions, you couldn't even use labels in your goto statements, meaning my code started to get quite complicated.

So, I actually sort of implemented support for goto labels / shitty functions within my program.

Basically, at the start of the file, I had an if-else block, which read the value of a variable and based on that, it would select between different goto statements.
So, if I wanted to "call a function", I would set the variable to the function/label name and then goto 0.

If I remember correctly, I did still need to manually update the line numbers in that lookup table at the start, but at least, I didn't have to do it everywhere in the code anymore.

And yes, I did manage to completely automate grinding that game, using this shitty scripting language.
It was an offline game, and not a good one, I didn't actually care about making progress in it. But scripting it was significantly more fun than playing it myself.

[–] Luvon 5 points 4 months ago

There’s a game called something like “oh no the farmer is gone” which is about programming a little robot to harvest the fields and the programming is built directly into the game

[–] 1hitsong@lemmy.ml 36 points 4 months ago* (last edited 4 months ago) (4 children)

Because I wanted to listen to music while doing the dishes.

The Jellyfin Roku client didn't support audio playback, so I wrote it myself... while learning Roku's proprietary language 🙄

load more comments (4 replies)
[–] floofloof@lemmy.ca 20 points 4 months ago

To get a career in IT.

[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 18 points 4 months ago (1 children)
[–] thingsiplay 6 points 4 months ago

A man of culture

[–] neomachino@lemmy.dbzer0.com 18 points 4 months ago

Not really a dumb reason, but back in the day I was stuck in the WordPress developer loop and tired of it. I was pretty familiar with a handful of languages, but wasn't doing much more than setting up themes and building out pages with builders.

One day I heard the CTO talking about a tool he would love to have but couldn't find anything that worked how he needed it to. The CTO was a big buzzword guy and recently shared an article with my manager at the time about how C++ was "the best language". So naturally I chimed in and told him I could build that tool easy peasy and I would use C++ obviously because it's the best language.

It was such a simple tool, basically just matching phrases and categories and spitting out a list of options. It took me months to make, but I learned a lot and it kind of worked for the most part and everyone was happy. I eventually got a de-facto department in the company where I would just build internal tools and handle some legacy codebases that they were previously outsourcing.

I later on got my current job because of that leap.

TLDR: I learned C++ because I was bored and lied that I already knew it.

[–] andioop@programming.dev 18 points 4 months ago

I was going to learn !hare@programming.dev just because it is called "Hare" and I like rabbits, but then I saw that I am not on a supported OS.

[–] SmartmanApps@programming.dev 16 points 4 months ago* (last edited 4 months ago) (5 children)

I, as a teacher, have had to learn several languages, but that's not the dumb reason bit. The dumb reason bit was WHY I had to teach Python, which once I learnt it (so I cold teach it) I could see right away was NOT a suitable language for teaching to Year 7 (who up to now have only used Scratch). I was teaching the U.K. curriculum, and I found out that teaching C# was also allowed - still not ideal, but better than Python for learners -but pretty much all schools were teaching Python. When I dug into it I found I was far from alone in not wanting to use Python... and I also found out the reason schools were teaching Python. It was because from an ADMINISTRATIVE point of view it was much easier for the schools to have us teaching Python. In other words, the office-workers who didn't have to teach it, only had to admin it, were forcing everyone to teach Python because they wanted the lower overhead that came with installing/maintaining that vs. C#. ARGH! All the teachers who wanted to teach C# were running into exactly the same road-block.

[–] kureta@lemmy.ml 29 points 4 months ago (3 children)

I'm really surprised to hear that teaching C# to 7th graders is easer than teaching them python. Python was invented to teach. It looks like pseudo code. I have almost zero experience in teaching so I trust your experience. But can you elaborate a little? What makes teaching C# easier?

[–] ebits21@lemmy.ca 15 points 4 months ago (1 children)

Surely an unpopular opinion lol.

Python is a great first language.

[–] SmartmanApps@programming.dev 4 points 4 months ago (1 children)

...and riding a bike is easy. Now go watch some kids who have never ridden a bike before and see how that's working out for them.

load more comments (1 replies)
[–] SmartmanApps@programming.dev 6 points 4 months ago (5 children)

I just replied to someone else with the same question. Less can go wrong (but in either case a non-OOP language, like Pascal, is a much better starting point. You should only ever teach students one concept at a time).

load more comments (5 replies)
load more comments (1 replies)
[–] JackbyDev@programming.dev 12 points 4 months ago (1 children)

I've always seriously questioned why python has become the defacto beginner language. Sure, a simple print hello world is short, but I feel like static languages are easier to see what's going on.

load more comments (1 replies)
[–] iknowitwheniseeit@lemmynsfw.com 5 points 4 months ago (1 children)

I'm curious why you think Python is unsuitable. Both of my kids picked up Python pretty easily.

[–] SmartmanApps@programming.dev 11 points 4 months ago (18 children)
  • object-oriented (this is their FIRST proper programming language - they don't even know how to write loops yet and you want us to teach them OOP at the same time?! And as it turns out, I had one student who literally could NOT work out how to use a loop - kept writing 20 variables for 20 iterations. i.e. her variables never varied!)
  • variables are weakly-typed (use it for anything, whether it's what you first used it for or not, Python doesn't care)
  • indentation has to be exact (i.e. no brackets, just exact indentation). I had one student whose program wasn't working, and it even took ME a while to find what was wrong with it (a missing space).

I think there was more, but that's what I remember off the top of my head. If it was up to me then I would've used Pascal - that's what it's designed for! But at least C# has strongly-typed variables, and doesn't care about your indentation (and unfortunately there was no non-OOP language choice available - I'm not sure how this got in the curriculum when every teacher knows you only teach one concept at a time). As I said, many other teachers felt the same way, but couldn't get it past their school admin's.

[–] onlinepersona@programming.dev 7 points 4 months ago (1 children)

Why do you even have to mention OOP? C# is object oriented too. Would you start explaining OOP too when teaching C#?

Python is comparatively easier as it's nearly literally pseudo-code. There's no need to even write a main function or functions at all. It uses less characters too e.g no need for semi-colon, brackets in for loops and if statements

As for indentation being exact, IMO that's on you. Beginners should be given a proper development environment to work in that helps them as much as possible. Modern editors and IDEs point out syntax errors and indentation errors are incredibly basic. If they are working in an environment that doesn't even point that out to them, they have been setup incorrectly.

Anti Commercial-AI license

[–] SmartmanApps@programming.dev 6 points 4 months ago

Why do you even have to mention OOP?

Because I was saying why it's a bad choice to teach to Year 7. I already said if it was up to me I'd teach them Pascal.

C# is object oriented too

Yes, I know, but in this case it's the lesser of 2 evils, for the other reasons I gave.

Python is comparatively easier as it’s nearly literally pseudo-code

And as I just said to someone else, students even struggle with pseudo code.

e.g no need for semi-colon, brackets

And I already said that's one of the drawbacks - indenting has to be EXACT or your program doesn't work anymore.

As for indentation being exact, IMO that’s on you

It's not on me - it's in the language itself to begin with. I have no control over it.

Beginners should be given a proper development environment to work in that helps them as much as possible. Modern editors and IDEs point out syntax errors and indentation errors are incredibly basic

Now see if you can get the school admin's to install those ones. As I said, that's the root issue to begin with - the school admin's.

If they are working in an environment that doesn’t even point that out to them, they have been setup incorrectly

Now see if you can get the school admin's to fix it. Welcome to the struggle the teachers face in teaching what WE want to teach them.

[–] uthredii@programming.dev 5 points 4 months ago* (last edited 4 months ago) (7 children)

object oriented

Python does have OOP but you are not at all forced to use it. You can write code in a functional or even procedural style.

typing

I do hate that python doesent have proper support for typing but I think weakly typed variables will actually help beginners as it is less to think about to start off with.

indentation

I think there are pros and cons here. In other languages it is considered good style to use indentation anyway.

I'm sure it is difficult to teach a large class like that though. It was hard enough for me to learn with a much more favourable teacher to student ratio than you probably have. Sorry but honestly I do sympathise with admin as well.

[–] SmartmanApps@programming.dev 4 points 4 months ago

Python does have OOP but you are not at all forced to use it.

Not as an individual, but I'm talking about a situation precisely where the individual choices of teachers are ignored, in some cases by school admins, in some cases by faculty choices. Fortunately I also ran a computing club, in which I was autonomous with how I ran it, and I taught my computing club students C#/MAUI... but even then still saw some of the issues you run into with teaching students. e.g. I told them to install Visual Studio ready for next week, showed them where it was, what workloads to install, and then the next week one of the students had installed Blend for Visual Studio, not Visual Studio. "Look, it has Visual Studio in the name!". (sigh)

I think weakly typed variables will actually help beginners as it is less to think about to start off with

No, that's exactly the problem to start with. Another rule of teaching (see below for the full list I'm quoting these from) is "never let the first impression be a wrong one". If you let students think they can use variables for anything, then you run into problems when they can't. This is why teaching them with strong types first is better - they learn you need to be careful with how to use them, THEN maybe you can let them have some more freedom like Python allows.

In other languages it is considered good style to use indentation anyway

Yes, but in those languages it's optional. In Python it's mandatory, and if someone's code isn't working it's far easier to spot a missing bracket than a missing space.

load more comments (6 replies)
load more comments (16 replies)
load more comments (2 replies)
[–] BehindTheBarrier@programming.dev 15 points 4 months ago* (last edited 4 months ago)

It's hyperbole, but I learned my first language because I wanted to be a god.

I saw these magic windows that popped up, that had buttons, and I was jealous of these godly creators holding the power to make them do as they wanted. So, I learned it myself. I peeked at another program I was using, it was using python and PyQt so that's what I set out with to become my own god of the desktop.

My first program was a GUI wrapper around the YouTube-dl CLI, and I still use it frequently.

[–] ptz@dubvee.org 14 points 4 months ago

Lemmy UI constantly pissed me off, Photon didn't quite do what I wanted, so I forked it and learned Svelte. lol

[–] Ogeon@programming.dev 14 points 4 months ago (4 children)

I was a teacher's assistant in beginner's programming at university for a bit. I expected them to learn C, which I knew enough of, but I got assigned to a group that learned Python instead. I had never used Python at the time. I ended up having to speed learn it while trying to teach it, to not be completely useless.

[–] Kissaki@programming.dev 6 points 4 months ago

Sounds like you had the wrong indent after they shifted you around.

load more comments (3 replies)
[–] PortugalSpaceMoon@infosec.pub 14 points 4 months ago* (last edited 4 months ago) (1 children)

I wanted to see what the COBOL job market looked like. So I learned the superficial basics of COBOL in a day or two, just so I wouldn't be a complete fraud when I put it into my linkedin profile as a skill to see what happens.

[–] Sentient_Modem@lemm.ee 6 points 4 months ago (1 children)

How did that turn out for you?

[–] PortugalSpaceMoon@infosec.pub 9 points 4 months ago (1 children)

Didn't get a single reqeust, so this had less impact than expected. Thought there was more old rusty companies looking for a non-retired engineer.

[–] FizzyOrange@programming.dev 8 points 4 months ago* (last edited 4 months ago)

Yeah I think that's mostly a myth. When I looked up salaries they were definitely good (for programming; amazing for the average person), but not "I would write COBOL for that" good.

There aren't really that many old COBOL systems around. I think it's mostly just over-reported because you can write an article about how some government department still uses COBOL but you can't write about one that switched to Java.

[–] NigelFrobisher@aussie.zone 11 points 4 months ago

Wanting to get into the videogames industry.

[–] 90s_hacker@reddthat.com 9 points 4 months ago

I liked the OCaml website

[–] Mikina@programming.dev 9 points 4 months ago

We found a RCE on a server during pentest. In KOBOL.

Learning how to make a reverse shell in KOBOL was pretty unique experience. Thankfully, we found another path to DA ajd didn't have to continue, but maan, learning KOBOL, especially of your use-case is niche, is borderline esoteric.

[–] yesbot@infosec.pub 8 points 4 months ago (3 children)

to prank people using school computers

load more comments (3 replies)
[–] Plasma@lemmy.ml 8 points 4 months ago

I learned bash instead of python because my 8 year old brain saw all the parentheses and thought "ew no"...

[–] FizzyOrange@programming.dev 8 points 4 months ago

Maybe not dumb but I've definitely been forced to at least partly learn a few terrible languages so I could use some system:

  • PHP so I could write custom linters for Phabricator. Pretty successful. PHP is a bad language but it's fairly easy to read and write.
  • Ruby so I could understand what the hell Gitlab is doing. Total failure here, Ruby is completely incomprehensible especially in a large codebase.
  • OCaml so I can work on a super niche compiler written in OCaml. It's a decent language except the syntax is pretty terrible, OPAM is super buggy, and I dunno if it's this codebase or just OCaml people in general but there are approximately zero comments and identifiers are like ityp, nsec, ef_bin... The sort of names where you already need to know what they are.
[–] _Lory98_@discuss.tchncs.de 8 points 4 months ago (1 children)

I learned a bit of FORTH because an old Minecraft mod (Redpower 2) had a computer that could run it.

[–] TehPers 8 points 4 months ago (1 children)

I wonder how many people learned Lua for this reason (CC and friends).

load more comments (1 replies)
[–] runeko@programming.dev 8 points 4 months ago
[–] lengau@midwest.social 7 points 4 months ago

I learned lolcode in college because we had to write a sorting algorithm in assembly and "any other programming language."

[–] Kolanaki@yiffit.net 7 points 4 months ago* (last edited 4 months ago) (1 children)

I learned a bit of KOBOL after hearing it was the weirdest, hardest, and most unused programming language back in highschool. But only really enough to do a hello world and other very simplistic programs. More because finding resources at that time was difficult.

load more comments (1 replies)
[–] thingsiplay 6 points 4 months ago

Somewhere before 2010, when I was still on Windows on my laptop and using AutoHotkey, I learned a dialect of Basic. To write an application starter on my USB stick, when going to internet cafes. The starters job was just to run my AutoHotkey script with AutoHotkey interpreter. I never used the Basic language again. I actually forgot which dialect, maybe FreeBasic.

[–] Navigator@jlai.lu 5 points 4 months ago (1 children)

Because I couldn't find any dev to help me make the game I wanted to make.

[–] thingsiplay 4 points 4 months ago (1 children)

This is actually reasonable. You didn't know what work is needed to make a game, but your reason to learn a programming language because you couldn't get help is absolutely not dumb in my opinion.

[–] Navigator@jlai.lu 5 points 4 months ago (2 children)

Actually I did know the amount and kind of work it required, as I have being working on game projects before (I'm sound designer, music composer and game designer).

It's not really dumb yes, but a bit sad when you think about it.

load more comments (2 replies)
[–] jerkface@lemmy.ca 4 points 4 months ago

Same as everyone, to produce reports.

[–] chameleon@fedia.io 4 points 4 months ago

Needed to write a syntax highlighter for VB.Net but I couldn't find any weirdly written edge cases online, so I had to make some myself.

load more comments
view more: next ›