News for hackers. Stuff that matters.

hussainbilal

Re:Comments in React: The Good, the Bad and the Ugly on Sunday April 30, 2023 @06:55PM (#35767323)
Or... You could define a comment component that either,

1. Always takes props but always returns null. (Useful for Todo comments that contain jsx code snippets that don't render)

2. Or, always takes children and a single comment prop, and always returns children in react fragment. (To associate specific comments with specific jsx snippets)

You could even have multiple exports for them. (I.e. Todo vs Warning vs. Comment)

Re:Switching to C over 'Modern' Programming Languages on Friday April 14, 2023 @06:33PM (#35575699)
You ever get the feeling that C should be grouped with all the XML and (semantic) web technologies the W3C no longer has active working groups for?

Maybe combine them to make a Spring-like framework, but for C?

Long standing non-changing specs and standards should be married, and with children.

Re:Software Forge Performance Index on Monday April 10, 2023 @11:32AM (#35513550)
The only time I look at the actual web interface for bitbucket or github is during PR reviews. Otherwise I'm either using the respective desktop app or grabbing blames from my editor. So, I'm always locally browsing branches.

So realistically, only Commit (under Browsing Git repositories) and Code review actually matter. Lighthouse metrics don't matter much at that point (if I'm at the PR stage I will put up with an unusual delay to get the PR through).

I think that's what you're seeing with these metrics. Dev's don't care about a repo's browser experience. They care about the terminal/desktop-app experience.

There is a knowledge project podcast /w Jim Collins that answers this question indirectly.

https://fs.blog/knowledge-project-podcast/jim-collins-2/

Long story short: Happiness is derivable mainly either through relationships or transactions (can read this as opportunities you create).

The problem: Deriving happiness through transactions doesn't scale beyond you and your abilities and your time. Deriving happiness through relationships does scale.

Coming back to your question: conversation and listening skills are relevant to both. There is more certainty in using these skills towards transactions (think sales). But you should be putting these skills towards relationship building as well. Mainly because other people may be (and often are for strong relationships) happy to help you out for nothing or very little in return mainly because of a trust that if you're able to you will help them for some future endeavors / dilemmas. This can be seen as an investment towards leverage (think sales growth).

The podcast doesn't take the view I wrote here. The podcast conversation is more interpersonally oriented in its view, but the conversation is oriented towards CEOs.

Re:Is TypeScript actually worth It? on Friday January 13, 2023 @08:48AM (#34367583)
The short answer is no. Typescript is not worth it. The reason is because:

- WebAssembley (which other, controversially better or at least more adopted languages also target)

- Javascript's spec. is not time invariant (https://github.com/tc39/proposals#readme)

- Typescript isn't the best solution (There are better less adopted solutions providing types, like Elm, Rescript, or Purescript)

For Javascript, the real solution is hygienic macros and contracts, but because `eval()` can't get no love or safety on the browser side, everyone on the server-side has to suffer.

Ironically, introducing a fake compilation step where Javascript transpiles to Javascript (not like babel.js which targets older JS, but literally just the same lang spec) is the way to side step the `eval()` problem, lol! (expanding those `eval()` in a fake compile step)

Re:Ask HN: Why Terraform Was Created? on Wednesday January 11, 2023 @09:24AM (#34338770)
Not an expert nor a user of terraform, but I'm currently learning about the tool, and I like to learn by reading from books and docs, rather than diving straight in and doing.

Based on what I've read, while Hashicorp tools may look like their only contribution is platform agnostic tooling, a deep dive into the docs reveals a focus on dynamically changing architecture and providing tooling to scale dynamically changing architectures in short time scales to any number of resources (i.e. not just machines / VM / containers / compute resources, but resources like users, user-generated resources, user-generated secrets etc.)

My impressions thus far is that Hashicorp is aware of the variety of alternative tools, that's why their certifications / training / professional services are only available for the tools truly core to supporting dynamic architectures : Terraform, Consul and Vault.

https://www.hashicorp.com/customer-success/professional-serv...

https://www.hashicorp.com/customer-success/enterprise-academ...

https://www.hashicorp.com/certification

Re:Ask HN: Is Programming Culture Immature? on Sunday January 01, 2023 @02:29PM (#34209844)
Perspective: You're observing a few major factors in play.

1. The majority of programmers/IT/Tech-workers are young (<=3 years of work experience). They don't have enough experience to know what's good (or even what matters) for their craft. (i.e. no one should care about programming language because often you don't get to pick it. Your employer does.)

2. The majority of programmers aren't in North America. They're in Europe and Asia. So there is a linguistic barrier. And this linguistic barrier will get hit because the majority of programming work is done in English. So many of these young non-north-american programmers are trying to polish off their English in these online forums. (So expect people to talk past each other or losing things in translation or flat out misreading subtext)

3. The majority of employers of young/non-senior programmers are not product companies. They're services, start-up, IT or financial companies. Services and start-up companies are sales focuses. So a programmers career path will always ultimately lead to sales to some extent. IT and Financial companies have a larger focus on infrastructure or data reporting. (i.e. majority of careers force programmers to become something else, like leaders. So there is a very real brain drain away from the craft)

---

for OP:

The simple solution to what you're observing is to stop reading online forums. Instead watch youtube conference videos, read books, and listen to podcasts. When programmers don't have anonymity, the quality and relevance of the content/discussion go up dramatically.

---

Irrelevant comment:

I think the reason for all this is because anonymity allows insecure/young programmers to test waters before asserting their ideas in the workplace. This is most likely what all the young programmers being pushed towards different careers are doing. They're looking for a magical piece of information that will force a business to align to their own career aspirations rather than changing their own goals to better align with their employer's objectives (i.e. a very uncomfortable sales-oriented self-transformation).

Re:Boris, a tradeoff-oriented goal-setting process on Thursday December 08, 2022 @08:41AM (#33907782)
It makes me happy to know others are thinking in terms of trade-offs as goals.

I wrote an article about this from the perspective of avoiding software technical debt, but I have to admit, this article does a better job on explaining why it works than my own article (╯°□°)╯︵ ┻━┻

https://connected.io/post/how-to-avoid-technical-debt/ tldr: You can find overlap or convergence by applying PCA on a trade-off matrix.

Middle Management is more or less resource allocation (so optimization problem maybe of the stochastic, multi-agent, multi-criteria and/or multi-objective flavour if you want it to be super complex).

This article is right for the wrong reasons. AI/ML (which approximates optimization problems due to inputs not being clearly defined) is not required for the replacement of middle management (an actual optimization problem with clearly defined inputs).

Re:Minimalism in programming language design on Tuesday May 24, 2022 @07:51AM (#31490820)
This article went in a completely opposite direction I thought it would be going.

Based on the title, I thought they were going to talk about how all operators should be expressed with 3 characters (i.e. `:=:`, `|=>`, etc.) or how all reserved words should be 4 character words.

Re:Why do you waste so much time on the internet? on Saturday May 07, 2022 @09:16PM (#31300346)
You've probably heard of this: atomic habits.

The idea of an atomic habit is that there is no disconnect between a habit and the objective you're aiming for. So in this case, the habit was not to learn a new language, but just consistently and constantly engaging with French. When I hit a wall, I doubled down my atomic habit to a simpler macro-french where all my past knowledge would still be applicable due to the etymology heavily influenced from french colonization.

I have no suggestion for artists, because the point is to pickup phonetics under variation. If you listen to the same artist, you're only picking up their way of speaking.

i.e. I'm guilty of playing dubmatique and maitre-gims on loop. Did nothing for improving my ability to parse a spoken french sentence in real-time. I just ended up memorizing the lyrics.

I suggest listening to pop music on shuffle, even if it's not your cup of tea. Pop music is usually very good with enunciating words. Additionally in my experience, pop music lyrics align really well with a language's IDF.

Re:Why do you waste so much time on the internet? on Friday May 06, 2022 @01:01PM (#31287443)
It sounds like their habits are influenced by your environment. Just tie the habit to a new productive habit. Make it work for you.

Example 1: start learning a new natural language, and also switch all your social media feeds to only provide content in that language. You'll either lose interest in learning the language and start withdrawing from social media, or your unbreakable habit will sustain your new language learning habit.

Example 2: I listen to a lot of music. I don't feel right unless it's running in the background. So I tried learning french and listen to only french pop. It worked for a few months, but then I hit the problem of not being able to pick up spoken (not written) french and parse its grammar while also trying to pick up the phonetics of native speakers. But I then learned about creole and its more flexible and simpler grammars and phonetics. I was able to start thinking in the language using french vocabulary. So I pivoted my habit to learning Haitian Creole and listening to Haitian music.

Re:Hush, a modern shell scripting language on Tuesday April 26, 2022 @07:49AM (#31166301)
Side note: The most straightforward way to incoporate YAML as an elevated text "type" would be to define a new type of pipeable file descriptor on all commands, specifically meant for replacing shell script options / flags. (That way options aren't mixed with stdin)

Edit: and you get typing validation for free by running your yaml options through a yaml schema validator should you choose to do so

Re:Hush, a modern shell scripting language on Tuesday April 26, 2022 @05:34AM (#31165520)
Why use types? Why not introduce built in parsers to provide validations instead? (i.e. https://github.com/antlr/grammars-v4)

I think hush is going in the wrong direction. The majority of shell automation is associated with running IaC and container images / orchestration tools.

Shell scripts don't need to follow functional programming or OOP. They need to be container-oriented / VM-oriented / image-oriented with a conformation to YAML notation as this is already the adopted norm for containers and IaC.

Re:I hate Spring (2014) on Monday April 11, 2022 @07:47AM (#30987392)
I'm not a Spring expert, but from my time working in it, Spring is designed with best practices as default config values.

If you're not only changing config but rewriting templates, then you're already fighting against the framework and deviating from best practices. Don't do that.

My understanding is that if you're regularly rewriting Spring provided templates, then you've likely hit the need for Spring AOP, so the DI magic can be kept manageable.

If you're a consumer and you're hitting this issue (needing to regularly provide own custom templates on the client-side), then you've likely hit the need for Spring Integration on the server-side.

Rather than showing the top ten for statistical significance, wouldn't it make more sense to use PCA on the ratings and show each component's top 10 instead?
Re:Ask HN: Any weird tips for weight loss? on Thursday March 17, 2022 @09:56AM (#30711205)
Depends on you BMI.

If your BMI is high, then Keto + intermitten fasting + calorie deficit is your best bet (I use to be 300 pounds and lost 50 pounds in 3 months.)

If your BMI is low, then regular cardio (i.e. calorie deficit at the cost of increased hunger) is your best bet (how I got myself down to 200 pounds.)

If your lazy, then strength/weight training (i.e. increased muscle weight to replaced fat trading off with an increased metabolism) is your best bet (how I plan on getting to 150 pounds)

Re:Minimal English (2018) on Saturday February 26, 2022 @09:09PM (#30484622)
Not the english my product manager needs, but the english they deserve.

(Edit: Also, the english my code comments deserve) (Edit 2: and my commit messages)

Re:Ask HN: Why do we push people into STEM? on Saturday February 05, 2022 @02:50PM (#30225101)
STEM is a logical next step up from the trades (in terms of career development without starting your own company).

So its probably not so much propaganda. It's more like if you already know a trade and are interested in knowing more or working at a higher-order than what you already do, there's likely a STEM field for you for exactly that pursuit.

i.e.

- Construction worker? Mason? Civil engineer

- Electrician? Electircal engineer

- Mechanic? Mechanical engineering

- CNC Machine operator? Software engineering (if you're interested by the machine itself) or Industrial engineering (if you're interested by the workflow)

Re:Ask HN: When should event-driven architecture be avoided? on Friday February 04, 2022 @09:08AM (#30206908)
Basically this. Theoretically, event-driven architecture within a single machine is just re-inventing pi-calculus (i.e. sending values on channels)

So I would imagine anything single-threaded would not require it.

Though admittedly, the only modern application or program that I can think of that would be single-threaded is a CLI command