News for hackers. Stuff that matters.

techsin101

Re:Do it yourself: stop looking for a cofounder on Friday May 24, 2024 @11:19PM (#40472401)
seems like a dismissive attitude... engineer can cost 1M a year easily and that eliminates viability of lot of small ideas. It's no different than internet servers costing thousands and then suddenly innovation makes them cost less by many factors and creating a surge in new startups.
Re:Ask HN: I can no longer like React, do you? on Monday April 29, 2024 @06:44PM (#40205005)
just from pure api perspective how is setA, setB, setC better than...

this.setState({this.state: val})

which was already pushing limit of normal behavior which is

state.A = val

just to be revise

i went from having to do

state.onlineStatus = 'active'

to

const [onlineStatus, setOnlineStatus] = useState('active')

Instead of being able to get autocomplete and normal refactoring you would get from plain js.. now you need to add typescript to supplement the mess...

const obj = {

onlineStatus: 'inactive', shoppingCart: '3899x', lastActive: 1834393939 }

obj. [autocomplete anywhere in the project]

vs MORE Boilerplate

Ask HN: I can no longer like React, do you?

If you resonate with what I said, there is no need for me to write anything here, and if you disagree then no amount of reasoning will be enough. Instead I'll just say where I am coming from and avoid going into technical reasons too much..I started frontend as a hobby in 2010, I've been working as one for 8 years. Jquery was great but everytime you had to invent your own MVP. Came angular and...

( Read More... | 32 comments | 5 points | on HN )

Ask HN: How do I go about this startup idea?

Virtual Receipts - you get a digital receipt wherever you use your credit card.Basically I find it annoying having to get a physical receipt and keep it around for 10 or so days in case I'd need it.But If I could go somewhere and set my default preference (Print|Digital). Then it'd be in my mobile phone.It'd use CC'd to keep track of receipts.State of this idea: ------------------> need of...

( Read More... | 1 comment | 2 points | on HN )
Re:Ask HN: I prefer single letter variables on Tuesday December 27, 2022 @06:09PM (#34155127)
yes this as well... wrong info is worse than no info. Short var almost is like writing _list "_" indicates it's an internal property ignore it
Re:Ask HN: I prefer single letter variables on Tuesday December 27, 2022 @12:31AM (#34145429)
At first I thought you were arguing against the point I made, but after reading this fully I totally agree. The worst offenders that are hell bent on naming variables as sentences are java developers. For some reason the boiler plate required by Java is no long enough for them. Lol. Joking aside, I think anywhere where the code is an API for external functions or anything like that. Having a very descriptive name and consistent convention is good, also if the variable is being carried over in a nested code or is being passed around or is being used 50 lines down somewhere then it is useful to name it in a way that is recognizable

Ultimately, I think even the choice of naming something and using a single letter communicates your intentions. If you make something a single letter then you're telling the reader that do not even worry about this variable it is just passing through, but if you need something your communicating your intentions of using this variable in the future it is more permanent in a sense

Re:Ask HN: I prefer single letter variables on Tuesday December 27, 2022 @12:24AM (#34145375)
Sure, in this example user looks better. But as I said this code is not going to be existing on its own. There's going to be code preceded by this. Which is going to give a pretty good idea of what is being filtered on and you can always have comments before the code that can explain the general idea of what you're trying to achieve instead of burdening short-lived variables with a role of needing to give hints of what's going on at the expense of readability and speed of parsing mentally
Re:Ask HN: I prefer single letter variables on Tuesday December 27, 2022 @12:21AM (#34145360)
If there is every time there a single variable is being searched then it means that it was not limited to that scope and by let's go. I mean in few lines front and back and if it wasn't then it should have never been a single letter variable. I see single letter variables as placeholders that are meant to live very temporarily. Few lines at best
Re:Ask HN: I prefer single letter variables on Tuesday December 27, 2022 @12:19AM (#34145347)
.... Always
Re:Ask HN: I prefer single letter variables on Monday December 26, 2022 @08:32PM (#34143916)
Yea, often vars are placeholders and making them descripting just makes them misleading and harder to get to the point. But yea at least I trust myself to refactor code and make the var name more descriptive if I see it's no longer just temporary placeholder... but would be a challenge to have others follow the same principle. One using is short name because it only helps, another to use it because you are just lazy.
Re:Ask HN: I prefer single letter variables on Monday December 26, 2022 @08:26PM (#34143891)
I'd prefer it like this...

// get users older than 90

a = data.results;

b = a.filter(u => u.dob > 123456)

seniorUsers = b.map(x => {name: x.name, age: x.age})

// self contained

// comes out with one final var that is named to be used later on

// other vars are obviously meant to be ignored and just placeholders

// comment explains what is happening so each var doesn't need sacrifice comprehension speed

Ask HN: I prefer single letter variables

So it's almost universally accepted variable names should always be descriptive, consistent, etc... but I'm sure there are scenarios where single variable names are preferable. I can't quite formulate solid parameters of when that is, but here is a try:- There are few variables in the whole code block < 5.- Amount of lines is < 25.- Code is very functional in nature. ie. no...

( Read More... | 51 comments | 6 points | on HN )
investors pay you money

you give investors equity

you use that money to pay for services, like a logo

you exchanged equity for logo, what's unclear there?

Ask HN: Is there a structure for startups where you can have 50 founders?

There is an enormous opportunity where lot of people could give small amount of time, network or money to make lots of ideas come to life. But right now it doesn't happen because of concerns:- distrust, how would I know I'm awarded fairly? who decides that? lets say I worked on something I was good at, i.e. I made a logo or I designed database schema. how much should I get?- accountability,...

( Read More... | 3 comments | 2 points | on HN )
Re:Stable Diffusion 2.0 Release on Wednesday November 23, 2022 @11:20PM (#33727757)
that would suck immensely for various downsides
Re:Stable Diffusion 2.0 Release on Wednesday November 23, 2022 @11:18PM (#33727747)
is there a tool that uses to create UX/UI designs. It'd be really cool to get inspirations...
Re:The Perks of a High-Documentation, Low-Meeting Work Culture on Tuesday November 22, 2022 @10:05PM (#33714652)
Unless entire team is spending 2 days on docs every week, docs are hell. I prefer comments in the code.
Re:Ask HN: HN what text editor do you use for notes? on Tuesday November 22, 2022 @01:20PM (#33708976)
also Trillium and Zettlr
Re:The Decline of Work on Monday November 21, 2022 @09:48PM (#33701140)
The illusion of a dream that kept people grinding has shattered. Housing prices doubling means that it's now clear that you will never achieve financial freedom, not that most would have but now there is no hope. Without any end goal, it's pointless to give your 100%. Now people's next goal is to make best what you are gonna get, and that is to do minimum.
Re:Ask HN: HN what text editor do you use for notes? on Wednesday November 16, 2022 @08:17PM (#33633630)
only down side if vscode isn't open then it takes a while to open up
Re:Ask HN: HN what text editor do you use for notes? on Wednesday November 16, 2022 @08:16PM (#33633622)
I use notepad and trying to move away from it. 1st there is friction creating new files, 2nd no search functionality, 3rd I've too much freedom to just create files anywhere.
Re:Ask HN: HN what text editor do you use for notes? on Wednesday November 16, 2022 @08:15PM (#33633614)
Hey, if this is upsetting then I apologize
Re:Ask HN: HN what text editor do you use for notes? on Wednesday November 16, 2022 @08:14PM (#33633606)
i actually like vscode because of shortcuts and muscle memory, this could be it

Older »