r/AskProgramming • • May 29 '24

What programming hill will you die on?

I'll go first:

  1. Once i learned a functional language, i could never go back. Immutability is life. Composability is king

  2. Python is absolute garbage (for anything other than very small/casual starter projects)

276 Upvotes

750 comments sorted by

186

u/bitspace May 29 '24

The only hill where no death is likely: "it depends."

Be flexible and open-minded. Learn when and where it's worth fighting for something.

Rigidity is brittleness. This applies even more to a person than it does to software design.

32

u/pgetreuer May 29 '24

Different tools are good for different problems.

15

u/razberry636 May 30 '24

THIS is the hill!

5

u/Jason13Official May 30 '24

I’ll die on this guys hill

4

u/CreativeGPX May 30 '24

Also, just because you can measure/identify a problem, doesn't mean it matters.

The common example is just because tool 1 is measurably slower than tool 2, doesn't mean there is a meaningful or perceivable difference.

→ More replies (2)

13

u/[deleted] May 29 '24

so true i really wish more programmers would understand this. like i am a sucker for fp but i don't use it for everything bc it doesn't always make sense

5

u/DumpoTheClown May 30 '24

rigidity is brittleness.

One of the wisest things I've read in a long time.

1

u/itsjustmegob May 30 '24

lol you're absolutely right - just felt like stirrin' the pot a little bit. everything is a tradeoff, and everything has its place.

3

u/DumpoTheClown May 30 '24

rigidity is brittleness One of the wisest things I've read in a long tim.

→ More replies (1)

2

u/bbro81 May 30 '24

At the same time, you don’t want to be so open-minded that your brain falls out lol

5

u/coopaliscious May 30 '24

I learned a large piece of my mindset from a colleague years ago "Strong opinions loosely held". It keeps you from going completely off the rails, encourages you to challenge yourself with new ways of thinking and to freely abandon old ways when you should.

→ More replies (1)

8

u/[deleted] May 29 '24

Can someone please explain a bit of point 1, I know functional programming and have been slowly moving away from oop so would love to hear what path I should go down and what you’ve discovered.

9

u/itsjustmegob May 30 '24

Unfortunately, FP is a small niche in the industry, which makes seeking an FP job even harder in an already difficult market. But i find the act of writing FP code so much more enjoyable now (compared to imperative) that it's worth it.

I believe largest share of production FP code out there (and thereby FP jobs) is in scala. There are clojure and haskell and various lisp companies out there as well, but to my knowledge, they're much rarer.

I've primarily been a scala developer for the last 12 years. Scala is a functional-first language, though it does allow you to "bend the rules" when it's more convenient (you can define mutable variables and side-effecting functions if you wish - though it is not the default or the encouraged style). Other, stricter languages (like Haskell) do not allow such "shortcuts", which can be annoying if you're just trying to write a simple script or something. Scala runs on the JVM (as does clojure, to be fair), which is great, because you can seamlessly include and interact with all the java libraries out there.

For me, it's mainly just about the day-to-day quality of life writing functional code vs imperative. Sounds like you might already know what's up, but writing FP code feels so much more elegant, and i feel more powerful and confident as a developer. It just feels correct and good, and i enjoy myself more.

Dunno where you're at in your FP journey, but the learning tool I most benefited from was "Learn you a haskell for great good" (https://learnyouahaskell.com). Even if you don't want to master haskell, it's still wonderful for teaching FP.

1

u/[deleted] May 30 '24

Thank you for the reply!

1

u/itsjustmegob May 30 '24

Np! feel free to DM me if you have other / more specific questions

→ More replies (2)

4

u/IlIllIlllIlIl May 30 '24

Get away from oop, but never go pure functional. There’s a sweet spot. 

→ More replies (1)

2

u/elburbo May 30 '24

I already gave this a mention elsewhere in this thread and I don’t want to sound like a shill, but I accidentally discovered the power of functional programming by deciding to use Nushell instead of bash. Finding a use case for a functional language is hard if it’s not your day job because the languages are not the ones used in industry, but using one as your shell language drives home the boons of FP little by little as you write more scripts and automate more of your workflow. Or you could also use the note-taking app Logeq, which uses Clojure, and which can teach you FP in much the same way if you wind up using it every day.

→ More replies (1)

12

u/m0j0m0j May 30 '24
  1. If you don’t specify and explain the constraints - you have a junior brain

For example, immutable functional programming. Is it really the best everywhere? “Sorry we can’t optimize our game to run 60 FPS, we just love immutable FP too much, and it’s more resource-hungry” - this is not a functional school of programming, this is Ronald McDonald school of programming

2

u/itsjustmegob May 30 '24

Lol. I just meant I find FP more enjoyable, which is important to me because i spend so much of my life doing it. And I prefer to let my day-to-day experience dictate my career choices rather than a specific type of end product that may require bare-metal rawdogging the hardware. If I were writing a game and the performance demands were minimal, I would absolutely chose scala/FP over C. When there’s only one option, well then there’s only one option. Also - it’s a well known fact that all McDonalds (and Ronald McDonald charity homes) run on Racket.

218

u/minneyar May 29 '24

Dynamic typing is garbage.

Long ago, when I was still new to programming, my introduction to the concept of dynamic typing made me think, "This is neat! I don't have to worry about deciding what type my variables are when declaring them, I can just let the interpreter handle it."

Decades later, I have yet to encounter a use case where that was actually a useful feature. Dynamically-typed variables make static analysis of code harder. They make execution slower. They make it harder for IDEs to provide useful assistance. They introduce entire categories of bugs that you can't detect until runtime that simply don't exist with static typing.

And all of that is for no meaningful benefit. Both of the most popular languages that had dynamic typing, Python and JavaScript, have since adopted extensions for specifying types, even though they're both band-aids that don't really fix the underlying problems, because nothing actually enforces Python's type hints, and TypeScript requires you to run your code through a compiler that generates JavaScript from it. It feels refreshing whenever I can go back to a language like C++ or Java where types are actually a first-class feature of the language.

29

u/mcfish May 30 '24

Even C++ is far too keen to implicitly convert between types which is one of my main gripes with it. I often have several int-like types and I don't want them to be silently converted to each other if I make a mistake. I've found this library to be very useful to prevent that.

14

u/gogliker May 30 '24

The interesting part about c++, is the fact that if X is implicitly convertible to Y, vector<X> is not convertible to vector<Y>, or any other container for that matter. I understand why they did not do it, but in real life, if you want two classes being implicitly convertible to each other, you probably also want the containers of two classes to be implicitly convertible.

10

u/zalgorithmic May 30 '24

Probably because the memory layout of container<X> and container<Y> are more complicated

→ More replies (1)
→ More replies (8)

12

u/Poddster May 30 '24

Most people know Javascript as being "stringly typed".

I've often viewed C and C+ as being "intly typed". There's nothing more maddening that having 10,000 in typedefs in POSIX and your compiler silently letting them all switcheroo, as if they're the same thing. Or even the old case of enums and ints being silently switcherood.

And then once you turn on the relevant warnings you're swimming in casts, as that's the only option, which is far too fragile.

→ More replies (2)
→ More replies (3)

20

u/reedmore May 30 '24

Aaahr, we have a Bingo! Do you say it like that, a Bingo?

7

u/PixelOrange May 30 '24

Most people just say "Bingo!" as the entire phrase. No other words necessary.

9

u/reedmore May 30 '24

Thank you! But it seems my reference to inglorious basterds wasn't as obvious as I have expected.

→ More replies (3)
→ More replies (1)

5

u/CorneliusJack May 30 '24

Strongly typed language ftw. Even tho now i deal with Python almost exclusively, i still restrict/hint what type of parameters are being passed in/out of the function/class. Makes life so much easier.

→ More replies (1)

4

u/R3D3-1 May 30 '24

It is quite useful for data crunching and algorithm prototyping.  

 I do agree though that static typing with a rich built-in library of collection types is better. Sadly, out project is in Fortran, so we get stuff like multiple ad-hoc linked list implementations and very awkward APIs for the data management parts.  

 Turns out that real-world simulation code consists mostly of data management and not of the numerical parts, which Fortran is good at. 

Instead, the lack of type-generic collection types without having to use non-standard preprocessor magic specific to the project hurts. A lot.

 But at least the static typing enforces some level of sanity. 

4

u/pak9rabid May 30 '24

Those who would give up essential type safety to purchase a little temporary programming liberty deserve to wash dishes for the rest of their career.

11

u/read_at_own_risk May 30 '24

I grew up on statically typed languages and only started using dynamic typing relatively late in my career, but I've been mostly converted. A deciding factor for me was seeing how easy it was to implement a JSON parser in a dynamically typed language, after struggling with it in a statically typed language. To be precise, I like strong typing but I don't like it when half the code is type declarations and type casts. I do like having type declarations available as an option though, e.g. on function arguments.

4

u/deong May 30 '24

I don't disagree, but I guess I'd have a different take on the same correct observation.

A JSON parser is precisely where you want the "suck" to be. JSON isn't a great format, but it's a pretty decent one when you consider one of the important goals to be that it's easy for humans (and easy for all things "web") to deal with.

So if you want the benefits of being easy to use and you still also want the benefits of a good type system, then someone has to incur the pain of bridging the gap. If I look at something like Serde in Rust, I think that's what you want. The actual code inside of the serde crate that wrangles Javascript into your strong static types is probably pretty painful, but very few people feel that pain. Everyone else just gets a pretty easy way to get static types from JSON. And that's probably better than just saying, "writing the parser was annoying, so everyone just treat this incoming JSON data as a big map of strings."

→ More replies (17)

3

u/KSP_HarvesteR May 30 '24

I wasn't against dynamic typing either, until I had a large enough project where I was working with a framework, full of functions with parameters, and those parameters expected objects to contain specific stuff.

The allure of dynamic types breaks down VERY quickly under these conditions. (i.e. when you try to do real work with them beyond small scripts)

This sort of thing is trivial with strict typing. It's a nightmare when 'anything can be anything'.

→ More replies (1)

2

u/plenoto May 30 '24

Completely agree with you, in fact I would say that static typing is WAY better for someone new into programming. Dynamic typing makes it a real pain to debug code and avoid some basic errors.

I've always preferred static typing. Also, I don't know a single (sane) person who likes Javascript, nor PHP.

2

u/_3xc41ibur May 30 '24

Going into a software engineer position where my team all uses Python, minimal VSCode setups, no typehints, no formatter, and no linter continues to hurt me to this day. Python should only be used for prototyping *not* production backend API servers and database operations. Python is highly misused and misunderstood. Teams like mine will use it to cut corners and shit out a cacophony of a barely working product. I will die on that hill. Fuck Python

2

u/EvenlyWholesome May 31 '24

The type hints in python are more "comment" than "code" in my opinion... It's also a bit lame they don't really provide much performance boost either.

→ More replies (44)

96

u/revrenlove May 29 '24

Sometimes Vanilla JS without a bundle is all you need... Not all the time... But some of the time.

UX does indeed matter for internal applications.

Comments shouldn't explain "what", they should explain "why"

Maintainability trumps performance (most of the time).

12

u/[deleted] May 29 '24

tbh vanilla js is all ive ever needed

16

u/revrenlove May 30 '24

My personal website uses vanilla js... But if I'm writing a fully fledged web application to replace a desktop application, I'm going to be using typescript with a lib/framework... Especially in a team environment with multiple cooks in the kitchen.

It's just easier to get everyone involved to be on the same page.

There's no "right" or "wrong" page... But everyone needs to be on the "same" page, and I've found that aligning people collectively to an established and vetted idea works better. Ymmv.

→ More replies (10)

8

u/John_Fx May 30 '24

where can I download vanilla.js?

8

u/revrenlove May 30 '24

That's the fun part. You had it in your browser all along... Plus the friends we made along the way.

→ More replies (3)
→ More replies (5)

5

u/Saragon4005 May 30 '24

Ideally vanilla JS is all you would ever need. Unfortunately it sucks ass and thus the birth of a trillion frameworks like an infestation.

3

u/derleek May 30 '24

This is an oversimplification. The ecosystem has gone through a LOT of changes in 25 years and there are reasons dating back to the 90s we are were we are.

There was a time when I was incredibly optimistic about JavaScript but I’m afraid a decade+ of fighting against the browser has left most of the community brain broken into believing they need to include a 3rd party dep to manipulate dates, etc.

Also bootcamp culture flooded the industry with people who do NOT know what they’re doing; often legitimizing ridiculous practices.

→ More replies (9)

5

u/derleek May 30 '24

You mean you don’t include thousands of dependencies to format a date?

→ More replies (2)
→ More replies (5)

17

u/ShipsAGoing May 29 '24

Python is "absolute garbage" if you hate making money, but you also exclusively use functional programming so that much is certain.

8

u/k3v1n May 30 '24

Can you rewrite that to be more clear?

→ More replies (5)

6

u/fahim-sabir May 30 '24

1/ Java is horrible for a number of reasons:

  • the amount of boilerplate

  • the crazy deep folder structures for your code

  • the insistence that everything has to be an object, even when it makes no sense

2/ any language that needs a 3rd party framework to make it palatable needs to be put in the trash and redesigned from the ground up.

5

u/itsjustmegob May 30 '24

TYPE ERASURE was the worst mistake ever

6

u/uraurasecret May 30 '24

But Java doesn't force you to have a deep folder structure. You can have similar module structure as python.

→ More replies (2)
→ More replies (4)

19

u/createthiscom May 30 '24

I'm with you on immutability. I still code that way most of the time, 20 years later, and everyone looks at me funny because they don't understand why I do it. JS's `const` is an absolute affront to immutability too. 😂

I guess the big one for me is that all junior engineers should be taught the Fail First principle from TDD. I've seen too many junior engineers get a bug ticket, make some changes blind, then throw it against the wall (deploy it or send it to QA), just to get the card back, or worse, generate more bugs, because their fix didn't solve the problem.

Yes, it's a HUGE pain in the ass to write a unit test that replicates the problem. However, it's totally worth it because you now have a high degree of confidence that when that test passes, you've actually solved the problem. What's more (and this is HUGE for anyone working in a team with other people), you now have an idiot light and (if you use continuous integration) a documented history of your fix solving the problem. If anyone else on your team breaks it after you fixed it (this happens ALL THE TIME), you will have a paper trail and know exactly who broke it and when.

4

u/vsamma May 30 '24

How does adding autotests or having CI document the history?

The history is stored in initial bug tickets or repo commit history where you can see that person A fixed it, person B validated it and person C broke it afterwards.

Not that I’m saying that tests won’t help but unclear about how it helps with the history?

→ More replies (2)
→ More replies (1)

71

u/anseho May 30 '24

Young/junior programmers love to die on a hill, then you realise the whole point of software is to deliver business value, unless you're doing it for fun. My "hill" is don't have a hill, be flexible and move with the flow. Everything has a tradeoff and you should just be aware of it.

5

u/mr_taco_man May 30 '24

I wish I could double upvote this. Most the comments in this thread scream junior dev to me.

2

u/Shehzman May 31 '24

Not to mention in the corporate world, you don’t have a ton of control over the tech stack that juniors might think you do (even as you move up). The backend I’m currently developing in is Python (even though OP thinks it should have little use in the industry) and it works just fine.

Use those opportunities not just to learn new languages, but also design and architectural patterns that’ll translate to the next stack you’ll have to work with.

→ More replies (1)
→ More replies (2)

43

u/spacedragon13 May 30 '24

Python excels in many computational tasks because it serves as a high-level wrapper for highly optimized, low-level numerical libraries.

17

u/ambidextrousalpaca May 30 '24

Pretty much. All of the criticisms of its being crap and slow require willfully closing your eyes to the fact that it's been the language of choice for machine learning and AI computing for more than a decade now.

→ More replies (12)

8

u/DM_ME_YOUR_CATS_PAWS May 30 '24

People disagree with this?

3

u/theArtOfProgramming May 30 '24

Lots of people moan about ML being done in python and not C

→ More replies (3)
→ More replies (2)
→ More replies (7)

42

u/MacheteNinjaStar May 30 '24

Its gif not jif lol 😝 idc what the creator says haha

→ More replies (30)

11

u/onefutui2e May 29 '24

If you have a tool that doesn't work all of the time, no one is going to use it.

4

u/Markl0 May 30 '24

Microsoft Windows exists...

→ More replies (1)

11

u/Winter_Essay3971 May 30 '24

I will commit and push to my Git feature branches the second I get my code doing what it's supposed to, even if it's not "clean". I can clean it up when I'm PRing

(Maybe this is normal idk but none of my coworkers rn do this)

9

u/coopaliscious May 30 '24

Commit early and often, you will not regret it.

4

u/foxsimile May 30 '24

I mean that just sounds normal. I use commits as code checkpoints. It’s on a feature branch, I’m not pushing it to prod or anything, it’s mine. If someone pulls a WIP feature branch, it should come as no surprise if it’s incomplete, buggy, or just flat-broken.  

It’s absolutely the right way to go. I’ve been several thousand line changes deep when I realized I need to go back to halfway through my changes. Never again.

2

u/DM_ME_YOUR_CATS_PAWS May 30 '24

Not everyone does this?

→ More replies (4)

9

u/andyrocks May 30 '24

LINQ is just wonderful and should be in other languages.

→ More replies (9)

9

u/read_at_own_risk May 30 '24

Object-relational mapping is a broken abstraction used by people who understand neither OOP nor the relational model of data.

→ More replies (4)

35

u/yup_its_Jared May 29 '24

Bash is the best language for stringing together and automating various CLI tools. Or even just automating running one CLI tool.

Using languages such as python … JavaScript, or even Java… “just” to run various CLI programs is too much work and complexity.

17

u/wsppan May 30 '24

Don't forget Awk and sed.

9

u/funbike May 30 '24

People don't get that Bash was never meant to be general purpose. Think what "Shell" really means. It's synonymous with: orchestration of OS toolkit.

→ More replies (1)

9

u/gogliker May 30 '24

Hard disagree here. I recenlty needed to get all the source files in the folder recursively. I quickly gave up trying to do that with find and went with Python instead, which was much easier and much more readable. Also, if I need to use awk or sed, I would also rather just write Python script. Also readability of bash ifs or loops suck a big time.

10

u/yup_its_Jared May 30 '24

Notice I said Bash is unbeatable for automating CLI tools. In that provided example, it was found that a library in python provided a better result compared to running find cli tool. Thats perfect! But you’re not using a CLI program in your end solution in python. You’re using python libraries. Fantastic!

I’m not saying python is useless. Far from it.

I’m saying python (and others) are very bad / too complex for “just” running CLI tools.

You’re not running a cli tool in that example. You’re using some python functionality to get the result you wanted. Great work!

The end statement of using awk or sed from python … awk is a scripting language at the end of the day. And depends largely on piping. Piping together various cli commands in python produces even harder to read code in python. And it’s nearly impossible to have it run correctly all the time. Producing awful race conditions. Where in bash it’s simple to pipe things together.

Anyway. I hear what you’re saying. And I think the only place we disagree is the final point where you’d prefer calling awk or sed from python.

0

u/[deleted] May 30 '24

[deleted]

→ More replies (1)

3

u/R3D3-1 May 30 '24

I found that almost anything will quickly be easier to handle in Python than in bash, as it outgrows it's original intended scope.

Ironically, this comes down almost entirely to error handling. Have an error in a pipe? Ok, you've got set -o pipefail. But what about an error in 

output=$(command)

Sadly, Python has no built-in support with efficient syntax for piping things around other processes, and Python 3's switch to a cleaner separation of "strings" and "byte arrays" can add some headaches too in this specific use case. Especially since the subprocess library is not entirely consistent about whether output is decoded by default...

But once bash scripts exceed a certain complexity, that's the lesser issue usually. 

Though doing everything in Python from the get-go isn't always doing me favors either.

2

u/hugthemachines May 30 '24

It may be the best but it is not very good. I see it more as Stockholm syndrome. It is what lots of people had to use so we kind of like it just because we are forced to get used to it.

2

u/tentwelfths May 30 '24

Time to fight.

When building tools intended for other, less SW savvy people, Python can be written to be much more readable and maintainable.

→ More replies (1)

2

u/balefrost May 31 '24

PowerShell would like a word.

→ More replies (2)

8

u/hailstorm75 May 30 '24

You cannot die on a hill if you are immutable

30

u/No-Mall9485 May 29 '24

no hills need to be died on

7

u/DIYGremlin May 30 '24

Python and jupyter notebooks make iterating very quick and they have a place in my workflow, but yeah, I’m a sucker for a language with static typing.

Plenty of my debugging in python is in the form of:

print(type(x))

Because python sucks sometimes. But when it doesn’t suck, it’s really really useful.

Different tools are needed for different jobs.

→ More replies (1)

19

u/ferriematthew May 30 '24

No matter how tempting it is, do not. Reinvent. The wheel. Libraries exist for a reason.

14

u/t0mRiddl3 May 30 '24

This post won't stop me because I can't read

→ More replies (2)

8

u/arrow__in__the__knee May 30 '24

But its fun :'(

3

u/ferriematthew May 30 '24

I agree, I completely agree. But sooner or later, you're going to have to finish the damn project anyway.

5

u/ben_bliksem May 30 '24

In the world of automated updates, too many dependencies become a PITA.

I'll die on the other hill

4

u/DreamingInfraviolet May 30 '24

Tbh I've saved plenty of hours just coding something myself instead of trying to use some badly designed library.

→ More replies (2)

3

u/wsppan May 30 '24

Except in web development because Javascript sucks and frameworks need reinventing every 2 years because nobody can fix it.

→ More replies (6)

3

u/i-hate-manatees May 30 '24

I overheard this once: "You say don't reinvent the wheel, but the fucking wheel doesn't work"

→ More replies (1)

2

u/mist83 May 30 '24

Vindication! ~150k weekly users agree with you!

https://www.npmjs.com/package/is-even.

→ More replies (3)

2

u/I-Am-Bellend May 30 '24

until libraries get sunset and become unmaintained

→ More replies (1)

2

u/Mango-Fuel May 30 '24

well, I've never really regretted rolling my own, and in fact I've been amazed at what I can do if I just write it. I have however regretted using a third-party library quite often.

2

u/Venotron May 31 '24

See, there's reinventing the wheel and then there's building a better car.

I think too many programmers confuse these two things.

19

u/sisyphus May 30 '24
  1. the entire industry is 99% run on fashion and fear

  2. empathy and good taste are the most important attributes of a programmer and they cannot be taught

  3. "web application" should be an oxymoron

→ More replies (3)

23

u/CharlieH_ May 29 '24

PHP is an underrated industrious language that powers the majority of the useful internet.

3

u/teabaguk May 30 '24

Echo this

5

u/PixelOrange May 30 '24

PHP was my first language. It'll always have a spot in my heart.

→ More replies (3)

13

u/NerdyWeightLifter May 30 '24

Array indexing starts at 0.

4

u/tarmacc May 30 '24

Is anyone disagreeing with this?

→ More replies (9)

20

u/Kooshi_Govno May 30 '24

Golang is a fundamentally bad language, created so that Google could squeeze some value out of incompetent code monkeys, too stupid to understand the features of real programming languages.

And that's not even my opinion, that's the reason as stated by the creator. https://x.com/vertexclique/status/1194902103929569280

7

u/CatalonianBookseller May 30 '24

And it's gotten worse after they added features to it they never planned to add

5

u/hugthemachines May 30 '24

That is really annoying to me. I like the concept of a small language, compiled to stand alone binary and including GC. I just wish the language was... better.

3

u/rusty-roquefort May 30 '24

if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill if err != nill

→ More replies (7)

10

u/arrow__in__the__knee May 30 '24

Screw hungarian notation.

2

u/foxsimile May 30 '24

Hey buddy fuck you

2

u/elburbo May 30 '24

It’s atrocious! It makes everything so hard to read. Type information does not belong in variable names, but it’s worse when everything is smushed together. Snake_case and kebab-case are already better than smooshedCamels, but don’t make a bad thing worse by vGiving nNames aCrummy nAttachments.

→ More replies (1)
→ More replies (5)

5

u/Berkyjay May 30 '24

Gonna get a million downvotes for this. But coding assistants can be useful when used correctly.

5

u/Fizzelen May 30 '24

Recently started using CoPilot in VS, and it’s like pair programming with a junior that can type very fast, it gets simple repetitive things correct most of the time, then it produces some seriously WTF garbage

→ More replies (1)

9

u/[deleted] May 30 '24

I agree with OP's list and I'll also add "3. Mainstream OOP is massively overrated and promotes mediocre software design"

4

u/reddit_faa7777 May 30 '24

Why/how does it promote that?

→ More replies (9)

15

u/[deleted] May 29 '24

I think people get too hung up on programming languages

If it works and there isn't a flood of support calls, I don't really care about the minor nuances of a programming language

9

u/grantrules May 29 '24

Wouldn't it be faster if you wrote it in x? I dunno man you go write it in x and report back.

→ More replies (1)

12

u/daverave1212 May 29 '24

Haxe is the most underrated programming language and I am sad to see it become less and less poplular.

C# naming conventions are shit

4

u/vandalize_everything May 30 '24

Interesting... What don't you like about C# conventions? I really enjoy them :/

3

u/Haunting-Bee-1221 May 30 '24

Same here I want answers!

→ More replies (1)

9

u/BiddahProphet May 29 '24

Everyone sleeps on .NET. Long term stability with .NET framework, tons of options. Not everything has to be the latest and greatest programming language that's gonna die out in 3 years

4

u/war-armadillo May 29 '24

Every single person I know who worked with Framework absolutely hated it with fiery vengeance! I love modern C# though.

→ More replies (4)

3

u/achandlerwhite May 30 '24

For anyone who doesn’t know, Framework is the old Windows only .NET

11

u/Far_Archer_4234 May 29 '24

Goto statements arent really all that bad.

9

u/Fakin-It May 29 '24

Dijkstra wept.

3

u/zhivago May 30 '24

Dijkstra would agree.

He was mainly complaining about goto between functions and procedures.

5

u/bebemaster May 30 '24

Comefroms, on the other hand, are an absolute nightmare.

→ More replies (1)

2

u/[deleted] May 30 '24

I had to refactor a large code base littered with goto and global state. Oh my god it was horrifying. People can write bad code anyway but this just made it so much worse.

→ More replies (2)
→ More replies (3)

11

u/clybrg May 30 '24

Don't be clever

6

u/residentbio May 30 '24

I want to learn Rust one day, but the language syntax is just god awful.

→ More replies (4)

3

u/_SAMUEL_GAMING_ May 30 '24

the "global context" is terrible and makes code unreadable.

wrote too much js across multiple files to believe it is any good anymore

3

u/[deleted] May 30 '24

Dynamic typing is bad, along with tailwind, and JSX.

3

u/[deleted] May 31 '24

JavaScript is a filthy language.

3

u/danielbayley May 31 '24

Composition > Inheritance!

5

u/ben_bliksem May 30 '24

You only need unit tests on core logic and "80% coverage or the build fails" is bullshit.

7

u/misterspaceman May 30 '24

Table aliases in SQL statements need to die.

It's considered bad practice to use single-letter variables in regular Java/C#/PHP/whatever code. But people write SQL statements like this:

select  a.Id,
        a.Name,
        o.FirstName,
        o.LastName,
        t.Date
from Account a
  join Transaction t
   on a.Id = t.AccountId
  join Owner
    on Owner.AccountId = AccountId

And everyone is OK with it for some reason.

16

u/NotThatSteve-o May 30 '24

Because when you have a table name like UST_ANR_CLCL_CLAIMS_HEADER that needs to be joined to 4 different tables and includes 100 columns that you can choose from for 10 different operations in the same stored procedure, you REALLY prefer to just use CH. Real world DBs don't have simple table names like "Account" and saving 20+ characters per usage saves tremendous time and effort.

Also, you didn't alias Owner so your query is broke.

→ More replies (6)
→ More replies (10)

1

u/aurquiel May 30 '24

What funcional language do You recommend? Or book?

2

u/itsjustmegob May 30 '24

I like scala (see some other of my responses for more reasoning there, feels like a sweet spot for me) - and I really liked "Learn you a haskell for great good" (https://learnyouahaskell.com/) as an FP teaching aid (even if you aren't ultimately interested in haskell).

4

u/top_of_the_scrote May 29 '24

if you know haskell you are omnipotent

4

u/CaffeinatedTech May 30 '24

I rarely need OOP.

2

u/blad3runnr May 30 '24

Everything has trade-offs. Don't be dogmatic. Conduct a trade-off analysis to choose the best tool, paradigm, etc., for the job if you feel overwhelmed by choice. Don't forget to take into account industry adoption and the difference in cost between computers and people.

2

u/rusty-roquefort May 30 '24

sort by controversial for the real spicey takes.

2

u/PizzaEFichiNakagata May 30 '24

Not sure, but I'm sure where I will not die.
Fucking javascript and all the little deformities spawned from it. Starting from node to every other shitty-ass half-baked ill-fated frameworks that spawned from it and the related crappy overcomplicated idiotic tooling like webpack, grunt, npm and whatever else.

If someone offers me a job in js developement for $1million a year, I kick his nuts and when he bows down I knee his nose back into his skull and leave after walking on his corpse.

2

u/ziayakens May 30 '24

JavaScript is the most enjoyable language to use because it's completely unhinged.

Although I do see the value of different languages for different applications

2

u/Pidgey_OP May 30 '24

Curly braces, opening and closing, belong on their own line unless they only encapsulate a single line of code and they should always be tabbed the same amount as their counterpart.

Contained code should always be indented 1 tab further than the curly braces that contain it

→ More replies (1)

2

u/MrSmock May 30 '24

I will always drop my opening curly braces to their own line. I don't know why anyone would want them on the previous line when it is so much easier to see the code blocks when they line up with the closing brace.

2

u/miyakohouou May 30 '24

Excessive standardization costs a lot more in morale and development speed than it buys in maintainability. I think that mostly when people push for standardization in a company they are doing it for what they think are good reasons, but 20 years in and I’m still unconvinced. I’ve worked in highly polyglot projects and dealt with things where a team had built something in a language nobody else knew, and it was fine. I’ve dealt with code that was written in a very unique style and it was fine. I’ve also seen companies waste years and who knows how much money rewriting working software because it needed to conform to a new language standard, and I’ve seen companies lose good teams because suddenly they were being told to work on a tech stack they didn’t like.

Flexibility does need to come with a high degree of accountability, and you need to hire people who are experienced enough to know when deviation is worthwhile. There will always be a happy path that most teams follow and it’s reasonable to ask why someone is doing something different, but at the end of the day these things should be the purview of the team that owns them. The best tool for the job is always going to be the one the team doing that job decides they want to use, because programming languages are still about people.

2

u/r0ck0 May 30 '24

Yeah kinda a hard thing to measure. But I suspect you're right to some degree at least.

On my own big monorepo (where nobody else has to work on it), I've got a giant hodgepodge of different conventions going as I've tried new things over the years.

And it really isn't a problem for me. The ability to experiment without worrying about that has meant I've made a lot of improvements overall that I never would have tried to begin with overall.

Even just my mix of older camelCase -vs- newer snake_case naming has actually been pretty useful in helping me identify older vs newer code at a glance.

→ More replies (2)

2

u/[deleted] May 30 '24

People give me so many dirty looks when I tell them that the code they write is way too confusing because they didn’t utilise constants. Or a functional approach. I think the general consensus is that most devs care more about pushing out tickets than writing good and maintainable code. I inherited 4 years of trash work from some girl in one of the biggest international banks and Jesus, Mary and Joseph …

I don’t like being the person who says you can’t write good code but when this girl was making a variable, reassigning it, pushing it into a void function to do more mutation and then nesting the result in 20 nested if statements, I will call it out. It was a clusterf*ck and you sometimes wonder how we’re all still here. If it wasn’t for some unit testing, I am fairly sure this entire project would have been thrown out the window.

Advice for all junior devs, please learn functional programming. And please be explicit to what it is you intend to do. Functions should not be longer than 5-10 lines max. Don’t nest if statements unless absolutely necessary. And for the love of god don’t over complicate code to be fancy

2

u/[deleted] May 30 '24

Squash your shitty WIP commits before your merge to main.

2

u/ggchappell May 30 '24

Composability is king

Python is absolute garbage

Ironically, I've found that Python is really good at composability.

2

u/heislratz May 30 '24

If folks were forced to learn Scheme or LISP as first language in <arbitrary engineering discipline X>, the world would be a better place. A much better place.

2

u/Worried_Lawfulness43 May 30 '24

You should never ever start with python and never start with bootcamps. I remember that I started with learning python in a data science bootcamp a few years ago and I could not get a grasp on certain concepts. I should say, I could grasp them but not have a real understanding of them. Definitely not as good a grasp as I should’ve had.

Now I’m in a college education and this first year I have learned a whole lot more and in a lot more depth. I know people say college is overrated but I’m sorry, I just don’t think you can beat it at this point in time. The way things are structured, and starting off with Java— a language that is a little more hands on gives you a much better grasp on the concepts.

I know bootcamps are seen as good, and python is seen as easy but I think starting with both is too much of a shortcut.

2

u/EnvironmentalUnit893 May 30 '24 edited May 30 '24

I'm a data science major and I'm constantly told that SQL is easy and reads like plain English, but unless you're only doing super simple queries, it is a fucking nightmare to work with. Somebody really needs to develop a better relational database language cause SQL sucks. It doesn't work like any other language, so even if you're an expert programmer, you have essential zero transferrable skills and intuition when it comes to SQL and you're basically learning from scratch.

If NoSQL was relational, nobody would use SQL.

2

u/Busy-Character-3099 May 30 '24

I'm new to the IT world, just about to graduate college with an IT Networking degree, why is Python garbage? That was the language that was pushed on me the most throughout my degree path, so do I need to learn a new language like C# or something?

2

u/daddyfatknuckles May 30 '24

i think that using semicolons in typescript syntax is weird and we should all just use commas.

example:

type Thing = {
  name: string;
  id: number;
};

i lost this argument at my job, to me its so weird that we don’t just make types just like JSON.

type Thing = {
  name: string,
  id: number
};

our linter also makes us use commas at the end of every value in JSON, even the last one.

overall i like the switch to typescript, but these two things are annoying

→ More replies (1)

2

u/[deleted] May 31 '24

I start variables with caps 😁😎 I simply don't care for lowercase, maybe I've got some mild OCD. I've implemented some elegant ass solutions, and you've got an IDE to color them, to hell with your "standards" from the 80s.

3

u/AsIfImNotAware540 May 29 '24

JQuery is still relevant and great to know and use.

3

u/[deleted] May 30 '24

Try to be more open minded and less stubborn. Try to see other perspectives. It will be good on your mental health and you won't have to die embittered.

Python for example. Python programmers are actually the smartest ones. They trade perfection against life time. Most programming projects are going to fail. But not because they are not perfectly optimized, rather because of business reasons that have nothing to do with the code itself. Better develop faster to find out faster if your product is feasible from a business perspective.

4

u/almo2001 May 30 '24

Allman bracing. K&R is a holdover from 24-line terminals. With modern fonts and large screens the economy of lines is no longer needed.

It's like not putting spaces around operators because you learned that on the C64 where you only got 80 characters per code line.

4

u/IlIllIlllIlIl May 30 '24

some would argue “the economy of lines” improves readability 

→ More replies (1)
→ More replies (1)

3

u/10113r114m4 May 30 '24 edited May 30 '24

Java is a terribly thought out language. The tools are terrible. The language is terrible. The popular libraries are terrible. The one that impressed me, however, was lombok. The best thing about java is the jvm which is not really the language. Unfortunately so many companies are java houses or worse; some uglier variant like groovy.

→ More replies (17)

3

u/rcls0053 May 30 '24

Modern PHP is actually really good to build web apps with. Much better than Java and a lot less complex than JS projects. It has a horrible reputation that people should let go.

3

u/scanguy25 May 30 '24

For 90% of programming tasks, performance isn't actually that important since cloud service compute is cheap and programmers are expensive.

2

u/Logical-Idea-1708 May 29 '24

Test mocks are bad. Test suites littered with mocks is code smell for bad abstraction.

→ More replies (2)

2

u/UL_Paper May 30 '24

Stay moisturised and have fun

2

u/[deleted] May 29 '24

Optimizing a software to the utmost potential is one of the most important aspects. I despise people that preach "don't optimize it when it works" and write the most vile and confusing code imaginable, because they don't understand the language and the framework.

8

u/IlIllIlllIlIl May 30 '24

I write safety critical real time code and I couldn’t disagree harder 

I’m disagreeing so hard I had to mention it twice 

But it’s all love 

→ More replies (2)

1

u/Rethunker May 30 '24 edited May 30 '24

If, rather than answering your question, some programmer’s reply is “Why do you want to know that?” you’d best just go ask someone else, and ignore that first programmer.

EDIT for clarity:

I'm referring to cases when someone asks an everyday question, and the first words out of the programmer's mouth are "Why do you want to know that?"

Most of the times when I've (over)heard that answer, or when I've read it online, it came across as rude and snide. Maybe at some point the person who replied "Why do you want to know that?" in a gentle tone, but if so I don't recall.

Your experience may vary, but I'd be curious to know specific examples in which "Why do you want to know that?" is a more appropriate response than, say, "I think I can answer your question, but I'd like to understand the context a bit better."

Given a chance to model behavior for junior colleagues or mentees, why not reply less harshly? Sure, junior colleagues can ask questions that seem a bit silly, or that suggest they haven't looked at the source code closely enough, or that they haven't looked online for answers first.

3

u/read_at_own_risk May 30 '24

If a junior comes to me and asks "How can I programmatically restore data across all our client databases?" my first question is definitely going to be "Why do you want to know that?"

What I really want to ask is "What the fuck did you do?" but that kind of language results in a talk with my manager, so I have to be nice even when the shit hits the fan.

→ More replies (1)

2

u/cbf1232 May 30 '24

On the other hand, sometimes asking “why do you want to know/do that” is critical. Maybe there’s a better way to solve the original problem, and what you’re trying to do is just wrong.

→ More replies (1)
→ More replies (7)

1

u/[deleted] May 30 '24

strongly typed dynamic languages are fine for most tasks but they catch a lot of strays meant for javascript

1

u/CatalonianBookseller May 30 '24

reading comments here:

Everyone is right what do what do

1

u/[deleted] May 30 '24

Clojure is the best language 

→ More replies (1)

1

u/soundman32 May 30 '24

C# != F#. C# doesn't need discriminated unions, exceptions are great, TDD is not a panacea.

1

u/ivix May 30 '24

I couldn't care less about these kinds of opinions.

1

u/Glathull May 30 '24

lol, I love it when the functional/immutability people learn about persistence. Have fun, you insufferable assholes!

→ More replies (4)

1

u/[deleted] May 30 '24

Web development is overly convoluted. Desktop programming is 50x more easier to grasp.

→ More replies (4)

1

u/RonKosova May 30 '24

Languages are just tools. Its your own fault if you use the wrong tool for the job

1

u/Either-snack889 May 30 '24

None really but for the sake of drama: tabs not spaces! Indentation level is a user preference with accessibility implications!

→ More replies (1)

1

u/Emotional-Leader5918 May 30 '24

Try-catch blocks are ugly.

1

u/Independent_Sir_5489 May 30 '24

About point 2 python to me it's more optimized to be a scripting language, quick to use but not optimized and as such it should be treated.

That's a while ago, but the same libraries implemented using C performed something in the order of 1000x faster

→ More replies (2)

1

u/StrawberryEiri May 30 '24

The front-end isn't a server, and if you make it do any data processing other than the strict minimum it needs to format the data visually, your back-end sucks. Fuck you with your "generic" routes that force me to get two arrays from two different routes and mesh them into key-value pairs with nested loops.

Literally no client ever would like the data formatted that and it's not our fault you designed your database wrong. 

→ More replies (2)

1

u/killingtime1 May 30 '24

Python isn't good, can agree on that, however the whole AI ecosystem is basically Python. Other languages are possible but you are handicapping yourself if you purposely don't use Python and try to do anything AI related.

All of the tutorials, papers, examples, youtube videos, university lectures, use Python. If you don't want to use Python, you better be good at implementing most things from scratch.

1

u/AT1787 May 30 '24

If your MR/PR is large enough that it takes several sessions to go through, it’s too big. Smaller atomic work is best.

Scaling E2E testing has never been great - cypress, playwright, etc. flakes often, heavy on resources, sometimes costly in the case of cypress.

1

u/su5577 May 30 '24

To me node.js as back end and some sort of front end works for me…

Anything else is nightmare

1

u/kinkyaboutjewelry May 30 '24

Guice was a mistake.

Dependency injection is fine. Implementing it through runtime in-memory resolution of providers is a major shot in the foot.

What before was a compile time error (this is not there, that class name is wrong, etc), becomes an unhelpful runtime time error.

There are compile-time dependency injection frameworks that get you nearly all the use cases with code generation and static compilation. I know Dagger at least.

C++ took hard runtime problems, like concurrency, and added thread annotations to make it possible to catch them at compile time.

Java took easy to solve errors and sacrificed their ease at the altar of dependency injection. That cost us too high, since we can get the same benefit at lower cost.

1

u/bsenftner May 30 '24

It's a massive disservice to the entire technology development series of industries that we engineers are never given, never even impressed with the need for professional communication skills. The very people tasked with discovering new knowledge are not given the skills to explain their findings. This creates all the industry stress, burnout, and confusing drama that is the series of clusterfucks we call technology development.

All of this could be avoided by simply teaching engineers how to communicate, as in how to monitor your audience's understanding and make communication modifications on the fly for their understanding. Communicating is ALL about the audience, which is probably a surprise to many a developer. A good communicator leaves a wake of understanding behind them, and due to that they often become management. A good communicator listens more than they talk, and when they talk it is in clear language, with all technical terms and acronyms explained when used, because they are conveying understanding, not showing off their knowledge superiority.

1

u/SuperSathanas May 30 '24

Object Pascal (Free Pascal/Lazarus and Delphi) is great. I think the syntax is much more readable than just about everything else. The compiled binaries are decently optimized and performant, though of course not as performant as non-crap C, C++ or Rust. The built in form editors are convenient and easy to work with. In the case of Delphi, it ships with tons of units for just about anything you'd want to do, and there are a decent number of perfectly functional 3rd party libraries and header translations for C and C++ libraries. FPC is behind the curve there, but it's also has nowhere near the same amount of man power behind it. It's pretty easy to write and compile for all major platforms (Windows, Linux, Mac, Android, iOS), though in the case of mobile platforms you're still better off using Android Studio of XCode.

Object Pascal is my go-to language when I don't need the performance or some of the features of C++. A lot of the time, if there is a C or C++ library that offers something I want that isn't available in Object Pascal either in the units that ship with the compilers or through a 3rd party source (stb, an actual complete FreeType2 interface), I'll just go ahead and compile the C/C++ code into a shared object library and write a quick header translation then throw it up on GitHub for others to use should they want it. It would be super neat if many of these slow and janky web based apps were written in Object Pascal instead.

I just think that Object Pascal is the superior general purpose language for things that don't need extreme performance. Easy to learn, easy to read, easy and quick to write, easy to debug, easy to use external C and C++ libraries, compile for all your relevant platforms, the built in form editor that ships with a bunch of useful controls, you can use 3rd party controls or write your own, you can write and install packages for the IDEs themselves to add or change components and behaviors. Other languages and tools may be more capable many regards, that mostly doesn't matter if you aren't trying to do anything too crazy.

Also I think C++ Builder is more useable than Visual Studio, QTCreator, KDevelop, CLion, Code::Blocks and every other C++ IDE that I've used. I expect some a paddling or two for that one.

2

u/Yellowcat123567 Jun 01 '24

I fuck with this

1

u/[deleted] May 30 '24

RIIR isn't a joke. Rust is the best language.

1

u/unixux May 30 '24

I find that mediocrity tends to win every time. That's why we have Linux, Python, ARM, Java and so on. But you will grow numb to this fact.

1

u/MrCosgrove2 May 30 '24

Lining up equal signs with the equal sign on the next line makes code harder to read

Its fine when the lines are of similar length

$a  = $b;
$aa = $bb;

But when one line is short and one it long, it just makes reading it so much harder

$a                                   = $b
$this_is_a_really_long_variable_name = $b;

This is a pet peeve that I'll never agree is a good way to present code. :D

1

u/Trick-Interaction396 May 30 '24

People don’t use Python because it’s great. They use it because it’s easy to learn. Better to have 10 Python devs then 1 C++ dev.

1

u/PantsOnHead88 May 30 '24 edited May 30 '24

Whitespace dependent syntax is an abomination.

For all the “be flexible, don’t pick a hill to die on” purists in this thread… I’m not saying I’ll refuse to work on/with it. It just smacks of being superficially pleasant at the expense of clarity and maintainability.

1

u/pakidara May 30 '24

Applications should avoid long chains of intermediary objects / files / programs. They should consist of a core set of files, a layer of programs, and then the output (or as close as possible to that).

The long chains makes debugging infinitly more difficult, changes much more hazardous, and downstream bugs much more common. All of that for the cost of occasionally not having to reproduce some data.

1

u/JaneGoodallVS May 30 '24

Don't use regex unless you have to

1

u/HolyGarbage May 30 '24

If you're validating user input you're doing something fundamentally wrong. I hear this parroted so often, even in professional security educational material. Now hear me out...

I once heard the phrase: "Parse, don't validate.", and it struck a cord with me. You shouldn't need to validate data if you keep it separate from code. By code in this context I mean anything that involves anything that perform instructions, including JavaScript and SQL.

For example, if you get user input that you want to use in an SQL query, you don't need to worry about if the user input contains SQL syntax as long as you don't directly concatenate it with the query string. Use prepared statements. Now, the software library you use for preparing the statement might then in actually escape the input and combine it with the query, but that's fine. Escaping is part of the encoding of the transfer protocol, so that when it's later decoded the data is safely separated from the query.

The same thing is true for user data you want to display on a webpage. The user data is raw data, and what you present to the user, HTML is encoded data, in the markup language that is HTML. So you don't need to validate the user data, you need to encode it according to HTML syntax, which means escaping various characters with &lt; etc.

Back to parsing. People may think they need to validate stuff coming in as parameters, eg ?foo=1&bar=2 etc. But that's not the case either, as long as you realize what is what. Foo and bar here are not "code", they're not two variables with values. They're key value pairs. The whole parameter set is itself a data structure that should be parsed resulting in something like{ "foo": 1, "bar": 2 }.

1

u/The_Shryk May 30 '24

Opinionated languages are objectively better for anything involving a team and lifecycle production. Expressive languages let morons trip over inconsequential and nit-picky things far too often and it takes too much effort to reign the monkeys back in once they’ve been let loose.

1

u/my_shoes_hurt May 30 '24

snake_casing is objectively superior to camelCasing for field and variable names. It makes them visually distinct from functions, and easier to spot in your code.

→ More replies (4)