338
top 50 comments
sorted by: hot top controversial new old
[-] million@lemmy.world 160 points 1 year ago* (last edited 1 year ago)

Refactoring is something that should be constantly done in a code base, for every story. As soon as people get scared about changing things the codebase is on the road to being legacy.

[-] brettvitaz@programming.dev 27 points 1 year ago* (last edited 1 year ago)

Only if the code base is well tested.

Edit: always add tests when you change code that doesn’t have tests.

load more comments (1 replies)
load more comments (12 replies)
[-] fubo@lemmy.world 137 points 1 year ago* (last edited 1 year ago)

Until you know a few very different languages, you don't know what a good language is, so just relax on having opinions about which languages are better. You don't need those opinions. They just get in your way.

Don't even worry about what your first language is. The CS snobs used to say BASIC causes brain damage and that us '80s microcomputer kids were permanently ruined ... but that was wrong. JavaScript is fine, C# is fine ... as long as you don't stop there.

(One of my first programming languages after BASIC was ZZT-OOP, the scripting language for Tim Sweeney's first published game, back when Epic Games was called Potomac Computer Systems. It doesn't have numbers. If you want to count something, you can move objects around on the game board to count it. If ZZT-OOP doesn't cause brain damage, no language will.)


Please don't say the new language you're being asked to learn is "unintuitive". That's just a rude word for "not yet familiar to me". So what if the first language you used required curly braces, and the next one you learn doesn't? So what if type inference means that you don't have to write int on your ints? You'll get used to it.

You learned how to use curly braces, and you'll learn how to use something else too. You're smart. You can cope with indentation rules or significant capitalization or funny punctuation. The idea that some features are "unintuitive" rather than merely temporarily unfamiliar is just getting in your way.

[-] Walnut356@programming.dev 37 points 1 year ago

Please don't say the new language you're being asked to learn is "unintuitive". That's just a rude word for "not yet familiar to me"...The idea that some features are "unintuitive" rather than merely temporarily unfamiliar is just getting in your way.

Well i mean... that's kinda what "unintuitive" means. Intuitive, i.e. natural/obvious/without effort. Having to gain familiarity sorta literally means it's not that, thus unintuitive.

I dont disagree with your sentiment, but these people are using the correct term. For example, python len(object) instead of obj.len() trips me up to this day because 99% of the time i think [thing] -> [action], and most language constructs encourage that. If I still regularly type an object name, and then have to scroll the cursor back over and type "len(", i cant possibly be using my intuition. It's not the language's "fault" - because it's not really "wrong" - but it is unintuitive.

load more comments (8 replies)
load more comments (9 replies)
[-] argv_minus_one@beehaw.org 133 points 1 year ago

Dynamic typing is insane. You have to keep track of the type of absolutely everything, in your head. It's like the assembly of type systems, except it makes your program slower instead of faster.

[-] Cratermaker@discuss.tchncs.de 27 points 1 year ago

Nothing like trying to make sense of code you come across and all the function parameters have unhelpful names, are not primitive types, and have no type information whatsoever. Then you get to crawl through the entire thing to make sense of it.

load more comments (10 replies)
[-] AdmiralShat@programming.dev 105 points 1 year ago* (last edited 1 year ago)

If you don't add comments, even rudimentary ones, or you don't use a naming convention that accurately describes the variables or the functions, you're a bad programmer. It doesn't matter if you know what it does now, just wait until you need to know what it does in 6 months and you have to stop what you're doing an decipher it.

[-] A_Porcupine@lemmy.world 37 points 1 year ago

However, engineers who rely solely on comments to explain their code, are bad at writing readable code.

load more comments (1 replies)
load more comments (19 replies)
[-] BrotherL0v3@lemmy.world 92 points 1 year ago

Tools that use a GUI are just as good (if not better) than their CLI equivalents in most cases. There's a certain kind of dev that just gets a superiority complex about using CLI stuff.

[-] fubo@lemmy.world 71 points 1 year ago

The big thing you can do from the command line is script it.

load more comments (2 replies)
[-] brettvitaz@programming.dev 38 points 1 year ago

I used to think something like this when I was younger. I spent an inordinate amount of time looking for good gui versions of cli tools. I have come to understand that this is not usually the case and cli tools are more convenient much of the time. I would not classify this as superiority complex, unless I’m being a jerk about it. I don’t care what you use, I just use whatever has the lowest barrier to entry with the most standardization, which is usually the original cli tool.

That said, jetbrains git integration is awesome.

load more comments (1 replies)
[-] stilgar@infosec.pub 28 points 1 year ago

There are some massive intrinsic advantages of the CLI though, that apply for everyone, not just leetcoders:

  • The terminal can remember everything you ever did. Forgotten the command you wrote 2 months ago? You can do a search for it with a tool like fzfand run the exact same command again.
  • Communicating with others. GUI programs require step by step instructions, often accompanied by screenshots while CLI may be copy/pasted.
  • Combining programs together. There are a few different techniques for combining CLI programs to search/format output, use secrets without ever having them in the clipboard or on disk, monitor something frequently/constantly etc etc

So while I agree with you that there's plently of elitism around the CLI, you do yourself a disservice if you try to avoid it.

load more comments (6 replies)
[-] uniqueid198x@lemmy.dbzer0.com 81 points 1 year ago

Programing is a lot less important than people and team dynamics

load more comments (4 replies)
[-] MrTallyman@programming.dev 80 points 1 year ago

My take is that no matter which language you are using, and no matter the field you work in, you will always have something to learn.

After 4 years of professional development, I rated my knowledge of C++ at 7/10. After 8 years, I rated it 4/10. After 15 years, I can confidently say 6.5/10.

[-] Herowyn@jlai.lu 28 points 1 year ago

This take gets colder as you get more experience.

load more comments (12 replies)
[-] Vince@feddit.de 74 points 1 year ago* (last edited 1 year ago)

Not sure if these are hot takes:

  • Difficult to test == poorly designed
  • Code review is overrated and often poorly executed, most things should be checked automatically (review should still be done though)
  • Which programming language doesn't matter (within reason), while amount of programming languages matters a lot
[-] brettvitaz@programming.dev 32 points 1 year ago

I agree with your first point, but pretty strongly disagree with the other two. Code review is critical. Devs should be discussing changes and design choices. One Dev can not be all things all the time and other people have experience you do not or can remind you of things you forgot. Programming language absolutely matters when you’re not the only dev on the team.

load more comments (3 replies)
load more comments (7 replies)
[-] witx@lemmy.sdf.org 70 points 1 year ago

Python is only good for short programs

load more comments (18 replies)
[-] corstian@lemmy.world 67 points 1 year ago

Most modern software is way too complex for what it actually does.

[-] asyncrosaurus@programming.dev 66 points 1 year ago

SPAs are mostly garbage, and the internet has been irreparably damaged by lazy devs chasing trends just to building simple sites with overly complicated fe frameworks.

90% of the internet actually should just be rendered server side with a bit of js for interactivity. JQuery was fine at the time, Javascript is better now and Alpinejs is actually awesome. Nowadays, REST w/HTMX and HATEOAS is the most productive, painless and enjoyable web development can get. Minimal dependencies, tiny file sizes, fast and simple.

Unless your web site needs to work offline (it probably doesn't), or it has to manage client state for dozen/hundreds of data points (e.g. Google Maps), you don't need a SPA. If your site only needs to track minimal state, just use a good SSR web framework (Rails, asp.net, Django, whatever).

load more comments (8 replies)
[-] Elderos@lemmings.world 63 points 1 year ago* (last edited 1 year ago)

The best codebase I have ever seen and collaborated on was also boring as fuck.

  • Small, immutable modules.
  • Every new features was coded by extension (the 'o' in S.O.L.I.D)
  • All dependencies were resolved by injection.
  • All the application life cycle was managed by configurable scopes.
  • There was absolutely no boiler plate except for the initial injectors.
  • All of the tests were brain-dead and took very minimal effort to write. Tests served both as documentation and specification for modules.
  • "Refactoring" was as simple as changing a constructor or a configuration file.
  • All the input/output of the modules were configurable streams.

There is more to it, but basically, it was a very strict codebase, and it used a lot of opinionated libraries. Not an easy codebase to understand if you're a newbie, but it was absolutely brain dead to maintain and extend on.

Coding actually took very little time of our day, most of it consisted of researching the best tech or what to add next. I think the codebase was objectively strictly better than all other similar software I've seen and worked on. We joked A LOT when it came time to change something in the app pretending it would take weeks and many 8 pointers, then we'd casually make the change while joking about it.

It might sound mythical and bullshity, and it wasn't perfect, it should be said that dependency injection often come in the form of highly opinionated frameworks, but it really felt like what software development should be. It really felt like engineering, boring and predictable, every PO dreams.

That being said, I given up trying to convince people that having life-cycle logic are over the place and fetching dependencies left and right always lead to chaos. Unfortunately I cannot really tell you guys what the software was about because I am not allowed to, but there was a lot of moving parts (hence why we decided to go with this approach). I will also reiterate that it was boring as fuck. If anything, my hot take would be that most programmers are subconsciously lying to themselves, and prefer to code whatever it is they like, instead of what the codebase need, and using whatever tool they like, instead of the tools the project and the team need. Programming like and engineer is not "fun", programming like a cowboy and ignoring the tests is a whole lot of fun.

load more comments (5 replies)
[-] OADINC@feddit.nl 56 points 1 year ago* (last edited 1 year ago)

This is the only way;

if (condition) {
    code
}

Not

if (condition)
{
    code
}

Also because of my dyslexia I prefer variable & function names like this; 'File_Acces' I find it easier to read than 'fileAcces'

load more comments (5 replies)
[-] qwerty@discuss.tchncs.de 55 points 1 year ago

Internet would be better if javascript was never invented.

[-] whoisearth@lemmy.ca 29 points 1 year ago

The JavaScript ecosystem is made worse by the legions of "developers" in it which amount to bro-velopers that put no thought into if something is needed before they create it. There's a strong overlap between the idiots in crypto and JavaScript developers that needs to be decoupled drastically.

load more comments (1 replies)
[-] r1veRRR@feddit.de 55 points 1 year ago

Compiler checked typing is strictly superior to dynamic typing. Any criticism of it is either ignorance, only applicable to older languages or a temporarily missing feature from the current languages.

Using dynamic languages is understandable for a lot of language "external" reasons, just that I really feel like there's no good argument for it.

load more comments (5 replies)
[-] hansl@lemmy.ml 48 points 1 year ago

Hot take: people who don’t like code reviews have never been part of a good code review culture.

load more comments (2 replies)
[-] flamboyantkoala@programming.dev 47 points 1 year ago

Agile in it’s current implementation with excessive meetings wastes more time than the mistakes it tries to avoid.

load more comments (8 replies)
[-] Crisps@lemmy.world 44 points 1 year ago

Dynamically typed languages don’t scale. Large project bases become hard to maintain, read and refactor.

Basic type errors which should be found in compilation become runtime errors or unexpected behavior.

load more comments (5 replies)
[-] Yearly1845@reddthat.com 43 points 1 year ago

Tabs are better than spaces

load more comments (19 replies)
[-] Masterkraft0r@discuss.tchncs.de 40 points 1 year ago* (last edited 1 year ago)

As an embedded firmware guy for 10ish years:

C can die in a fire. It's "simplicity" hides the emergent complexity by using it as it has nearly no compile time checks for anything and nearly no potential for sensible abstraction. It's like walking on an infinite tight rope in fog while an earth quake is happening.

For completely different reasons: The same is true for C++ but to a far lesser extent.

load more comments (7 replies)
[-] olafurp@lemmy.world 38 points 1 year ago

You can use all the classes, patterns, functions, methods you want but if it's not readable it's garbage.

load more comments (2 replies)
[-] gpopides@lemmy.world 38 points 1 year ago

Not everything should be beginner friendly. Trying to nerf things because they are not beginner friendly should not be how tools/patterns of languages are designed.

Its ok to have more advanced topic that require more knowledge and that people don't understand from the first moment they see them.

load more comments (2 replies)
[-] makr_alland@lemmy.world 37 points 1 year ago

My hot take: Vi, make and C would have gone the way of COBOL a long time ago if it wasn't for a lot of programmers thinking "my tools are more difficult to use, hence I'm a better programmer".

load more comments (12 replies)
[-] shapis@lemmy.ml 36 points 1 year ago
load more comments (28 replies)
[-] Xylight@lemmy.xylight.dev 35 points 1 year ago

Make your app use native components instead of making your own crappy theme for the 782th time

load more comments (2 replies)
[-] Buttons@programming.dev 35 points 1 year ago

Shorter code is almost always better.

Should you use a class? Should you use a Factory pattern or some other pattern? Should you reorganize your code? Whichever results in the least code is probably best.

A nice thing about code length is it's objective. We can argue all day about which design pattern makes more sense, but we can agree on which of two implementations is shorter.

It takes a damn good abstraction to beat having shorter code.

load more comments (13 replies)
[-] ahmed@discuss.tchncs.de 35 points 1 year ago

Oop is overrated

I never can understand classes

load more comments (13 replies)
[-] words_number@programming.dev 33 points 1 year ago

JS is horse shit. Instead of trying to improve it or using that high level scripting language as a compilation target (wtf?!), we should deprecate it entirely and put all efforts into web assembly.

load more comments (17 replies)
[-] IcecreamMelts@lemmy.world 33 points 1 year ago

Microsoft has not made a good product. Ever. Every program has issues that should not be there if you're selling it. Yet they get away with it

load more comments (13 replies)
[-] popcar2@programming.dev 32 points 1 year ago

Web development feels like it's stuck in the early 2000's. I've ranted a lot about it over the years but I just don't know how everyone is okay with it. I'm sure tons of people will disagree.

HTML is bad. The language itself feels unintuitive and is clunky compared to modern markdown languages, and let's be honest, your webpage just consists of nested <div> tags.

CSS is bad. Who knew styling can be so unintuitive and unmanageable? Maybe it made sense 25 years ago, but now it's just terrible. It's very clunkily integrated with HTML too in my opinion. Styling and markdown should be one easier to use language where 50% of it isn't deprecated.

Javascript has been memed to death so I won't even go there. Typescript is OK I suppose.

And now for my hottest take: ~10+ years ago I saw web building tools like Wix and I completely expected web development to head in the direction using a GUI to create, style, and script from one interface, even allowing you to create and see dynamic content instantly. I've seen competitors and waited for "the big one" that's actually free and open source and good enough to be used professionally. It never happened. Web dev has just gone backwards and stuck in its old ways, now it's a bloated mess that takes way more time than it deserves.

The Godot engine is actually a pretty good option for creating GUI apps and it's exactly what I envisioned web dev should've been this past decade. One language, intuitive interface, simple theming and easy rapid development... Shame it never happened.

load more comments (15 replies)
[-] nous@programming.dev 32 points 1 year ago

In unit testing, a "unit" does not have to be the smallest possible section of code. It can be a while class or module or even set of related classes/modules. Testing individual functions in isolation leads to brittle tests that easily break during refactoring. Testing overall system behaviour results in more robust tests that require fewer changes during refactoring which gives you more confidence then you have not introduced a regression.

load more comments (8 replies)
[-] Swiggles 31 points 1 year ago

Python is stupid. Using non printable characters as anything other than token separation is just asking for trouble.

load more comments (22 replies)
[-] BatmanAoD@programming.dev 31 points 1 year ago* (last edited 1 year ago)

The programming languages you use, and the variety of languages you learn, deeply influence how you think about software design.

Software would be much more reliable (in general) if Erlang had become one of the dominant languages for development.

Go sacrifices too much for superficial simplicity; but I would like to see a language that's nearly as easy to learn, but has a better type system and fewer footguns.

Unit testing is often overrated. It is not good for discovering or protecting against most bugs.

Build/test/deploy infrastructure is a genuinely hard problem that needs better tooling, particularly for testability.

load more comments (7 replies)
[-] chicken@lemmy.dbzer0.com 30 points 1 year ago

I am not smart enough to effectively code with certain languages and design patterns and that's ok. There is nothing wrong with accessibility being prioritized or with making tradeoffs for the sake of reducing complexity.

load more comments (4 replies)
[-] NewPerspective@lemmy.world 30 points 1 year ago

If white space carries any function that the compiler/interpreter needs to know about like structure or scope, it's probably not a very good programming language.

load more comments (14 replies)
[-] escapesamsara@discuss.online 30 points 1 year ago

Python is legitimately the best language by far for the vast majority of non-performance critical tasks, and most tasks that need to be developed for are not performance critical.

load more comments (16 replies)
[-] hellishharlot@programming.dev 29 points 1 year ago

Using single character variable names is always bad practice

load more comments (27 replies)
[-] akd@lemm.ee 28 points 1 year ago
load more comments (4 replies)
load more comments
view more: next ›
this post was submitted on 01 Sep 2023
338 points (100.0% liked)

Programming

17352 readers
233 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