HNHacker News
TopNewBestAskShowJobs

oselhn

138 karma · joined October 1, 2015

submissionscomments
oselhn··on The most mentioned books on Stack Overflow
This book was written before Java for C++ developers (amazon shows 1994).

Edit: I agree with your opinion. Just wanted to show that this problem is much older and related to other languages too (probably with the similar OOP implementation).

oselhn··on In Defense of C++
RAII is not superior both ways have their own drawbacks. You can forget to write finally and it may produce duplicated code. On the other hand RAII requires you to create new type just for exception safety (scope guard - which you may also forget to use). I prefer RAII but there are situations where finally leads to more readable code.
oselhn··on Short intro to C++ for Rust developers: Ownership and Borrowing
Can be easily solved by ditching the filters file all together and enabling 'All Files' option in Solution Explorer. Unless you insist on having all files listed by extension, which is imo a useless complete mess for enything but small projects.

Does not work for me, because files are located in subdirectories. I see only long list of files from all directories without filters. Maybe it is just bad project structure but I cannot change it. I found plugin for 2015 which is able to generate filters from directory structure, but I have to wait for upgrade.

oselhn··on Short intro to C++ for Rust developers: Ownership and Borrowing
I don't think so https://www.microsoftstore.com/store/msusa/html/pbpage.Visua...
oselhn··on Short intro to C++ for Rust developers: Ownership and Borrowing
I use Visual C++ 2013 at work and it is quite bad. It is just smarter text editor. There are only most basic refactoring features, even find all references is not reliable (it is text based search). You have to buy another extension to make it usable (Visual Assist or Resharper). Project files are a mess. There is vcxproj file to define build and vcxproj.filters file for directory structure view in VS (I do not understand a reason for this). vcxproj.filters is often broken by VS. It sometimes inserts duplicated lines for no reason if you add or remove some other file from project. Debugger is quite good but still I have some issues(you can't set hexadecimal format just for one variable, it is global option). Overall I have better experience with Eclipse CDT (more features) or Code::Blocks (almost same features but faster) than with VS without extensions. Resharper makes it good IDE but it cost additional money and also it is not fastest extension.

There are reasons for bad code navigation and missing refactoring features: https://blogs.msdn.microsoft.com/vcblog/2015/09/25/rejuvenat...

oselhn··on Millennials aren't cheap, they just have different spending priorities
I am not from UK but at least in my country young people do not vote. They can easily change election outcome without killing old people but they do not bother.
oselhn··on Beware of Developers Who Do Negative Work
You can write functional code with dozens of branches too. In my opinion this is because functional programmers are usually enthusiasts and good programmers. If all programmers start to write functional code you will hate it too.
oselhn··on Visual Studio Code 1.8
Using printf on everything is basically the same as debugger but a lot slower. People also tend to commit those added lines (sometimes commented for future uses) which clutters code base. I think that using permanent logs on higher verbosity plus debugger is a lot more productive.
oselhn··on Donald Trump is the president-elect of the U.S.
Actually the same happened in my country. I was thinking if this is a property of voting system. I like this one https://en.wikipedia.org/wiki/Instant-runoff_voting which theoretically helps to choose compromise candidate for most of the voters. But it is just my opinion I don't know how this works in reality.
oselhn··on Donald Trump is the president-elect of the U.S.
How do you define muslim? Is it someone going from muslim country who is not religious? Someone who goes to mosque once a week? Or someone who is praying all the time and tries to convert other people to his believes? Are all those groups really causing problems for you or society?
oselhn··on Donald Trump is the president-elect of the U.S.
"The Baltic Republics vs. the rest of the USSR."

Not good example. They were not voluntarily part of USSR (see Molotov-Ribentrop pact), Stalin sent a lot of them to Siberia. They have huge Russian minority too (remember Putin's policy for "protecting" russians in foreign countries). It it not easy for them to survive, they have to be as independent on russia as possible, so they have no other choice than integrate into international organizations.

oselhn··on All Olympic gold medal winners in the 100m sprint compared in one race
Quality of musical instrument is huge factor too. I play trombone and I improved significantly only by buying new instrument without changing my practice routine. It is just "cheap" amateur instrument.
oselhn··on Employee #1: Apple
That's not true for linux distros and community supported android (i.e. cyanogenmod).
oselhn··on John Carmack on Inlined Code (2014)
This is definitely not what you learn on college. If you use inheritance instead of composition it is your problem, not OOP problem. You can do the same mess with procedures and structs. OOP is not here to magically solve programmers bad design decisions.
oselhn··on John Carmack on Inlined Code (2014)
From my experience a lot of nested functions usually means spagetti code created from huge functions which were split on radnom points to small functions (which mixed abstraction levels and still do multiple things at once). If you properly design your data model there will be no huge functions and no deeply nested calls.
oselhn··on Linear Programming: How Does It Work?
See this https://en.wikipedia.org/wiki/Simplex_algorithm#Efficiency. But simplex is still widely used because real problems are usually solved in polynomial time. You have to design your problem to not finish in polynomial time.

But I am not a matematician this opinion it just how I understand it.

oselhn··on Linear Programming: How Does It Work?
When I hear linear programming I always remember this method https://en.wikipedia.org/wiki/Ellipsoid_method. It is nice example of algorithm which is not useful for programming only for mathematicians (I believe it was used as proof that linear programming is in P). I think that most of the programmers will have really hard time to implement it and also it is on average slower than simplex method despite a fact that simplex is not in P and this algorithm is.
oselhn··on Code reviews aren’t just for catching bugs
This is not code review problem but huge ego problem. When you are discussing code you should always use technical arguments not personal attacks. Only bad programmers value their ego more than good advice from others. You should always use code review as opportunity to learn/teach new things not to fight or offend others.
oselhn··on Essential C (2003) [pdf]
Some operations are faster on linked list than on vectors (insert on beginning, or on specified iterator position, delete iterator position). They also use less memory in some use cases. I was once optimizing transactional tree structure which internally used std::vector in each node. In most real use cases there was just one item in each vector, but vector preallocated 16 items. So changing to linked list lowered memory consumption significantly without measurable performance impact. The same applied for hash table vs. RB tree. All basic data structures can be useful, you just have to choose proper one.
oselhn··on A Basic Income Should Be the Next Big Thing
I think that most of those students already work during their studies and income difference is so big that they will definitely earn more money in total before 30. I would be more worried about doctors which start to work independently a lot later and do not earn much in the beginning of their carrier (at least in my country).
oselhn··on Xamarin now free in Visual Studio, and Xamarin SDK being open-sourced
In my opinion eclipse is still a lot better than VS. It is smaller, faster and provides more features. For C++ visual studio is not much better than smart editor. It cannot even find all symbol references (it searches just for text). I also do not like licensing (free version works 30 days and than requires registration with a lot of info about you).

I remember that C# version had totally different project settings window as if created by someone else than the rest of VS. But I haven't used it for some time so maybe it is already fixed.

oselhn··on Returning multiple values from functions in C++
I meant something like that:

  struct x {int a, char* b}
  x foo();
  // a lot of code
  struct y {char* y, int x}
  y bar();
  //another header
  struct z {bool a, int b, char* c}
  z foo2();
It is ussually the same data structure, but someone was lazy to define it properly.
oselhn··on Returning multiple values from functions in C++
I prefer to use generic structures (tuples, pairs etc.) or return proper type. One time structs are usually redeclared on multiple places. It is really hard maintain such code.
oselhn··on Dear Skype/Microsoft: Problems with Linux client
Or you can use open protocol and let community to do the work for free.
oselhn··on Stackable Traits Pattern in Scala
Trait in scala represents interface (your type understands some message) or "is a" relation (your type is more specific specialization of type). In your example it is not the case (Tywin is Jamie's father, which should be solved by composition). I do not think that Tywin, Jamie etc. is separate type. In my opinion, those are instances of some type. It is not good practise to call super implementation of method either. You are mixing inheritance and overriding, which in more complex programs always cause trouble (you may break inherited method by changing super implementation). You should solve this by composition (Jamie should not inherit Tywin addToDebt but should depend on Tywin for paying his depts).

I understand what you wanted to show but your example is really confusing and definitely is not correct.

oselhn··on Stackable Traits Pattern in Scala
I think that it does not make sense that Jamie extends Tywin etc. This is not "is a" relation.
oselhn··on Google is banning Flash from its display ads
Ghostery like protection is already built in. There is no menu option for normal browsing mode but you can turn it on in about:config. Set privacy.trackingprotection.enabled to true.
oselhn··on Undefined Behavior in LLVM [pdf]
Problem is that most of the C/C++ programmers do not known about most UB cases. Using C/C++ only if is really needed helps a lot.
oselhn··on Nvidia GPUs can break Chrome's incognito mode
"I don't think it's anything sinister since these are mostly fixes for the game bugs and the rest are resolutions for API ambiguities." I think it is big problem. It is the same as forcing intel to change their CPU to workaround bugs in your application.
oselhn··on Yavide, a Modern C/C++ IDE
I use mostly eclipse, so maybe other IDEs already have it.

* Extract superclass/interface which will work on the whole codebase * Support for NVI - rename, change parameters, convert to virtual interface and back * code duplication detection (maybe exists but I never found sufficient one)

← PreviousPage 2 of 3Next →